SIGVerse ROS Integration
[
Front page
] [
New
|
List of pages
|
Search
|
Recent changes
|
Help
]
Start:
[[Tutorial]]
The aim of this tutorial is to explain how to integrate S...
Ros tutorial on SIGverse
-How to Use ROS with SIGverse
-User has to create A SIGverse node using the following c...
--In this tutorial two topics are used
--Message Topic to send messages from SIGverse Node to Co...
#contents
*Overview[#ed1b8322]
In order to integrate SIGVerse and ROS You need to build ...
-The first package will run with the SIGVerse Controller ...
-the second package will receive the messages and perform...
those two packages will contains nodes and will use two t...
-the first topic is used to send messages.
-the second topic is used to feedback the command velocity.
&ref(Simple_Ros.PNG,,80%);
*Installing ROS [#ed1b8326]
= Ubuntu install of ROS Groovy =
We are building Debian packages for several Ubuntu platfo...
If you need to install from source ('''not recommended'''...
=== Installation ===
First, make sure your Debian package index is up-to-date:
$ sudo apt-get update
There are many different libraries and tools in ROS. We ...
$ sudo apt-get install ros-groovy-desktop-full
$ sudo apt-get install ros-groovy-desktop
ROS-Base: (Bare Bones)
-ROS package, build, and communication libraries. No GUI ...
$ sudo apt-get install ros-groovy-ros-base
Individual Package:
- You can also install a specific ROS package (replace un...
$ sudo apt-get install ros-groovy-PACKAGE
$ sudo apt-get install ros-groovy-slam-gmapping
To find available packages, use:
$ apt-cache search ros-groovy
=== Initialize rosdep ===
Before you can use ROS, you will need to initialize `rosd...
$ sudo rosdep init
$ rosdep update
=== Getting rosinstall ===
[[rosinstall]] is a frequently used command-line tool in ...
- To install this tool on Ubuntu, run:
$ sudo apt-get install python-rosinstall
*Creating SIGVerse Package [#ed1b8323]
- You need to create a new Ros Package to perform the ROS...
- Let’s create a new directory named catkin_ws and let’s...
- Create a new folder named src.
- Now let’s initialize our workspace by using the followi...
**Catkin Workspace initialization [#ed1b8136]
$catkin_init_workspace in the ~/catkin_ws folder
- Now we have our workspace let’s create our SIGverse Pa...
-Firstable we need to make a new folder named SIGverse t...
$~/catkin_ws/src/Sigvers_Ros/src.
$ cd ~/catkin_ws/src
$ catkin_create_pkg Sigvers_Ros
-Now make Cmake file in order to create the wanted pack...
Catkin_make will generate a /devel folder which contains ...
Now let’s souce our package by using the following command:
$source ~/catkin_ws2/devel/setup.sh
-Now we can check our package by executing this command
--Roscd Sigvers_Ros so we get the following result:
CMakeLists.txt
include
msg
package.xml
src
This shows that the Sigvers_Ros packages exists
Cmake parameters:
For Sig.cpp:
cmake_minimum_required(VERSION 2.8.3)
project(Sigvers_Ros)
find_package(catkin REQUIRED COMPONENTS roscpp rospy st...
## Generate messages in the 'msg' folder
add_message_files(
FILES
Velocity.msg
)
## Generate added messages and services with any depend...
generate_messages(
DEPENDENCIES
std_msgs
)
ADD_LIBRARY(Sig_app src/Sig_app.cpp)
target_link_libraries(Sig_app ${catkin_LIBRARIES})
add_dependencies(Sig_app Sigvers_Ros_gencpp)
- We use the target_link_libraries which generates the .s...
include_directories(include ${catkin_INCLUDE_DIRS})
include_directories(/home/ericgt/sigverse-2.2.0/include...
- Here you include SiGverse .h files to compile our contr...
Catkin Command:
-- catkin_make
-we compile our code using Cmake parameters so we generat...
*Creating ROS Package [#ed1b8324]
*Source Code understanding [#ed1b8324]
-Let’s study this example step by step
Now let’s create the callback function which preforms the...
**Message Sender [#ed1b8136]
void SendController::poseCallback(const Sigvers_Ros::V...
{ Wheel_one = vel->linear;
Wheel_two = vel->angular;
printf("Velocity 1!!! %f\n", Wheel_one);
printf("Velocity 2!!! %f\n", Wheel_two);
}
- read from the Velocity Topic
- Printing the Velocity value applied on the robot
**Node Initialization [#ed1b8137]
void SendController::onInit(InitEvent &evt)
{ Wheel_one = 0.0;
Wheel_two = 0.0;
int argc =0;
char** argv = NULL;
my = this->getRobotObj(this->myname());
my->setWheel(10.0, 10.0);
ros::init(argc, argv, "Sigvers_controller_node");
ros::NodeHandle n;
velocity = 1;
chatter_pub = n.advertise<std_msgs::String>("CommandM...
pose_sub = n.subscribe<Sigvers_Ros::Velocity>("mycomm...
ros::Rate loop_rate(10);
}
**Robot Controller [#ed1b8138]
double SendController::onAction(ActionEvent &evt)
{
my->setWheelVelocity(Weel_one,Weel_two);
ros::spinOnce();
return 1.0;
}
- Now let’s create a Node to control the robot’s velocity:
**Command Node initialization ROS Side [#ed1b8139]
CommandSig::CommandSig():
linear_(0),
angular_(0),
l_scale_(2.0),
a_scale_(2.0)
{
nh_.param("scale_angular", a_scale_, a_scale_);
nh_.param("scale_linear", l_scale_, l_scale_);
vel_pub_ = nh_.advertise<Sigvers_Ros::Velocity>("myco...
mess_sub = nh_.subscribe("CommandMess",100,&Comman...
}
- Initialization of the command Node's Parameters
- The Node will send velocity information using mycommand...
- The Node will receive information using CommandMess Topic
- And finally let’s write the main function which launche...
**Main to execute the Node [#v1bef770]
int main(int argc, char** argv)
{
ros::init(argc, argv, "Sigvers_Command_node");
CommandSig Command_sig;
ros::Rate loop_rate(10);
ros::spin();
return(0);
}
- this command creates and does initialization on the Sig...
Node
**Message Sender [#ed1b8140]
-Now let’s create the callback function which receveces m...
** Robot Motion Command ROS Side [#ed1b8141]
void CommandSig::chatterCallback (const std_msgs::Stri...
{
Sigvers_Ros::Velocity vel;
if(strcmp("go",msg->data.c_str())==0)
{
vel.angular = 3.0;
vel.linear = 3.0;
vel_pub_.publish(vel);
}
else if(strcmp("back",msg->data.c_str())==0)
{
vel.angular = -3.0;
vel.linear = -3.0;
vel_pub_.publish(vel);
}
else if(strcmp("left" ,msg->data.c_str())==0)
{
vel.angular = 0.78;
vel.linear = -0.78;
vel_pub_.publish(vel);
sleep(1.8);
vel.angular = 0.0;
vel.linear = 0.0;
vel_pub_.publish(vel);
}
else if(strcmp("right" ,msg->data.c_str())==0)
{
vel.angular = -0.78;
vel.linear = 0.78;
vel_pub_.publish(vel);
sleep(1.8);
vel.angular = 0.0;
vel.linear = 0.0;
vel_pub_.publish(vel);
}
else if(strcmp("stop",msg->data.c_str())==0)
{
vel.angular = 0.0;
vel.linear = 0.0;
vel_pub_.publish(vel);
}
………
}
*Running the server [#ed1b8132]
To run the server you have to follow the following steps:
Go to catkin_ws and execute the follwing command :
-Run the ROS system:
$ roscore
run the ros ROS node :
$ rosrun key_sig sig_app
Go to ~/catkin_ws/devel/lib/libsig_app and run the sigver...
$ cd ~/catkin_ws/devel/lib/libsig_app
$ sigserver.sh -w ./move_robot.xml
End:
[[Tutorial]]
The aim of this tutorial is to explain how to integrate S...
Ros tutorial on SIGverse
-How to Use ROS with SIGverse
-User has to create A SIGverse node using the following c...
--In this tutorial two topics are used
--Message Topic to send messages from SIGverse Node to Co...
#contents
*Overview[#ed1b8322]
In order to integrate SIGVerse and ROS You need to build ...
-The first package will run with the SIGVerse Controller ...
-the second package will receive the messages and perform...
those two packages will contains nodes and will use two t...
-the first topic is used to send messages.
-the second topic is used to feedback the command velocity.
&ref(Simple_Ros.PNG,,80%);
*Installing ROS [#ed1b8326]
= Ubuntu install of ROS Groovy =
We are building Debian packages for several Ubuntu platfo...
If you need to install from source ('''not recommended'''...
=== Installation ===
First, make sure your Debian package index is up-to-date:
$ sudo apt-get update
There are many different libraries and tools in ROS. We ...
$ sudo apt-get install ros-groovy-desktop-full
$ sudo apt-get install ros-groovy-desktop
ROS-Base: (Bare Bones)
-ROS package, build, and communication libraries. No GUI ...
$ sudo apt-get install ros-groovy-ros-base
Individual Package:
- You can also install a specific ROS package (replace un...
$ sudo apt-get install ros-groovy-PACKAGE
$ sudo apt-get install ros-groovy-slam-gmapping
To find available packages, use:
$ apt-cache search ros-groovy
=== Initialize rosdep ===
Before you can use ROS, you will need to initialize `rosd...
$ sudo rosdep init
$ rosdep update
=== Getting rosinstall ===
[[rosinstall]] is a frequently used command-line tool in ...
- To install this tool on Ubuntu, run:
$ sudo apt-get install python-rosinstall
*Creating SIGVerse Package [#ed1b8323]
- You need to create a new Ros Package to perform the ROS...
- Let’s create a new directory named catkin_ws and let’s...
- Create a new folder named src.
- Now let’s initialize our workspace by using the followi...
**Catkin Workspace initialization [#ed1b8136]
$catkin_init_workspace in the ~/catkin_ws folder
- Now we have our workspace let’s create our SIGverse Pa...
-Firstable we need to make a new folder named SIGverse t...
$~/catkin_ws/src/Sigvers_Ros/src.
$ cd ~/catkin_ws/src
$ catkin_create_pkg Sigvers_Ros
-Now make Cmake file in order to create the wanted pack...
Catkin_make will generate a /devel folder which contains ...
Now let’s souce our package by using the following command:
$source ~/catkin_ws2/devel/setup.sh
-Now we can check our package by executing this command
--Roscd Sigvers_Ros so we get the following result:
CMakeLists.txt
include
msg
package.xml
src
This shows that the Sigvers_Ros packages exists
Cmake parameters:
For Sig.cpp:
cmake_minimum_required(VERSION 2.8.3)
project(Sigvers_Ros)
find_package(catkin REQUIRED COMPONENTS roscpp rospy st...
## Generate messages in the 'msg' folder
add_message_files(
FILES
Velocity.msg
)
## Generate added messages and services with any depend...
generate_messages(
DEPENDENCIES
std_msgs
)
ADD_LIBRARY(Sig_app src/Sig_app.cpp)
target_link_libraries(Sig_app ${catkin_LIBRARIES})
add_dependencies(Sig_app Sigvers_Ros_gencpp)
- We use the target_link_libraries which generates the .s...
include_directories(include ${catkin_INCLUDE_DIRS})
include_directories(/home/ericgt/sigverse-2.2.0/include...
- Here you include SiGverse .h files to compile our contr...
Catkin Command:
-- catkin_make
-we compile our code using Cmake parameters so we generat...
*Creating ROS Package [#ed1b8324]
*Source Code understanding [#ed1b8324]
-Let’s study this example step by step
Now let’s create the callback function which preforms the...
**Message Sender [#ed1b8136]
void SendController::poseCallback(const Sigvers_Ros::V...
{ Wheel_one = vel->linear;
Wheel_two = vel->angular;
printf("Velocity 1!!! %f\n", Wheel_one);
printf("Velocity 2!!! %f\n", Wheel_two);
}
- read from the Velocity Topic
- Printing the Velocity value applied on the robot
**Node Initialization [#ed1b8137]
void SendController::onInit(InitEvent &evt)
{ Wheel_one = 0.0;
Wheel_two = 0.0;
int argc =0;
char** argv = NULL;
my = this->getRobotObj(this->myname());
my->setWheel(10.0, 10.0);
ros::init(argc, argv, "Sigvers_controller_node");
ros::NodeHandle n;
velocity = 1;
chatter_pub = n.advertise<std_msgs::String>("CommandM...
pose_sub = n.subscribe<Sigvers_Ros::Velocity>("mycomm...
ros::Rate loop_rate(10);
}
**Robot Controller [#ed1b8138]
double SendController::onAction(ActionEvent &evt)
{
my->setWheelVelocity(Weel_one,Weel_two);
ros::spinOnce();
return 1.0;
}
- Now let’s create a Node to control the robot’s velocity:
**Command Node initialization ROS Side [#ed1b8139]
CommandSig::CommandSig():
linear_(0),
angular_(0),
l_scale_(2.0),
a_scale_(2.0)
{
nh_.param("scale_angular", a_scale_, a_scale_);
nh_.param("scale_linear", l_scale_, l_scale_);
vel_pub_ = nh_.advertise<Sigvers_Ros::Velocity>("myco...
mess_sub = nh_.subscribe("CommandMess",100,&Comman...
}
- Initialization of the command Node's Parameters
- The Node will send velocity information using mycommand...
- The Node will receive information using CommandMess Topic
- And finally let’s write the main function which launche...
**Main to execute the Node [#v1bef770]
int main(int argc, char** argv)
{
ros::init(argc, argv, "Sigvers_Command_node");
CommandSig Command_sig;
ros::Rate loop_rate(10);
ros::spin();
return(0);
}
- this command creates and does initialization on the Sig...
Node
**Message Sender [#ed1b8140]
-Now let’s create the callback function which receveces m...
** Robot Motion Command ROS Side [#ed1b8141]
void CommandSig::chatterCallback (const std_msgs::Stri...
{
Sigvers_Ros::Velocity vel;
if(strcmp("go",msg->data.c_str())==0)
{
vel.angular = 3.0;
vel.linear = 3.0;
vel_pub_.publish(vel);
}
else if(strcmp("back",msg->data.c_str())==0)
{
vel.angular = -3.0;
vel.linear = -3.0;
vel_pub_.publish(vel);
}
else if(strcmp("left" ,msg->data.c_str())==0)
{
vel.angular = 0.78;
vel.linear = -0.78;
vel_pub_.publish(vel);
sleep(1.8);
vel.angular = 0.0;
vel.linear = 0.0;
vel_pub_.publish(vel);
}
else if(strcmp("right" ,msg->data.c_str())==0)
{
vel.angular = -0.78;
vel.linear = 0.78;
vel_pub_.publish(vel);
sleep(1.8);
vel.angular = 0.0;
vel.linear = 0.0;
vel_pub_.publish(vel);
}
else if(strcmp("stop",msg->data.c_str())==0)
{
vel.angular = 0.0;
vel.linear = 0.0;
vel_pub_.publish(vel);
}
………
}
*Running the server [#ed1b8132]
To run the server you have to follow the following steps:
Go to catkin_ws and execute the follwing command :
-Run the ROS system:
$ roscore
run the ros ROS node :
$ rosrun key_sig sig_app
Go to ~/catkin_ws/devel/lib/libsig_app and run the sigver...
$ cd ~/catkin_ws/devel/lib/libsig_app
$ sigserver.sh -w ./move_robot.xml
Page: