turtlebot2&ros - learning tb2spanel/rosworkshop2013/1_6 learning tb2.pdf · turtlebot2&ros...

22
TurtleBot2&ROS - Learning TB2 Ing. Zdeněk Materna Department of Computer Graphics and Multimedia Fakulta informačních technologií VUT v Brně TurtleBot2&ROS - Learning TB2 1 / 22

Upload: others

Post on 23-Apr-2020

8 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 2: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

Presentation outline

Introduction

Learning TB2

Hands on

TurtleBot2&ROS - Learning TB2 2 / 22

Page 3: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

Introduction

TurtleBot2&ROS - Learning TB2 3 / 22

Page 4: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 5: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

Introduction

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

many more algorithms.

TurtleBot2&ROS - Learning TB2 5 / 22

Page 6: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

Learning TB2

TurtleBot2&ROS - Learning TB2 6 / 22

Page 7: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

Sensors

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

TurtleBot2&ROS - Learning TB2 7 / 22

Page 8: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

Actuators

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

TurtleBot2&ROS - Learning TB2 8 / 22

Page 9: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 10: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 11: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

Hands on

TurtleBot2&ROS - Learning TB2 11 / 22

Page 12: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 13: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 14: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 15: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 16: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 17: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 18: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 19: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 20: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 21: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

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

Page 22: TurtleBot2&ROS - Learning TB2spanel/ROSWorkshop2013/1_6 Learning TB2.pdf · TurtleBot2&ROS - Learning TB2 Ing.ZdeněkMaterna Department of Computer Graphics and Multimedia Fakulta

Thanks for your attention

TurtleBot2&ROS - Learning TB2 22 / 22