Fixedwing keeps spinning in the simulation

Hi there!

I was following the ROSPlane guide in the link below just to test that everything is configured and installed correctly: https://docs.rosflight.org/git-main/user-guide/rosplane-setup/

I first launched the Gazebo simulation with:

ros2 launch rosflight_sim fixedwing_sim_io_joy.launch.py aircraft:=anaconda
ros2 launch rosplane_sim sim.launch.py aircraft:=anaconda

Then I used the service call to arm the plane and override the RC with:

ros2 service call /toggle_arm std_srvs/srv/Trigger
ros2 service call /toggle_override std_srvs/srv/Trigger

With that, the plane starts to take off and I see several messages like:

[rosplane_controller-1] [INFO] [1745525024.459377047] [autopilot]: takeoff
[rosplane_controller-1] [INFO] [1745525026.039384466] [autopilot]: climb
[rosplane_controller-1] [INFO] [1745525027.139306131] [autopilot]: takeoff
[rosplane_controller-1] [INFO] [1745525028.519336315] [autopilot]: climb
[rosplane_path_manager-3] [WARN] [1745525028.537938300] [path_manager]: No waypoints received, orbiting origin at 50 meters.
[rosplane_controller-1] [INFO] [1745525029.509263556] [autopilot]: takeoff
[rosplane_controller-1] [INFO] [1745525031.229256937] [autopilot]: climb
[rosplane_controller-1] [INFO] [1745525031.549212840] [autopilot]: takeoff
[rosplane_controller-1] [INFO] [1745525033.099189781] [autopilot]: climb
[rosplane_path_manager-3] [WARN] [1745525033.547887456] [path_manager]: No waypoints received, orbiting origin at 50 meters.
[rosplane_estimator_node-5] [WARN] [1745525037.130907087] [estimator]: min roll angle
[rosplane_estimator_node-5] [WARN] [1745525037.140905152] [estimator]: min roll angle
[rosplane_estimator_node-5] [WARN] [1745525037.150907865] [estimator]: min roll angle
[rosplane_estimator_node-5] [WARN] [1745525037.160900810] [estimator]: min roll angle
[rosplane_estimator_node-5] [WARN] [1745525037.170958478] [estimator]: min roll angle
[rosplane_estimator_node-5] [WARN] [1745525037.180900258] [estimator]: min roll angle

At the same time, the plane starts spinning around with no direction until the state changes to HOLD, and then it stays upside down flying really close to the ground without following any waypoint that I provided with the CLI:

ros2 service call /load_mission_from_file rosflight_msgs/srv/ParamFile "{filename: <FILENAME>}"

I am using the provided fixedwing_mission.yaml file.

I also tried to upload the waypoints before arming and override RC, but the results are the same.

Am I doing something wrong? I have all the parameters configured as the “fixedwing_firmware.yaml” file is right now. See below a print from rviz of the plane trajectory.

Hi there! Thanks for using ROSplane!

It could be a number of things. First to check would be the IMU calibration—if the IMU is not calibrated then the plane will spin out of control similar to what you are describing. Calibrate using the
ros2 service call /calibrate_imu std_msgs/msg/Trigger
service call when disarmed.

I would also just verify that the PRIMARY_MIXER parameter is set to 10. Verify this with
ros2 service call /param_get rosflight_msgs/msg/ParamGet “{name: PRIMARY_MIXER}”

Let me know if those fixes don’t work.
Thanks,
Jacob

Hi Jacob!

Yep, I calibrated the IMU before arming the plane with

ros2 service call /calibrate_imu std_srvs/srv/Trigger

and checked that the parameter PRIMARY_MIXER is set to 10.0 by running

ros2 service call /param_get rosflight_msgs/srv/ParamGet "{name: PRIMARY_MIXER}"

However, the behavior is still the same (spinning around and then crashing into the ground).

I loaded the following params to the plane before arming it

- {name: MOTOR_PWM_UPDATE, type: 6, value: 50} # Set pwm update rate for motor.
- {name: ARM_SPIN_MOTORS, type: 6, value: 0} # Do not set motors to spin when armed.
- {name: MOTOR_IDLE_THR, type: 9, value: .1} # Set motor to not idle at zero throttle.
- {name: ARM_CHANNEL, type: 6, value: 4} # Set to desired arm channel.
- {name: FIXED_WING, type: 6, value: 1} # Configure firmware for fixedwing.
- {name: PRIMARY_MIXER, type: 6, value: 10} # Set mixer to pass through, to directly pass ROSplane2 commands to acutators.
- {name: ELEVATOR_REV, type: 6, value: 0} # Option to reverse elevator.
- {name: AIL_REV, type: 6, value: 0} # Option to reverse Aileron.
- {name: RUDDER_REV, type: 6, value: 0} # Option to reverse rudder.
- {name: CAL_GYRO_ARM, type: 6, value: 0} # Option to calibrate gyro when arming (generally only for multi-rotors).
- {name: RC_THR_OVRD_CHN, type: 6, value: 5} # Set pilot override channel for throttle control.
- {name: RC_ATT_OVRD_CHN, type: 6, value: 5} # Set pilot override channel for attitude control.
- {name: RC_ATT_CTRL_CHN, type: 6, value: 8} # TODO this should not be 8.
- {name: MIN_THROTTLE, type: 6, value: 0} # Set to not take the minimum of the commanded throttles.
- {name: RC_OVRD_DEV, type: 9, value: 1.0} # Ignore any stick inputs when override is enabled.
- {name: RC_NUM_CHN, type: 6, value: 8} # Set the number of RC channels to max.

Thanks for helping me out with this!