Going Forward and Avoiding Obstacles Using Code
We have learned how to launch and modify existing python script in this lesson. We have learned how to send robot a command saying: “go forward until we send you a stop signal”. In this lesson we will learn more complicated command: “we want to end up at the location three meters forward regardless of what path takes us there”.
We will work with the files from github repository.
You can find the information how to clone the github repository in
“Writing Your First Script” lesson.
We assume that your files are situated here ~/helloworld/turtlebot
.
Launching Gazebo and Rviz
1. Launch Gazebo.
2. Run the navigation demo.
3. Launch Rviz.
4. Change the TurtleBot orientation.
Send a navigation goal to change TurtleBot orientation. It has to be facing the long object.
5. Change the TurtleBot position.
Send a navigation goal to stand TurtleBot in front of the object facing it. For example, like this:
Launching Script
1. Launch script.
2. See the results in Rviz.
TurtleBot will find a path and stop on another side of object.
3. Interrupt the processes. Close the terminals.
You can watch these steps in the video:
After finishing the instructions open file goforward_and_avoid_obstacle.py
and try to understand the meaning of the commands reading the comments.
NOTE: In the script goforward_and_avoid_obstacle.py
there is also a
restriction on the time of task execution (lines 50-51):