HIL Output from ArduPlane 2.66?

I've been working on configuring the ArduPlane firmware to handle joystick-only control a little better. So far all has been going well but now I've run into a bit of a roadblock with HIL simulation (using X-Plane).

Looking through the code it looks like MAVLINK_MSG_ID_HIL_CONTROLS is used to send the positions back to MissionPlanner, which then passes it along to Xplane inputs. My problem is that so far I haven't been able to find where the messages are sent out from ArduPilot. I found all the definitions in libraries/mavlink_msg_hil_controls.h but I can't find anywhere where it's actually being used.

Where in the ArduPilot code are HIL packets being sent from?UPDATE: I just noticed that although using MAVlink 1.0 the MAVLINK_MSG_ID_RC_CHANNELS_SCALED is used to set hilch values, not MAVLINK_MSG_ID_HIL_CONTROLS. Tracing things back a bit it looks like the values for this message come from pwm_out value. When not in HIL mode all the output values are correct so what is different about HIL that causes joystick positions to be ignored? Any help is greatly appreciated.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • There's an issue for this here: https://code.google.com/p/ardupilot-mega/issues/detail?id=633

    The APM does seem to initialize after performing some action (eg. mode change) but I still can't get any RC input/output values using joystick in HIL. I'll try again sometime tomorrow to see if I can figure it out (very frustrating!)
  • 3692545565?profile=original

    Notice all of the chxin, chxout, hilchx values are null; setting a breakpoint in MissionPlanner for the incoming MAVLINK_MSG_ID_RC_CHANNELS_SCALED shows it never arrives. I still haven't been able to locate where in the firmware this is being skipped. The simulation tab shows my location and other values when connected to X-Plane so I believe the only issue is something ignoring the rcoverride values using joystick-only control. I could really use some help on this!

    NOTE: I have confirmed that the MissionPlanner is still sending rcoverride values when in sim. mode, so it must be the firmware

    Also it seems the APM never gets past initialization (as shown in the HUD and CLI) using HIL mode firmware. Is this correct or should I see the HUD and GPS display come alive?

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…