Note: This tutorial assumes that you have completed the previous tutorials: TurtleBot Bringup. |
Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
The TurtleBot Panorama Demo
Description: This describes how to run the TurtleBot Panorama Demo on your TurtleBot.Tutorial Level: BEGINNER
Panorama Demo
The panorama demo will show you how to take impressive (to some extent) panoramic pictures with your TurtleBot. To do it turtlebot_panorama uses pano_ros for taking snapshots and stitching them together to create panorama pictures.
Getting started
To launch this app, ssh (ssh help) into the TurtleBot and start the panorama demo:
To ssh in to a TurtleBot from a workstation computer:
determine the IP_OF_TURTLEBOT by using ifconfig (Need more help)
To determine a computer's IP address and network interface in linux:
ifconfig
You will see something like:
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:6658055 errors:0 dropped:0 overruns:0 frame:0 TX packets:6658055 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:587372914 (587.3 MB) TX bytes:587372914 (587.3 MB) wlan1 Link encap:Ethernet HWaddr 48:5d:60:75:58:90 inet addr:10.0.129.17 Bcast:10.0.129.255 Mask:255.255.254.0 inet6 addr: fe80::4a5d:60ff:fe75:5890/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:101983 errors:0 dropped:0 overruns:0 frame:0 TX packets:37244 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:49326141 (49.3 MB) TX bytes:7588044 (7.5 MB)
the network interface for the wireless card is wlan1
the IP address of the computer is 10.0.129.17
use ssh to connect to the TurtleBot
ssh turtlebot@IP_OF_TURTLEBOT
roslaunch turtlebot_panorama panorama.launch
The panorama app offers two interfaces for triggering the panorama creation:
Via rostopic using parameters defined in the launch file (see Parameters)
$ rostopic pub turtlebot_panorama/take_pano std_msgs/Empty
Via a service with user-specified parameters (see TakePano service definition)
$ rosservice call turtlebot_panorama/take_pano 0 360.0 30.0 0.3
You can also stop the panorama creation:
- Via rostopic
$ rostopic pub turtlebot_panorama/stop_pano std_msgs/Empty
Via a service call with the mode parameter set to STOP (2)
$ rosservice call turtlebot_panorama/take_pano 2 360.0 30.0 0.3
Once you stop the creation a panorama image is created with the already gather snapshots.
Panorama parameters
The magic number you show in previous service calls tell the application how take the panorama. We explain here in the order they must me added to service calls:
- mode for taking the pictures. Can be:
0 for snap&rotate (i.e. rotate, stop, snapshot, rotate, stop, snapshot, ...)
- 1 for continuous (i.e. keep rotating while taking snapshots)
- 2 to stop an ongoing panorama creation
- total angle of panorama picture, in degrees
angle interval (in degrees) when creating the panorama picture in snap&rotate mode, time interval (in seconds) otherwise
- rotating velocity (in radians/s)
Checking Result
The result of panorama can be shown via image_view.
> rosrun image_view image_view image:=/turtlebot_panorama/panorama
Android client
In addition to the command line interfaces, you can also launch and operate panorama from your Android device. Visit Turtlebot-Android Pairing to learn how to install Android apps. The UI is very simple: three sliders allow you to set the total angle, angle/time interval and rotating velocity, while a check box allows you to switch between snap&rotate and continuous operation modes.