DrTon / jMAVSim

Simple multirotor simulator with MAVLink protocol support
BSD 3-Clause "New" or "Revised" License
38 stars 257 forks source link

PX4 HIL mode #14

Closed festlv closed 9 years ago

festlv commented 9 years ago

Hi, I'm trying to get jMAVSim to work with PX4FMU, PX4 flight stack. I was able to get jMAVSim running and connected to PX4 via USB. I can also connect with qgroundcontrol to jMAVSim via UDP successfully.

The problem is, jMAVSim only receives mode changes, but nothing happens in simulator window (motors also don't spin).

Here is what's printed in console of jMAVSim:

$ java -Djava.library.path=./ -cp out/production/jmavsim.jar me.drton.jmavsim.Simulator Init MAVLink MSG: Switched to ON hil state MSG: detected RC signal first time MSG: ARMED by RC MSG: [cmd] arming state: ARMED MSG: [sdlog2] log dir: /fs/microsd/log/sess018 MSG: [sdlog2] starting: log001.px4log MSG: IN AIR MODE MSG: LANDED MODE MSG: [inav] GPS signal found MSG: [inav] init ref: 55.7533950, 37.6254270, 0.0000 MSG: home: 55.7533950, 37.6254270, 0.00 MSG: IN AIR MODE MSG: LANDED MODE MSG: IN AIR MODE MSG: LANDED MODE MSG: IN AIR MODE MSG: LANDED MODE MSG: IN AIR MODE MSG: LANDED MODE MSG: DISARMED by RC MSG: [cmd] arming state: STANDBY MSG: [sdlog2] logging stopped

Maybe I am missing some obvious configuration steps and this is not a bug, but an error on my side? I would also welcome any tips on how to debug this issue.

DrTon commented 9 years ago

Sorry for the long reply. Don't forget to press safety switch. System will allow to arm in HIL without safety switch pressed but actuator will send zero outputs and copter in simulator will not fly. It's a bug in PX4, fix it if you want, or just use safety switch :)