PX4 v1.14/ v1.13 HITL Actual Motors Spinning

Hi all,

I’m an undergrad trying to do HITL with actual ESCs and motors. I’ve been trying to implement HITL with the actual actuators moving with PWM Main but have not gotten it to work so far.

I’m using Ubuntu 20.04, Px 6x, and QGC 3.5.6.

Things I’ve tried:
In v1.13 Px4 Repo

I followed the last step https://discuss.px4.io/t/fixed-wing-hitl-with-gazebo/27206/7:
After I’ve added set OUTPUT_MODE pwm_out in *ROMFS/px4fmu_common/init.d/rc.interface, the motors would spin with the HITL Airframe and the HITL disabled but the drone simulation won’t spin.

I managed to get the drone simulation to spin in the simulation and in real life separately, but never together. Has anyone managed to achieve this with v1.13 or v1.14?

I found HITL/HIL: disable lockdown not working · Issue #14069 · PX4/PX4-Autopilot · GitHub and it seems like someone managed to get it to work in v1.11 but the firmware doesn’t build for me.

Other relevant posts I found:

If anyone has any idea on how to fix this, I would appreciate it a ton. Thank you!

1 Like

Update:

Under pxfmu_common>init.d>rc.interface

If I make the following amendments, I can change which PWM the joystick or RC control will affect based on whether HITL is enabled or disabled under Safety. Is anyone here familiar with this know if there’s a way to get the PWM to output to both simultaneously?

Hi, we managed to output to both real motors via PWM main and the jMavsim simulation by adding

_actuators_0_pub.publish(ORB_ID)actuator_outputs));

into src>modules>simulator>simulator_mav_link.cpp

Then, we launched jmavsim and then QGC (connected by UDP) and disabled HITL to get the real motors and the drone in the simulation to run simultaneously.

All the best to anyone trying to do this as well!