This code provides a ROS node to control the iRobot create 2 platform in the form of a C++ object ADT_iRobot_ros. ADT_iRobot_ros is a derived class of ADT_iRobot which contains all the actual functionality to control the iRobot create 2. The derived class only contains the ROS related functionality, messages, topics and services. This result in a compact and easy to read code.
The values of the iRobot sensors are published through the topic adt_iRobot_status.
To control the iRobot movements the service adt_iRobot_move_service enable to request a change in velocity and turn radius.
Becuase the events on the parent class ADT_iRobot are managed by glib main loop the code uses ros::spinOnce() instead of ros::spin().
To compile the code you will need glib develpment package libglib2.0-dev .
$ sudo apt-get install libglib2.0-dev
This code is a catkin package developed under ROS indigo and Ubuntu 14.04.4 LTS.
$ cd your_catkin_workspace
$ cd src
$ git clone https://github.com/aurea-dt/adt_irobot_ros.git
$ cd ..
$ catkin_make_isolated --install --source src/adt_irobot_ros/