TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS -...

Post on 23-Apr-2020

8 views 1 download

Transcript of TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS -...

TurtleBot2&ROS - Learning TB2Ing. Zdeněk Materna

Department of Computer Graphics and MultimediaFakulta informačních technologií

VUT v Brně

TurtleBot2&ROS - Learning TB2 1 / 22

Presentation outline

Introduction

Learning TB2

Hands on

TurtleBot2&ROS - Learning TB2 2 / 22

Introduction

TurtleBot2&ROS - Learning TB2 3 / 22

Introduction

"Robots of the world, you are ordered to exterminate the humanrace. Do not spare the men. Do not spare the women. Preserveonly the factories, railroads, machines, mines, and raw materials.Destroy everything else. Then return to work. Work must notcease."

Karel Čapek

TurtleBot2&ROS - Learning TB2 4 / 22

Introduction

• TB2 is compact indoor research platform.• Testing of vision, recognition, manipulation, mapping and

many more algorithms.

TurtleBot2&ROS - Learning TB2 5 / 22

Learning TB2

TurtleBot2&ROS - Learning TB2 6 / 22

Sensors

• 3D camera (Microsoft Kinect)• IMU (Pololu CHR-UM6)• LIDAR (Sick LMS100)• odometry• infrared sensors, wheel drop

TurtleBot2&ROS - Learning TB2 7 / 22

Actuators

• base (iRobot Roomba)• Dynamixel servos for arm, Kinect

TurtleBot2&ROS - Learning TB2 8 / 22

Remote access

• distributing ROS

e xpo r t ROS_MASTER_URI=ht tp : / / 1 92 . 1 6 8 . 1 . 4 : 1 1 3 1 1

• remote shell (SSH)

s sh f i t@192 . 1 6 8 . 1 . 4

• remote desktop (VNC / TeamViewer)

TurtleBot2&ROS - Learning TB2 9 / 22

TB2 stack

Packages in tb2_main_packages stack:• btb_base_driver• btb_bringup• btb_common• btb_description• btb_dynamixel• btb_gazebo• btb_imu• btb_manipulator• btb_navigation• btb_teleop

TurtleBot2&ROS - Learning TB2 10 / 22

Hands on

TurtleBot2&ROS - Learning TB2 11 / 22

Task list

Basic tasks:• Task b1: Publishing audio from Kinect.• Task b2: Logging robot’s trajectory.• Task b3: Node for monitoring TB2 batteries state.• Task b4: Augmentation of TB2 URDF model.

Intermediate:• Task i1: Stabilisation of Kinect.• Task i2: Simulation of Kinect accelerometer.• Task i3: Random walk.

Bit advanced ones:• Task a1: Node for closed loop control of the movement.• Task a2: Set-up diagnostics for TB2.

TurtleBot2&ROS - Learning TB2 12 / 22

Task b1 - Publishing audio from Kinect

Goal: Hear sound from robot.

Instructions:• No coding needed ;)• The openni_kinect (link) library (which is used in ROS)

should have full support for audio.• There is tutorial (link) how to stream audio using ROS.• Create package and appropriate launch files.• Play sound from Kinect’s microphones (real Kinect needed).

TurtleBot2&ROS - Learning TB2 13 / 22

Task b2 - Logging trajectory

Goal: Visualise trajectory of robot in RVIZ.

Instructions:• No coding needed ;)• The hectory_trajectory_server can be used to do this!• Create package and launch file which will run trajectory

logging.• Demonstrate functionality with simulated or real robot.

TurtleBot2&ROS - Learning TB2 14 / 22

Task b3 - Monitoring batteries

Goal: Monitor state of robot’s batteries using ROS.

Instructions:• Install some serial terminal program (e.g. cutecom), connect

to real robot and open /dev/ttyUSB3 (19200 baud).• You should receive strings like this:

#BS : 16 ,5V, BA: 16 ,6V, BR: 13 ,5V

• Where BS means sensors, BA arm and BR robot’s batteryvoltage.

• Create package and code which will parse this string andpublish it somehow (tip for format).

TurtleBot2&ROS - Learning TB2 15 / 22

Task b5 - Augmentation of TB2 URDF model.

Goal: Make TB2 model more realistic.

Instructions:• No programming needed! Just some URDF hacking...• Try to replace the big blue box on back of TB2 with more

parts which will look more realistic.• Visualise augmented model using RVIZ.

TurtleBot2&ROS - Learning TB2 16 / 22

Task i1 - Kinect stabilisation

Goal: Kinect is horizontally stabilised.

Instructions:• Kinect has integrated accelerometer. There is driver for it:

kinect_aux.• Prepare launch file which will start this driver.• Prepare package and code which will send commands to

Kinect’s servo to stabilise it (look at kinect_servo.py inbtb_dynamixel).

• Driver produces /cur_tilt_angle topic which should be quiteeasy to use (just one number - angle).

• Test it on real robot (simulated Kinect has no accelerometer).

TurtleBot2&ROS - Learning TB2 17 / 22

Task i2 - Simulation of accelerometer

Goal: Simulated IMU acts as Kinect’s accelerometer.

Instructions:• Find how to add simulated IMU to some link (look at

gazebo.urdf.xacro from btb_description, line 51).• Inspect what is format of IMU data and write node, which will

convert it to same format, which is produced by kinect_aux as/cur_tilt_angle.

TurtleBot2&ROS - Learning TB2 18 / 22

Task i3 - Random walk

Goal: Robot is randomly wandering in it’s environment.

Instructions:• Create package, launch file and code which will subscribe to

laser scan data.• With laser scan, task could be to rotate robot on place and go

straight ahead.• Commands are send to /cmd_vel topic (type Twist).• Test it with simulated or real robot.

TurtleBot2&ROS - Learning TB2 19 / 22

Task a1 - Closed loop control

Goal: Robot going straight ahead!

Instructions:• Robot is accepting velocity commands. But - wheels may lost

friction etc. and then robot is not going straight ahead even ifcommanded angular velocity is equal to zero.

• From IMU, we can obtain current heading angle of robot.• Task is to create node, which will try to regulate angular

speed of robot in such way it will go straight ahead.• Test on simulated robot and then on the real one.

TurtleBot2&ROS - Learning TB2 20 / 22

Task a2 - Diagnostics

Goal: Be able to monitor some important value.

Instructions:• There is diagnostics stack which is widely used for diagnostic

purposes.• Try to setup diagnostics for monitoring robot’s computer state

(CPU usage / battery etc) - look into turtlebot_node package(laptop_battery.py).

• Example configuration of diagnostics could be found inturtlebot_bringup package.

• Visualise it using robot_monitor.

TurtleBot2&ROS - Learning TB2 21 / 22

Thanks for your attention

TurtleBot2&ROS - Learning TB2 22 / 22