RflyExpCode
RflyExpCode copied to clipboard
Gazebo simulator compatibility
Hello, i was wondering if there is a certain modification that is required to use the generated firmware with gazebo in hitl mode since it behaves differently from coptersim and jmavsim.
The 20s in Simulink means the time period after the Pixhawk reboot. In fact, 20 seconds is too short for the initialization steps of Pixhawk EKF module. Maybe you can try to start your trajectory from 60s. Maybe this is the problem that Gazebo flips because Gazebo will output pwms without EKF data check.
You can subscribe the uORB messages (such as: home_position) to set the start time (start your trajectory controller) when the flag “valid_hpos” turns to true.
You can reinstall the latest software package in our website, which will output pwms without arming the Pixhawk. So you can use CH5 or CH6 as the switch to enable motor outputs at any moment.