Hi, I have been trying to set up a hardware in the loop (HIL) simulation for multi-copters using jMavsim. Here is a summary of my problem:
-
Simulated vehicle starts climbing immediately after arming
-
0 throttle (stick at the bottom) correspond to 1000 PWM for each motor, but vehicle is still climbing
-
Pixhawk connected to Ubuntu terminal via a usb cable, only things attached to pixhawk are safety swtich, buzzer and RC receiver, I use a RC transmitter to give manual control input
-
When switch to mission mode, console rejects commad “MSG: Rejecting mode switch cmd”
-
Same error message when switching to Altitude Control, Hold, Return to Land, Follow
-
I use this command to start the simulation (not sure if baud rate matters, I have tried 57600, 115200 with same results)
java -Djava.ext.dirs= -cp lib/*:out/production/jmavsim.jar me.drton.jmavsim.Simulator -serial /dev/ttyACM0 57600 -qgc
So far I can get the visualization to work on Ubuntu 14.04 LTS, establish a serial connection to a pixhawk loaded with the latest PX4 flight stack from qgroundcontrol, and establish a UDP connection to the qgroundcontrol. But the problem I have now is that as soon as I arm the autopilot, the vehicle sitting in jMavsim will start climbing, and this behavior is also reflected by the altitude reading in qgroundcontrol. As I increase throttle the vehicle will climb even faster, but when I move the throttle to minimum the vehicle won’t come back down, it only start falling when I disarm the autopilot.
Another issue I have is I can’t set the vehicle to mission mode. I can create missions in qgroundcontrol and sync them to the vehicle, but I get a “MSG: Rejecting mode switch cmd” in the jMAVsim console every time.
A screenshot of the jMAVsim window is attached.