Fixed Wing HITL with Gazebo

I have a Fixed Wing model built in Gazebo to use with HITL in a Pixhawk 5x. If I select the HILStar (Xplane) while the Pixhawk has the original firmware PX4 Pro Stable Release v1.12.3 it works well, the motors move in the simulation. If I make a new firmware using
make px4_fmu-v5x_default
and I uploaded through QGC the motors don’t respond, even when I select the same HILStar.

Something I noticed is that when using the custom firmware sometimes I cannot see the topic /gazebo/command/motor_speed
in gazebo and I just see
/gazebo/command/.

Something else is that this folder:
PX4-Autopilot/build/px4_sitl_default/build_gazebo
does not exist in this folder:
PX4-Autopilot/build/px4_fmu-v5x_default
I wonder if I missing something when I make px4_fmu-v5x_default

Also before starting the HITL simulation I tried the following:
~/PX4-Autopilot$ DONT_RUN=1 make px4_fmu-v5x_default gazebo
but I get this error:

ninja: error: unknown target 'gazebo', did you mean 'geo'?
make: *** [Makefile:230: px4_fmu-v5x_default] Error 1

Since my model needs two independent ailerons, basically I could just modify the HILStar mixer or add a new airframe, but this needs a new firmware to be uploaded which is giving the problem.

I would greatly appreciate some suggestion or some workaround.

1 Like

Hi, did you enable HITL as discussed in Hardware in the Loop Simulation \(HITL\) | PX4 User Guide ?

Note, make px4_fmu-v5x_default should be all you need to do for building (or just take the default). Indeed even the enabling HITL probably shouldn’t be needed if you select the HIL target

Hi @hamishwillee, thanks for your reply.

Yes, I can go back and forward uploading to the Pixhawk the Stable_Release_v1.12.3 and px4_fmu-v5x_default.px4 and HITL only works with the Stable_Release.

Actually, to narrow it down further, the same situation happens with the default airframes. For example if I select standard_vtol_hitl gazebo model with the HIL Standard VTOL QuadPlane it works well with Stable Release but not when upload a new firmware to the Pixhawk.

It seems like when the new firmware is generated, something related with Gazebo is missing.

There shouldn’t be anything related to gazebo in the firmware “specifically” as I understand it.

@dagar Can you advise on this HITL query?