-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added sensor_msg.id to avoid out of range error from PX4's SimulatorMavlink #66
base: master
Are you sure you want to change the base?
Added sensor_msg.id to avoid out of range error from PX4's SimulatorMavlink #66
Conversation
… xxx out of range" error from SimulatorMavlink in PX4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested this with using a simulated mag sensor?
e.g. SENS_EN_MAGSIM=1
This might interfere with the simulated sensors.
Hi Jaeyoung, P.D. I wrote you an email to your instutional account. Please, check when you have the time. |
The other possibility would be to address it from PX4, but since Gazebo seems to be working fine, I think this fix presents the least modifications. |
@toshiharutf The problem is that the simulated sensors would be publishing to instance 0. Therefore, if you hardcode the instance number here, it would interfere with the simulated sensor instances. @dagar FYI |
@Jaeyoung-Lim , in the PX4 codebase, I only see mavlink_hil_sensor_t been used in SimulatorMavlink. TBH, I don't understand why SimulatorMavlink is sensors.id as a max length field. Best regards, |
I'm not quite sure why that is a problem? The JSBSim bridge code is publishing a simulated sensor's data. I have been using the suggested change in my simulations for the past couple of weeks and have not noticed an issue. granted maybe I haven't run into a scenario where it is an issue. However, I would like to point out that the jsb simulator that is being provided with the current px4 software does not work. |
Hi Eric, |
Problem description
While running PX4_Autopilot (d98800521644ff2ba5d761c66a0d601016b96dac) in SITL with jsbsim, the following problem arise
This is originated here
src/modules/simulation/simulator_mavlink/SimulatorMavlink.cpp
if (sensors.id >= ACCEL_COUNT_MAX) { PX4_ERR("Number of simulated accelerometer %d out of range. Max: %d", sensors.id, ACCEL_COUNT_MAX); return; if (sensors.id >= MAG_COUNT_MAX) { PX4_ERR("Number of simulated magnetometer %d out of range. Max: %d", sensors.id, MAG_COUNT_MAX); return;
Note
Not sure why sensors.id is used as the max field length.
Solution
Added sensor_msg.id to acc, gyro and mag to avoid "Number of simulated…… xxx out of range" error from PX4's SimulatorMavlink class.