TurtleBot Follower
In this lesson we will launch TurtleBot follower demo. We will launch two TurtleBots in Gazebo Concert, then you will drive the first TurtleBot and the second will follow it.
Prerequisites
1. This lesson is a continuation of the previous lesson:
“Multiple TurtleBots in Concert”.
If you have not done instructions from prerequisites
section, you should do
them firstly.
2. We will use tutlebot_follower
package.
2.1 Change directory.
2.2 Clone the turtlebot_apps
repository.
NOTE: We will use this repository until this pull request will be merged.
The original repository is https://github.com/turtlebot/turtlebot_apps.
2.3 Change directory.
2.4 Change git branch.
The opportunity to launch follower application in simulation was added in
simul
branch.
3. Build package.
If you have an error then use CATKIN_IGNORE
for all packages except
turtlebot_follower
package.
If you run catkin_make, it will ignore any package in the directory with
CATKIN_IGNORE
file.
Launching Turtlebot Follower
TurtleBot named gamza1
will be controlled using joystick, TurtleBot named
gamza2
will follow gamza1
in this example.
1. Launch Gazebo Concert (steps 1-10 from the previous lesson).
2. Select gamza1
in the resource list and capture it.
3. Open a new terminal and change the path.
4. Launch turtlebot_follower demo.
NOTE: __ns is a substitute for ROS_NAMESPACE. You can find more information on wiki ros.
5. To initiate following, gamza1
has to be in front of gamza2
. Drive
gamza1
using joystick to place it in front of gamza2
. After gamza2
recognizes gamza1
, gamza2
tries to keep the center of the observed object
directly in front of itself and a fixed distance away.
If gamza1
is very close to gamza2
, then gamza2
will go backward away. If
distance between them is increasing then gamza2
will go forward after gamza1
to reduce the distance.
You should move gamza1
slowly. If you move gamza1
too quickly, then gamza2
will lose it and stop.
NOTE: Other objects could confuse the follower. You should avoid them.
6. Interrupt the processes. Close the windows.
You can watch these steps in the video:
You can find more information about turtlebot_follower package on wiki ros.