-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
v1.10.0-rc quadcopter doesn't take off in HITL/jMAVsim #13471
Comments
That's not good but thanks for the detailed report! |
Originally I stated : "MAVLink inspector in QGC shows no HIL_ACTUATOR_CONTROLS, and SERVO_OUTPUT_RAW values are all 0". But this is misleading. The MAVLink Inspector in QGC can only show the messages forwarded by jMAVSim. What's more interesting is:
This shows:
It seems to me that the publication of uOrbs actuator_outputs instance 0 and instance 1 is confusing the mavlink module's generation of HIL_ACTUATOR_CONTROLS and SERVO_OUTPUT_RAW.
If only instance 0 was published, and it had the correct values, I bet it would work. Also, I tested a Pixhawk 2.1 (Cube) running px4_fmu-v3_default, and the behavior was 100% identical. |
This change causes the HIL_ACTUATOR_CONTROLS mavlink message to have non-zero values, and now the drone takes off in jMAVSim and I can fly around Zurich crashing into virtual trees:
I wonder if this is the correct fix? |
…3471. When running in HITL mode, pwm_out_sim publishes actuator_outputs. px4io unconditionally publishes the uOrb actuator_outputs. When HITL is configured, the px4io copy of the uOrb has all zeros. The result is that there are two publications, one valid, and one all-zeros. This causes the HIL_ACTUATOR_CONTROLS mavlink message to be incorrect (all-zeros) and the SERVO_OUTPUTS_RAW mavlink message to be inconsistent, as it takes the data from one or the other uOrb randomly each cycle. The fix is to let px4io know that HITL is in effect when it is started, and modify px4io to suppress publication in this case. This is a bigger more complicated fix than I would like, but I think it is conceptually correct.
…3471. When running in HITL mode, pwm_out_sim publishes actuator_outputs. px4io unconditionally publishes the uOrb actuator_outputs. When HITL is configured, the px4io copy of the uOrb has all zeros. The result is that there are two publications, one valid, and one all-zeros. This causes the HIL_ACTUATOR_CONTROLS mavlink message to be incorrect (all-zeros) and the SERVO_OUTPUTS_RAW mavlink message to be inconsistent, as it takes the data from one or the other uOrb randomly each cycle. The fix is to let px4io know that HITL is in effect when it is started, and modify px4io to suppress publication in this case. This is a bigger more complicated fix than I would like, but I think it is conceptually correct. Signed-off-by: Nik Langrind <[email protected]>
#13488 is my proposed fix |
…3471. When running in HITL mode, pwm_out_sim publishes actuator_outputs. px4io unconditionally publishes the uOrb actuator_outputs. When HITL is configured, the px4io copy of the uOrb has all zeros. The result is that there are two publications, one valid, and one all-zeros. This causes the HIL_ACTUATOR_CONTROLS mavlink message to be incorrect (all-zeros) and the SERVO_OUTPUTS_RAW mavlink message to be inconsistent, as it takes the data from one or the other uOrb randomly each cycle. The fix is to let px4io know that HITL is in effect when it is started, and modify px4io to suppress publication in this case. This is a bigger more complicated fix than I would like, but I think it is conceptually correct. Signed-off-by: Nik Langrind <[email protected]>
When running in HITL mode, pwm_out_sim publishes actuator_outputs. px4io unconditionally publishes the uOrb actuator_outputs. When HITL is configured, the px4io copy of the uOrb has all zeros. The result is that there are two publications, one valid, and one all-zeros. This causes the HIL_ACTUATOR_CONTROLS mavlink message to be incorrect (all-zeros) and the SERVO_OUTPUTS_RAW mavlink message to be inconsistent, as it takes the data from one or the other uOrb randomly each cycle. The fix is to let px4io know that HITL is in effect when it is started, and modify px4io to suppress publication in this case. This is a bigger more complicated fix than I would like, but I think it is conceptually correct. Signed-off-by: Nik Langrind <[email protected]>
Describe the bug
Set up HITL simulation with jMAVsim on Ubuntu 18.04, Pixhawk 4 with v1.10.0-rc, locally built px4_fmu-v5-multicopter.
To Reproduce
Steps to reproduce the behavior:
listener
command) shows actuator_outputs_1 with valid values and actuator_outputs_0 with 0 valuesExpected behavior
SERVO_OUTPUT_RAW or HIL_ACTUATOR_CONTROLS should follow actuator_outputs_1 and the vehicle should take off in simulation
Log Files and Screenshots
Flight Review Link
Add screenshots to help explain your problem.
Drone:
The text was updated successfully, but these errors were encountered: