My slides for the Hands-on part of the Robotic Vision Summer School 2015 in Kioloa, Australia.
This is part of the robotics workshop, aiming to teach the participants how to program the turtlebot .
4. http://roboticvision.org/
What is ROS?
â free and open source
â thin, multi-lingual, peer-to-peer
â tools-based
It is NOT a
â programming language or IDE
â (just a) library
â (full) operating system
5. http://roboticvision.org/
Mount the USB stick and install VirtualBox.
In VirtualBox go to Machine -> Add⊠and select the
Ubuntu_14.04_ROS.vbox image from the stick.
How?
Try it out!
6. http://roboticvision.org/
We need three terminals to run the following commands:
> roscore
> rosrun turtlesim turtlesim_node
> rosrun turtlesim turtle_teleop_key
How?
Try it out!
9. http://roboticvision.org/
Try it out!
Using the same commands from before:
> rosnode list > rostopic list
/rosout /rosout
/teleop_turtle /turtle1/cmd_vel
/turtlesim /turtle1/color_sensor
/turtle1/pose
> rosnode info /turtlesim
> rqt_graph
10. http://roboticvision.org/
Try it out!
How about the messages?
> rostopic echo /turtle1/cmd_vel
...
> rostopic info /turtle1/cmd_vel
Type: geometry_msgs/Twist
...
> rosmsg show geometry_msgs/Twist
...
11. http://roboticvision.org/
Logging & Playback
Try it out!
We need three terminals to run:
> rosbag record /turtle1/cmd_vel -O test
[ move the teleop-ed turtle âŠ]^C
> rosbag info test.bag
path: test.bag
duration: 0.6s
messages: 7
topics: /turtle1/cmd_vel 7 msgs : geometry_msgs/Twist
> rosbag play test.bag
12. http://roboticvision.org/
> mkdir -p ~/catkin_ws/src
> cd ~/catkin_ws/src
> catkin_init_workspace
> cd ~/catkin_ws
> catkin_make
> source devel/setup.bash
a flexible way of building your projects (CMake inspired)
ROS Workspaces
Try it out!
13. http://roboticvision.org/
We want you to send data (msgs),
from one running node to another!
#!/usr/bin/env python #!/usr/bin/env python
# Publisher # Publisher
import rospy import rospy
from std_msgs.msg import String from std_msgs.msg import String
... ...
Simple Demo
Try it out!
14. http://roboticvision.org/
#!/usr/bin/env python #!/usr/bin/env python
# Publisher # Publisher
import rospy import rospy
from std_msgs.msg import String from std_msgs.msg import String
def talker(): def callback(data):
pub = rospy.Publisher('chatter', String, queue_size=10) rospy.loginfo(rospy.get_caller_id() +
rospy.init_node('talker', anonymous=True) "I heard %s", data.data)
rate = rospy.Rate(10) # 10hz
while not rospy.is_shutdown(): def listener():
hello_str = "hello world %s" % rospy.get_time() rospy.init_node('listener', anonymous=True)
rospy.loginfo(hello_str) rospy.Subscriber("chatter", String,
callback)
pub.publish(hello_str) rospy.spin() # keeps python from exiting
rate.sleep()
if __name__ == '__main__': if __name__ == '__main__':
try: listener()
talker()
except rospy.ROSInterruptException:
pass
...
Simple Demo
15. http://roboticvision.org/
No, ROS is much, much more
â build system (catkin)
â coordinate frame transformations (tf)
â parameter server (rosparam)
â visualization (rviz)
â GUI & monitoring (rqt)
â ...
â your tool to do something awesomeâą
Thatâs it?
17. http://roboticvision.org/
Further Reading
â Morgan Quigley et al. (2009) ROS: an open-source Robot Operating System
â J. M. O'Kane. A Gentle Introduction to ROS: http://www.cse.sc.edu/~jokane/agitr/
â http://wiki.ros.org/ROS/StartGuide
â http://wiki.ros.org/ROS/Tutorials/WhereNext
â Lost? Ask us! And check http://wiki.ros.org & http://answers.ros.org
â http://robohow.eu/_media/meetings/first-integration-workshop/ros-best-practices.pdf