[go: up one dir, main page]

0% found this document useful (0 votes)
14 views17 pages

Lecture 4. Ros Basic Part 3

The document provides an overview of the Robot Operating System (ROS), covering key components such as publishers, the TF Transformation System, and the rqt User Interface. It details how to create a publisher in C++, the functionality of TF for managing coordinate frames, and various rqt plugins for visualizing data. Additionally, it introduces the Unified Robot Description Format (URDF) for defining robot models and offers further references for learning about ROS.

Uploaded by

Lê Xuân Lực
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)
14 views17 pages

Lecture 4. Ros Basic Part 3

The document provides an overview of the Robot Operating System (ROS), covering key components such as publishers, the TF Transformation System, and the rqt User Interface. It details how to create a publisher in C++, the functionality of TF for managing coordinate frames, and various rqt plugins for visualizing data. Additionally, it introduces the Unified Robot Description Format (URDF) for defining robot models and offers further references for learning about ROS.

Uploaded by

Lê Xuân Lực
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
You are on page 1/ 17

PROGRAMMING FOR ROBOTICS

ROS
Contents
• ROS publisher
• rqt User Interface
• TF Transformation System
• Robot models (URDF)

Robot Operating System


ROS C++ (Publisher)
#include <ros/ros.h>
• Create a publisher with help of the node handle #include <std_msgs/String.h>
int main(int argc, char **argv) {
ros::init(argc, argv, "talker");
ros::NodeHandle nh;
> ros::Publisher publisher = ros::Publisher chatterPublisher =
nodeHandle.advertise<message_type>(topic, nh.advertise<std_msgs::String>("chatter"
queue_size); , 1);
ros::Rate loopRate(10);
unsigned int count = 0;
while (ros::ok()) {
std_msgs::String message;
• Publish the contents with message.data = "hello world " +
std::to_string(count);
ROS_INFO_STREAM(message.data);
chatterPublisher.publish(message);
> publisher.publish(message); ros::spinOnce();
loopRate.sleep();
count++;
}
return 0;
}
http://wiki.ros.org/roscpp/Overview/Publishers%20and%20Subscribers

Robot Operating System


TF Transformation System

• Tool for keeping track of coordinate frames over time


• Maintains relationship between coordinate frames in
a tree structure buffered in time
• Lets the user transform points, vectors, etc. between
coordinate frames at desired time
• Implemented as publisher/subscriber model on the
topics /tf and /tf_static

http://wiki.ros.org/tf2

Robot Operating System


TF Transformation System
• TF listeners use a buffer to listen to all broadcasted
transforms
• Query for specific transforms from the transform
tree

tf2_msgs/TFMessage.msg
geometry_msgs/TransformStamped[] transforms
std_msgs/Header header
uint32 seqtime stamp
string frame_id
string child_frame_id
geometry_msgs/Transform transform
geometry_msgs/Vector3 translation
geometry_msgs/Quaternion rotation

Robot Operating System


TF Transformation System (Tools)
Command line View Frames RViz
Print information about the current Creates a visual graph (PDF) 3D visualization of the
transform tree of the transform tree transforms

> rosrun tf tf_monitor > rosrun tf tf_view_frames

Print information about the


transform between two frames

> rosrun tf tf_echo


source_frame target_frame

Robot Operating System


TF Transformation System (Rviz Plugin)

Robot Operating System


rqt User Interface

• User interface base on Qt


• Custom interfaces can be setup
• Lots of existing plugins exist
• Simple to write own plugins

Run qt with:

> rosrun rqt_gui rqt_gui

http://wiki.ros.org/rqt/Plugins

Robot Operating System


rqt User Interface (rqt_image_view)

• Visualizing images

http://wiki.ros.org/rqt_image_view

Robot Operating System


rqt User Interface (rqt_multiplot)

• Visualizing numeric values in 2D plots

http://wiki.ros.org/rqt_multiplot

Robot Operating System


rqt User Interface (rqt_graph)
• Visualizing the ROS computation graph

http://wiki.ros.org/rqt_graph

Robot Operating System


rqt User Interface (rqt_console)
• Displaying and filtering ROS messages

http://wiki.ros.org/rqt_console

Robot Operating System


rqt User Interface (rqt_logger_level)
• Configuring the logger level of ROS nodes

http://wiki.ros.org/rqt_logger_level

Robot Operating System


Robot Models Unified Robot Description Format (URDF)

• Defines an XML format for representing a robot


model
• Kinematic and dynamic description
• Visual representation
• Collision model
• URDF generation can be be scripted with XACRO

http://wiki.ros.org/urdf
http://wiki.ros.org/xacro

Robot Operating System


Robot Models Unified Robot Description Format (URDF)

• Description consists of a set of link elements and a set of joint


elements <link name="link_name">
<visual>
• Joints connect the links together
<geometry>
<mesh filename="mesh.dae"/>
<robot name="robot"> </geometry>
<link> ... </link> </visual>
<link> ... </link>
<link> ... </link>
<collision>
<geometry>
<joint> .... </joint>
<joint> .... </joint> <cylinder length="0.6"
<joint> .... </joint> radius="0.2"/>
</robot> </geometry>
</collision>

<inertial>
<mass value="10"/>
<inertia ixx="0.4" ixy="0.0" …/>
<joint name="joint_name" type="revolute"> </inertial>
<axis xyz="0 0 1"/> </link>
<limit effort="1000.0" upper="0.548" … />
<origin rpy="0 0 0" xyz="0.2 0.01 0"/>
<parent link="parent_link_name"/>
<child link="child_link_name"/>
</joint> http://wiki.ros.org/urdf/XML/model

Robot Operating System


Further References

• Ros Wiki • ROS Cheat Sheet


• http://wiki.ros.org/ • https://github.com/ros/cheatsheet/r
• Installation eleases/dow
• http://wiki.ros.org/ROS/Installa nload/0.0.1/ROScheatsheet_catkin.
tion pdf
• Tutorials • ROS Best Practices
• http://wiki.ros.org/ROS/Tutoria • https://github.com/ethzasl/ros_best
ls _practices/wiki
• Available packages • ROS Package Template
• http://www.ros.org/browse/ • https://github.com/ethzasl/ros_best
_practices/tree/master/ros_packag
e_template

Robot Operating System


Q&A
Robot Operating System

You might also like