Tutorial?
The aim of this tutorial is to explain how to integrate SIGVerse with ROS operating system.
First, we will show how to install ROS on your operating system, then we will explain step by step how to run SIGVerse controller in ROS node and how to communicate with another node.
The ROS part tutorial is based on the official ROS wiki, you can check it for more details.
In order to integrate SIGVerse and ROS, we first need to create ROS package containing two nodes, SIGVerse controller node and ROS command node. The first node, SIGVerse controller node, will receive data from the SIGViewer as messages, then publish them on the message topic, in the other part, ROS command node reads these data and subscribe the corresponding velocity on the velocity topic, the velocity command will be retrieved by the SIGVerse controller node to be used for controlling the robot.
To install ROS on your server please refer to the official web site.
In our project we are using catkin, here are the steps to follow to create a ROS workspace:
Run the following command:
$ source /opt/ros/groovy/setup.sh
To create a catkin workspace:
$ mkdir -p ~/catkin_ws/src $ cd ~/catkin_ws/src $ catkin_init_workspace
You can build even though no project is created yet, you just need MakeLists.txt:
$ cd ~/catkin_ws/ $ catkin_make
Run the setup.bash
$ source devel/setup.bash
We need to create a new package in the catkin_ws directory.
$ cd ~/catkin_ws/src $ catkin_create_pkg sig_ros
Please download the project file from here. &ref(): File not found: "ROS_integration.tgz" at page "ROS integration";
You need to have Cmake installed on your server.
Let's edit the CMakeLists.txt file to compile the project:
Cmake parameters:
add_executable(ros_controller src/ros_controller.cpp) target_link_libraries(ros_controller ${catkin_LIBRARIES}) add_dependencies(ros_controller sig_ros_gencpp)
ADD_LIBRARY(sig_ros/sig_controller src/sig_controller.cpp) target_link_libraries(sig_ros/sig_controller ${catkin_LIBRARIES}) add_dependencies(sig_ros/sig_controller sig_ros_gencpp)
$ cd ~/catkin_ws $ catkin_make
A new library will be generated in ~/catkin_ws/devel/lib/libsig_ros.
Run the following command to add this package to ROS packages:
$source ~/catkin_ws/devel/setup.sh
& Roscd sig_ros
We must have the following output:
$ CMakeLists.txt include msg package.xml src
This shows that the sig_ros package exists.
To run the server please follow the these steps:
Go to catkin_ws and and follow these steps :
$ roscore
$ cd ~/catkin_ws/devel/lib/libsig_ros $ sigserver.sh -w ./RobotInMove.xml
sig_controller.cpp
The following is the callback function which preforms the command on the velocity of the robot’s wheels:
This function allows to control the robot using the appropriate velocity.
This is the node that controls the robot’s velocity:
ros_controller.cpp:
RobotInMove.xml:
Tutorial?