Skip to content

Basic Usage

Philipp Foehn edited this page May 14, 2018 · 1 revision

Since this package works in conjunction with rpg_quadrotor_control, it is fairly simple to use.

Usage with the included launch files

To launch our control framework with the MPC, you simply need to append the parameter use_mpc:=true to any launch command, for example:

roslaunch rpg_rotors_interface quadrotor_empty_world.launch use_mpc:=true

Testing and launching our control framework is described in further detail in our Wiki and specifically in the section Test the Framework.

Usage with your own launch filess

If you use your own launch configurations, you might adapt the launch file (for example the simulation launch file) at the point where our Autopilot is called:

<node pkg="autopilot" type="autopilot" name="autopilot" output="screen">
  <rosparam file="$(find state_predictor)/parameters/hummingbird.yaml" />
  <rosparam file="$(find rpg_rotors_interface)/parameters/position_controller.yaml" />
  <rosparam file="$(find rpg_rotors_interface)/parameters/autopilot.yaml" />

  <param name="position_controller/use_rate_mode" value="True" />

  <param name="velocity_estimate_in_world_frame" value="false" />
  <param name="state_estimate_timeout" value="0.1" />
  <param name="control_command_delay" value="0.05" />

  <remap from="autopilot/state_estimate" to="ground_truth/odometry" />
</node>

and replace it with the MPC instance of the Autopilot:

<node pkg="rpg_mpc" type="autopilot_mpc_instance" name="autopilot" output="screen">
  <rosparam file="$(find state_predictor)/parameters/hummingbird.yaml" />
  <rosparam file="$(find rpg_mpc)/parameters/default.yaml" />
  <rosparam file="$(find rpg_rotors_interface)/parameters/autopilot.yaml" />

  <param name="velocity_estimate_in_world_frame" value="false" />
  <param name="state_estimate_timeout" value="0.1" />
  <param name="control_command_delay" value="0.05" />

  <remap from="autopilot/state_estimate" to="ground_truth/odometry" />
</node>