0% found this document useful (0 votes)
2 views6 pages

5 ROS Lecture 2

The document provides an overview of the Robot Operating System (ROS) and its components, including message types such as std_msgs and geometry_msgs. It details the process of creating custom message files, modifying CMakeLists.txt, and utilizing roslaunch for starting multiple nodes. Additionally, it covers recording and playing back data using rosbag, with demonstrations planned for class.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

5 ROS Lecture 2

The document provides an overview of the Robot Operating System (ROS) and its components, including message types such as std_msgs and geometry_msgs. It details the process of creating custom message files, modifying CMakeLists.txt, and utilizing roslaunch for starting multiple nodes. Additionally, it covers recording and playing back data using rosbag, with demonstrations planned for class.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

EE-877 Mobile Robotics

ROS

Dr. Latif Anjum


Assist. Prof. NUST – SEECS
PG EE (Electronics, Power and Control)
Robot Operating System (ROS)

 ROS Messages
 std_msgs ([Link]

 geometry_msgs ([Link]

 common_msgs ([Link]

 sensor_msgs ([Link]

 rostopic –h
 rostopic list
 rostopic echo /topic_name
 rosnode list

Introduction to Autonomous Mobile Robots (2nd Ed), Seigwart


Instructor: Dr. Latif Anjum
Robot Operating System (ROS)

 Creating our own msg file


 msg files are simple text files that describe the fields of a ROS message. They
are used to generate source

 Create a directory „msg‟ within the package and inside the


directory create a .msg file.
Header header
float64 x
float64 y
float64 theta

 Build the package, make necessary changes in [Link]


 You can now use the msg file
 rosmsg show [package name]/msg name

 While using your custom built msg file, remember to include:


 #include “[package name]/[msg name].h”

Introduction to Autonomous Mobile Robots (2nd Ed), Seigwart


Instructor: Dr. Latif Anjum
Robot Operating System (ROS)

 Creating our own msg file


 Changes required in [Link]
 Add message generation package
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy Add this line
std_msgs
message_generation
)
 Uncomment the following
## Generate messages in the 'msg' folder
add_message_files(
FILES
[Link]
# [Link]
)
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs
)

Introduction to Autonomous Mobile Robots (2nd Ed), Seigwart


Instructor: Dr. Latif Anjum
Robot Operating System (ROS)

 Roslaunch
 roslaunch is used for starting many nodes at once with a single command.

 A separate tutorial uploaded containing details of roslaunch. Demonstration


to be done in class
 [Link]

Introduction to Autonomous Mobile Robots (2nd Ed), Seigwart


Instructor: Dr. Latif Anjum
Robot Operating System (ROS)

 Recording and Playing back the Data


 Rosbag

 rosbag record –a
 rosbag info <your bagfile>
 rosbag play <your bagfile>
 rosbag record -O subset /turtle1/cmd_vel /turtle1/pose

 rostopic echo -b [Link] -p /topic > [Link]

Demonstration to be done in class

Introduction to Autonomous Mobile Robots (2nd Ed), Seigwart


Instructor: Dr. Latif Anjum

You might also like