Note: Before starting this tutorial please compile the cyphy_CF,cyphy_height_estimator,cyphy_kbd,cyphy_mk_ui,cyphy_pole_detect and cyphy_serial_driver packages..
(!) Please ask about problems and questions regarding this tutorial on Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Shared Control for a Quadrotor Platform

Description: This tutorial guides a shared autonomy control scheme for a quadcopter that is suited for inspection of vertical infrastructure. An unskilled operator is assisted by onboard sensing and partial autonomy to safely fly the robot in close proximity to the structure. The operator uses their domain knowledge and problem solving skills to guide the robot in difficult to reach locations to inspect and assess the condition of the infrastructure. The operator commands the robot in a local task coordinate frame with limited degrees of freedom (DOF). For instance: up/down, left/right, toward/away with respect to the infrastructure. We therefore avoid problems of global mapping and navigation while providing an intuitive interface to the operator.

Keywords: cyphy_pkg, MikroKopter, quadrotor

Tutorial Level: BEGINNER

What does this tutorial page aim for?

This page presents ROS MikroKopter tutorial, technical documentation, and source code. The tutorial section provides detailed step-by-step explanations allowing other researchers to setup the same research quadrotor platform. The technical documentation aims to fulfill the demands of robotics and avionics researchers by providing scientific information. Lastly, we provide full source code packages, the Gumstixs ROS Hokuyo driver package, the core velocity estimator and control ROS packages, and the MikroKopter flight control patch.

Setup systems

This section is consisted of 3 subsections: The Gumstixs ROS Hokuro driver package, the velocity estimator and control ROS packages, and the MikroKopter flight control patch. This system is consisted of: Overo Fire COM MikroKopter L4-ME Hokuyo URG-04LX

The software versions are:

ROS cturtle(1.2.4) for the Gumstixs Ubuntu 10.04(Lucid), Kernel version 2.6.34

Versions of the ground station:

Ubuntu 10.10(Marverick), Kernel version 2.6.35-28 for the ground station.
ROS diamondback 1.4.6, GCC 4.4


The Gumstixs ROS Hokuyo driver package


For running the Gumstixs ROS Hokuyo driver package, there are requirements of:

1. Ubuntu Lucid version running on the Gumstix

2. Gumros/ubuntu*

3. Dependences for Hokuyo driver package*

  • As presented in ROS Hokuyo tutorial page, there are 6 dependences of the Hokuyo driver package. However, there are more dependences since each dependency also requires its dependences. When you install Gumros/ubuntu on the Gumsixs, it only installs ROS core packages (roscore, rostools, etc) without useful stacks due to the lack of the Gumstix memory resources. Therefore, you need to check out and compile from the lowest level of a package to the higher, for example, (roscpp,rospy and rosservice -> dynamic_reconfigure -> driver_base -> hokuyo_node)

Compilation ROS packages

Gumstix ROS pkg

Compiling ROS Hokuyo pkg by typing

rosmake hokuyo_node

Three binaries will be generated, getFirmwareVersion, getID, and hokuyo_node under the "bin" folder. Note that there is an alignment issue with cross compilation on ARM. If you face this error message

Alignment trap: not handling instruction ed868b00 at [<0002f6be>]
Unhandled fault: alignment exception (0x801) at 0x000875bb
/opt/ros/cturtle/ros/bin/rosrun: line 35:   729 Illegal instruction
$exepath "$@

then the patch code for the ROS serialisation is required.

MikroKopter flight control(FC) patch

It is required to patch FC source code and compile then put the binary into the flight controller with the following page. FC_source_compile

You can download the official V0.82b FC code and apply this patch MK_FC0.82b_cyphy.patch. This patch is created against MK FCV0.82b official versionV0.82b Please have a look "License.txt" file for permissions and copyrights.

Groundstation ROS pkg

There are six ROS packages: cyphy_CF,cyphy_height_estimator,cyphy_kbd,cyphy_mk_ui,cyphy_pole_detect and cyphy_serial_driver to be compiled.

This diagram shows the connections between nodes through topics. The blue boxes are nodes and solid and dash lines are topics. We use user-defined topics and pre-defined topic. More details can be found on the MK_Doc.pdf MikroKopter technical documentation.


One can check out from QUT cyphy launch pad repository by

bzr co lp:cyphy

Putting them all together and running

Running the ROS core on the ground station

Open a new console and type


Please make sure a connection between the Gumstixs and the ground station by setting the proper ROS_MASTER_URI and the host file. More details is available ROS & iRobot Create Setup

Running the Hokuyo ROS driver node on the Gumstix

The function of this node is acquisition of laser range finder data and transmitting over Wifi to the ground station. This node runs on the Gumstixs, not the ground station.

roslaunch hokuyo_node hokuyo_cyphy.launch

The only difference between our Hokuyo node and ROS Hokuyo node is parameters in the hokuyo_cyphy.launch file. We changed the maximum and minimun angles due to a laser hat. Note that please make sure the time interval between the Gumstixs and the ground station as possible as close. We exploited PTP protocol to syncronise systems.

It is nice to verify the connection using rostools or rviz.

rostopic list -v
rostopic echo /scan


rosrun rviz rviz

Running the cyphy_pole_detect and cyphy_height_estimator

Open a new terminal and run the cyphy_pole_detect package by

rosrun cyphy_pole_detect cyphy_pole_detect

Open a new terminal and run the laser height estimator.

rosrun cyphy_height_estimator cyphy_height_estimator

Make sure /pole_pose2D and /height topic are subscribed.

Running the cyphy_serial_driver package

This node receives attitudes and status of the MikroKopter at 20Hz.

Run the executable file under the bin folder.

Open a new terminal and run the MikroKopter serial node.

rosrun cyphy_serial_driver cyphy_serial_driver

Make sure a ZIGBEE module is connected to ttyUSB0.

Running the cyphy complimentary filter node

This node involves the velocity estimator and controllers.

Open a new terminal and run the MikroKopter serial node.

rosrun cyphy_CF CompFilter

Note: GCC 4.4.6 is used to compile cyphy_serial_driver and cyphy_CF packages. There is a namespace issue on 4.5 or higher version.

Running the cyphy_kbd node

Open a new terminal and run the cyphy_kbd node.

rosrun cyphy_kbd cyphy_kbd 

Running the joy

In order to send supervisory command, joystick_drivers stack is required. joystick_drivers. Then run joy_node by

rosrun joy joy_node

Running the dynamic reconfigure node

This node allows a operator to change all gains of velocity controller, position controllers. Open a new terminal and type

rosrun dynamic_reconfigure reconfigure_gui

Select /CompFilter pkg from a drop down menu.

(Optional) Running the rxplot to plot data

It is possible to plot any data with rxplot. For example, the following command plots x,y and z. Open a new terminal and type the following command.

rxplot /pole_pose/x /pole_pose/y /height/data

The default update rate of the rxplot is 500ms. You can change the update rate by changing ros\tools\rxtools\src\rxtools\, line 172

   1 self.redraw_timer.Start(100)


Turn motors on and activate the external control from the transmitter. Details of set-up the transmitter and MikroKopter tool can be found. MikroKopter Tools

Activate all packages in terminals. Select the cypky_kbd terminal to landing.

The available commands are

Press space = Taking off
Press ESC   = Landing
Press 'f'   = Increase height 0.2m
Press 'v'   = Decrease height 0.2m

Wiki: MikroKopter/Tutorials/shared_control (last edited 2012-01-18 09:32:17 by Inkyu Sa)