Blended Controller
Contents
Lab Objectives
The objective of this lab is to understand, modify and evaluate the performance of a blended controller for go-to-goal and obstacle avoidance behaviors.
Source File Code
As a starting point, download the following turtlebot_driver.cpp
.
You can copy/paste this code or replace your turtlebot_driver.cpp
with the file above.
Tasks
Task 1: Configure the new map
You need to configure the map of the turtlebot stage simulator first. You will use the following map.
Follow these steps:
- in a terminal, write the command
sudo nautilus
it will open a file browser in super user mode.
- Click on
Computer
in the left pane. - Go to directory
/opt/ros/indigo/share/turtlebot_stage/launch
- Copy the file
turtlebot_in_stage_robopark.launch
in the folder/opt/ros/indigo/share/turtlebot_stage/launch
with the same name - If the copy fails, then download the file
turtlebot_in_stage_robopark.launch
into you HOME directory and then execute this command in a terminal:
sudo cp turtlebot_in_stage_robopark.launch /opt/ros/indigo/share/turtlebot_stage/launch/turtlebot_in_stage_robopark.launch
put the password when requested.
- Close the file browser.
Task 2: Run and Test the code
Now, open two terminals to run and test the code.
In the first terminal, write:
roslaunch turtlebot_stage turtlebot_in_stage_robopark.launch
In the second terminal, run
rosrun beginner_tutorials turtlebot_driver_node
You should see the robot moving towards its target location.
Task 3: Algorithm Analysis
Open Eclipse, read the code and respond to the following questions:
- Question 1: write the equations of the blended controller and explain each parameter in the equations.
- Question 2: In the BlendedBehavior() function, replace the line
double distObst = LaserScanner::getMinimumRange(_scanMsg);
bydouble distObst = LaserScanner::getFrontRange(_scanMsg);
.- test the code several times after this change.
- What do you observe?
- Explain your observation
- Question 3: put back the line
double distObst = LaserScanner::getMinimumRange(_scanMsg);
Now, replace the code
if (LR>RR){ Xop=Xr+(distObst*cos(theta_robot+(PI/2))); Yop=Yr+(distObst*sin(theta_robot+(PI/2))); }else{ Xop=Xr+(distObst*cos(theta_robot-(PI/2))); Yop=Yr+(distObst*sin(theta_robot-(PI/2))); }
with the following code
Xop=Xr+(distObst*cos(theta_robot+(PI/2))); Yop=Yr+(distObst*sin(theta_robot+(PI/2)));
- test the code several times after this change.
- What do you observe?
- Explain you observation
- Question 4: put back the code
if (LR>RR){ Xop=Xr+(distObst*cos(theta_robot+(PI/2))); Yop=Yr+(distObst*sin(theta_robot+(PI/2))); }else{ Xop=Xr+(distObst*cos(theta_robot-(PI/2))); Yop=Yr+(distObst*sin(theta_robot-(PI/2))); }
replace the expression
sigma_gtg = 1-exp(-1.0*(distObst-0.3));
by
sigma_gtg = a_constant_value_of_you_choice; // the constant must be between 0.0 and 1.0
- test the code several times after this change.
- What do you observe?
- Explain you observation
- Question 5: replace the expression
sigma_gtg = 1-exp(-1.0*(distObst-0.3));
by
sigma_gtg = 1-exp(-9.0*(distObst-0.3));
- test the code several times after this change.
- What do you observe?
- Explain you observation
How to Submit
You must submit a Word document that contains the answers of the questions above. Put the Word document in your personal shared dropbox folder.
The name of the Word document must the following lab03_BlendedBehavior_fullStudentName.doc
Deadline
Sunday Nov 8, 2015
Grading
- Grade: 10 points
- Deadline: