Getting Started¶
Reading through the pages in this user guide in order should provide you with the information you need to get a vehicle flying with ROSflight. The following is a summary of the steps you'll need to follow to get your vehicle set up, with links to the corresponding documentation pages:
- Hardware setup: Set up your hardware (fixed-wing or multirotor platform, flight controller, and companion computer)
- Flight controller setup: Flash your flight controller with the latest ROSflight firmware.
- RC Configuration: Set up your RC transmitter.
- ROS2 setup: Set up ROS2 on your companion computer.
- Parameter configuration: Configure the flight controller for your setup. The configuration checklists below should help guide you through this process.
- Preflight checks: Run through your preflight checks
- Improving firmware performance (multirotors only): Tune the firmware attitude controller gains
- Autonomous flight (optional): Set up autonomous flight via offboard control
Configuration Checklist¶
The following checklists should help you get a new vehicle set up for the first time. This checklist assumes that your hardware is already set up correctly.
General Setup¶
- Set the
FIXED_WING
parameter (1
if a fixed-wing,0
if a multirotor) - Set the
RC_TYPE
parameter (0
if PPM,1
if SBUS) - Set the
PRIMARY_MIXER
parameter to the appropriate value described in the Hardware Setup page - Set the
MOTOR_PWM_UPDATE
parameter (typically490
for SimonK ESCs,50
for standard servos) - Make sure your RC transmitter is set up correctly
- Set up your RC switches
- If you want to arm/disarm using a switch, set the
ARM_CHANNEL
parameter to the appropriate channel (0-indexed) - If you want to use a switch to enable RC override, set the
RC_ATT_OVRD_CHN
andRC_THR_OVRD_CHN
parameters to the appropriate channel(s) (0-indexed). If you want complete control (attitude and throttle) when you flip the switch, set both these parameters to the same channel.
- If you want to arm/disarm using a switch, set the
- Calibrate your IMU: start
rosflight_io
, then runros2 service call /calibrate_imu std_srvs/srv/Trigger
- Complete the multirotor-specific or fixed-wing-specific checklist below
- Save the parameters (
ros2 service call /param_write std_srvs/srv/Trigger
) - You'll probably want to save a backup of your parameters (call
ros2 service call /param_save_to_file rosflight_msgs/srv/ParamFile "{filename: "params.yml"}"
) - Make sure you run through the Preflight Checklist before flying
Multirotor-specific Setup¶
Danger
IMPORTANT: Remove all props from the vehicle when calibrating ESCs!!!
-
Calibrate ESCs
- Make sure
MOTOR_MIN_PWM
andMOTOR_MAX_PWM
are correct (usually1000
and2000
) - Set
PRIMARY_MIXER
param to0
(ESC calibration mixer) - Set
ARM_SPIN_MOTORS
to0
-
Perform ESC calibration. For standard ESCs:
- With power disconnected from the motors, arm the flight controller
- Set throttle to maximum
- Connect power to the motors
- Drop the throttle to minimum
-
Set the
PRIMARY_MIXER
parameter back to the appropriate value for your vehicle (see the Hardware Setup page) - Set
ARM_SPIN_MOTORS
back to1
- Make sure
-
The
ARM_SPIN_MOTORS
parameter should be set to1
so the motors spin slowly when armed. The idle throttle setting can be adjusted with theMOTOR_IDLE_THR
parameter. - You'll most likely want to set the
CAL_GYRO_ARM
param to1
to enable calibrating gyros before arming - Set the
RC_ATT_MODE
parameter to set RC control mode (0
for rate mode,1
for angle mode [default]) - Set torque offsets as described in the RC trim calculation section of the Improving Firmware Performance page
- Set the
FAILSAFE_THR
parameter to specify the throttle level the MAV will hold if the transmitter disconnects. Set the parameter to0
if you just want the MAV to drop, otherwise determine the amount of throttle required to hover the MAV and set the parameter comfortably below that. DO NOT set it above, as this will result in a runaway MAV. We recommended that you test the throttle level in an enclosed space by powering off the transmitter while hovering, if you set this parameter above 0. - Tune the controller gains as described in the Multirotor gain tuning section of the Improving Firmware Performance page
Fixed-Wing-Specific Setup¶
- Reverse servo directions if necessary using the
AIL_REV
,ELEVATOR_REV
, andRUDDER_REV
parameters (1
to reverse,0
to keep current direction) - You'll most likely want to set the
ARM_SPIN_MOTORS
parameter to0
so that the prop doesn't spin at a minimum throttle setting when you arm, especially if you'll be doing hand launching