Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

ROS Hands-On Intro/Tutorial (Robotic Vision Summer School 2015) #RVSS #ACRV


Published on

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 .

Published in: Technology

ROS Hands-On Intro/Tutorial (Robotic Vision Summer School 2015) #RVSS #ACRV

  1. 1. ROS Intro/Tutorial Juxi Leitner <> Hands-onV
  2. 2. from PHD Comics and Willow Garage
  3. 3. Why ROS? ● abstraction ● distributed computation (multi thread, multi computer, multi robot) ● software reuse and rapid testing
  4. 4. 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. 5. 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. 6. We need three terminals to run the following commands: > roscore > rosrun turtlesim turtlesim_node > rosrun turtlesim turtle_teleop_key How? Try it out!
  7. 7.
  8. 8. ROS Concepts ● Master ● Nodes ● Messages ● Topics ● Services ● Actions
  9. 9. 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. 10. 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. 11. 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. 12. > 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. 13. 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. 14. #!/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", 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. 15. 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?
  16. 16. (A) Mobile Base (B) Kinect 3D sensor (C) Computing (eeePc) (D) HW Structure The TurtleBot Learn TurtleBot and ROS
  17. 17. Further Reading ● Morgan Quigley et al. (2009) ROS: an open-source Robot Operating System ● J. M. O'Kane. A Gentle Introduction to ROS: ● ● ● Lost? Ask us! And check & ●