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.

Views: 357

Reply to This

Replies to This Discussion

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?

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!)

Any word on a fix for this Robert??

I haven't had a chance to look into this for a while. Things have been busy at work.

Hopefully this weekend I'll be able to take another poke at it.

Reply to Discussion


© 2018   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service