Skip to content

New Robot: Launch experiment

Xu Liu edited this page Apr 5, 2022 · 8 revisions

Gain tuning

Make sure your attitude controller and position controller gains are both well tuned.

Attitude controller gains should be tuned first, by flying manually and change the gains (MC_xxx) in Qgroundcontrol software if you are using Pixhawk flight controller.

Position controller gains can be tuned by modifying the ~/catkin_ws/src/kr_autonomous_flight/autonomy_real/real_experiment_launch/config/so3_control_gains.yaml file. The explanation of the parameters in the controller gains YAML file are explained in this page.

Propeller coefficient

You will need to specify the propeller coefficient so that the controller can know how to convert thrust to RPM, refer to this page for details.

Launch the experiment:

ssh into your robot's onboard computer, start a ROS master there.

On the robot side, execute the following command:

roslaunch real_experiment_launch full_autonomy.launch

On the ground station side, execute the following command:

roslaunch client_launch client.launch

Then, click the commands and send waypoints using the client rqt GUI, similar to the example shown in Gazebo instructions.

Then, click motors on after the robot gets commands (keep your eye on the commands in rqt GUI window, in the beginning, they are all 0, but when the robot gets commands, they will have decimal places, e.g., 0.0). Wait for several seconds, click take off in rqt GUI, and you should see the UAV take off.

(Troubleshooting)If the robot does not behave as expected (take off, go to waypoints, etc.), it might be because of the packet loss in communication, and you should try clicking again on the rqt GUI.

(Troubleshooting) If the robot does not take off. You don't have to relaunch. Instead, you can try clicking the rqt GUI again in the following order: motors off -> motors on -> take off If the robot still does not take off, kill the ROS master and relaunch.