![Page 1: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/1.jpg)
Introduction to ROS
![Page 2: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/2.jpg)
Slides adapted from: http://courses.csail.mit.edu/6.141/spring2014/pub/lectures/Lec05-ROS-Lecture.pptm
![Page 3: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/3.jpg)
A meta-operating system for robots
![Page 4: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/4.jpg)
What is ROS?
• A “Meta” Operating System.• Open source• Runs in Linux (esp. Ubuntu)• OS X support• Ongoing Windows implementation
• Nodes• Message passing
• Publish• Subscribe• Services via remote invocation
• Supports numerous programming languages (C++, Python, Lisp, Java)
![Page 5: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/5.jpg)
What is ROS?
• Low level device abstraction• Joystick• GPS• Camera• Controllers• Laser Scanners• …
• Application building blocks• Coordinate system transforms• Visualization tools• Debugging tools• Robust navigation stack (SLAM with loop closure)• Arm path planning• Object recognition• ...
Application building blocks
System software
ROS
![Page 6: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/6.jpg)
What is ROS?
• Software management (compiling, packaging)• Remote communication and control
![Page 7: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/7.jpg)
What is ROS?
• Founded by Willow Garage• Exponential adoption• Countless commercial, hobby, and academic robots use ROS
(http://wiki.ros.org/Robots)
![Page 8: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/8.jpg)
ROS Philosophical goals
• “Hardware agnosticism”• Peer to peer• Tools based software design• Multiple language support (C++/Java/Python)• Lightweight: runs only at the edge of your modules• Free• Open source• Suitable for large scale research and industry
![Page 9: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/9.jpg)
ROS software development
![Page 10: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/10.jpg)
Conceptual levels of design
10
Node 1 Laser Scanning
Node 2:Map Building
Node 3:Planning
(C) File-system level: ROS Tools for managing source code, build instructions, and message definitions.
Node 4 (B) Computation Graph: Peer-to-Peer Network of ROS nodes (processes).
Node 5
Node 6Node7
Carnegie Mellon
(A) ROS Community: ROS Distributions, Repositories
![Page 11: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/11.jpg)
Tools-based software design
Tools for:
• Building ROS nodes (catkin_make)• Running ROS nodes (rosrun, roslaunch)• Viewing network topology (rqt_graph)• Monitoring network traffic (rostopic)
Many cooperating processes, instead of a single monolithic program.
![Page 12: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/12.jpg)
Multiple language support
• ROS is implemented natively in each language.
• Quickly define messages in language-independent format.
Python Node: Laser Scanner
C++ Node : Map Building
Topic: “LaserData”
PublicationSubscription
Header headerPoints32[] pointsXYZint32 numPoints
File: PointCloud.msgFile-system level
![Page 13: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/13.jpg)
Lightweight
• Encourages standalone libraries with no ROS dependencies:
Don’t put ROS dependencies in the core of your algorithm!
• Use ROS only at the edges of your interconnected software modules: Downstream/Upstream interface
• ROS re-uses code from a variety of projects:
• OpenCV : Computer Vision Library
• Point Cloud Library (PCL) : 3D Data Processing
• MoveIt : Motion Planning Carnegie Mellon
ROS Community
![Page 14: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/14.jpg)
Peer to Peer Messaging
• No Central Server through which all messages are routed.• “Master” service run on 1 machine for name registration +
lookup• Messaging Types:
• Topics : Asynchronous data streaming• Parameter Server
Computation Graph
![Page 15: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/15.jpg)
Peer to Peer Messaging
• Master: Lookup information, think DNSroscore command starts master, parameter server, logging
• Publish: Will not block until receipt, messages get queued.• Delivery Guarantees: Specify a queue size for publishers: If publishing too
quickly, will buffer a maximum of X messages before throwing away old ones• Transport Mechanism: TCPROS, uses TCP/IP• Bandwidth: Consider where your data’s going, and how
Computation Graph
![Page 16: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/16.jpg)
Free & Open Source
• BSD License : Can develop commercial applications • Drivers (Kinect, Joystick, Lasers, and others)• Perception, Planning, Control libraries• Interfaces to other libraries: OpenCV, PCL, etc.
![Page 17: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/17.jpg)
ROS Debugging
17
• Shutdown “Object” node re-compile restart : won’t disturb system
• Logging (VIDEO)
Kinect DriverObject
Recognition
Laser Scanner
Logger
Object RecognitionLogger Playback
• Playback (VIDEO)
![Page 18: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/18.jpg)
Useful ROS Debugging Tools
• rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and message content.
rostopic echo [topic name] prints messages to console
rostopic list prints active topics
… (several more commands)• rqt_plot : Plot data from one or more ROS topic fields using matplotlib.
rqt_plot /turtle1/pose/x,/turtle1/pose/y graph data from 2 topics in 1 plot
![Page 19: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/19.jpg)
Record data from published to topicsrosbag record [topics] -o <output_file>
Play back recording rosbag play <input_file> --clock
![Page 20: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/20.jpg)
Useful ROS Debugging Tools
rqt_graph
![Page 21: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/21.jpg)
ROS Visualization
Visualize:
• Sensor data• Robot joint states• Coordinate frames• Maps being built• Debugging 3D markers
VIDEO
![Page 22: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/22.jpg)
rviz
![Page 23: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/23.jpg)
ROS Transformations
• “TF” = Name of Transform package • TF Handles transforms between coordinate frames : space + time
• tf_echo : print updated transforms in console
Example: rosrun tf tf_echo [reference_frame] [target_frame]
![Page 24: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/24.jpg)
Packages
• Perception
• Point Cloud Library (PCL)
• OpenCV
• Kinect/OpenNI
![Page 25: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/25.jpg)
ROS Simulator
Gazebo
● Can simulate different robots, sensors, and environments
● Develop algorithms and test in the simulator● If model is good enough, same code will work on the real robot with similar performance.
![Page 26: Introduction to ROSflorian/courses/csc477_fall19/...Useful ROS Debugging Tools • rostopic: Display debug information about ROS topics: publishers, subscribers, publishing rate, and](https://reader030.vdocuments.net/reader030/viewer/2022040611/5ed5e5cf698a181f9a133ac8/html5/thumbnails/26.jpg)
ROS Resources
• http://www.ros.org
• http://wiki.ros.org
• ROS Tutorials: http://wiki.ros.org/ROS/Tutorials• Gazebo: http://gazebosim.org/