Working With ROBOT_cleaner

Alright! The files for the turtlebot_cleaner motion planning was uploaded to a github page. The page has instructions on how to use the files for the turtlebot simulator. Here it is: https://github.com/aniskoubaa/gaitech_edu/blob/master/src/turtlesim/cleaning_app/robot_cleaner.cpp .

More stuff here: http://edu.gaitech.hk/ros/ros-programming-turtlesim.html .

Now, lets break it! or try to figure it out...by adding some more comments. We will just focus on the part that does the movement for cleaning.

robot_cleaner.cpp :

void gridClean(){                        //Start of the cleaning part
ros::Rate loop(0.5);                     //how frequent this should restart (every 2 seconds)
turtlesim::Pose pose;                    //
pose.x=1;                                //               
pose.y=1;                                //
pose.theta=0;                            //
moveGoal(pose, 0.01);                    //move goal to pose and accuracy to .01
loop.sleep();                            //
setDesiredOrientation(0);                //
loop.sleep();                            //
move(2, 9, true);                        //move forward @ rate of 2 distance of 9 forward
loop.sleep();                            //
rotate(degrees2radians(10), degrees2radians(90), false); //rotate speed of 10 degrees for 90 degrees ccw
loop.sleep();
move(2, 9, true);                        //move forward @ rate of 2 distance of 9 forward
rotate(degrees2radians(10), degrees2radians(90), false); //rotate speed of 10 degrees for 90 degrees ccw
loop.sleep();
move(2, 1, true);                        //move forward @ rate of 2 distance of 1 forward
rotate(degrees2radians(10), degrees2radians(90), false); //rotate speed of 10 degrees for 90 degrees ccw
loop.sleep();
move(2, 9, true);                        //move forward @ rate of 2 distance of 9 forward
rotate(degrees2radians(30), degrees2radians(90), true); //rotate speed of 30 degrees for 90 degrees cw
loop.sleep();
move(2, 1, true);                        //move forward @ rate of 2 distance of 1 forward
rotate(degrees2radians(30), degrees2radians(90), true); //rotate speed of 30 degrees for 90 degrees cw
loop.sleep();
move(2, 9, true);                        //move forward @ rate of 2 distance of 9 forward
double distance = getDistance(turtlesim_pose.x, turtlesim_pose.y, x_max, y_max); //simple linear distance

This should make the robot move from the lower left corner, to the lower right corner, then to the upper right corner, move to the left of the upper right corner, then move down, then left, and then up. The problems with this are that it is pausing between every movement, it only moves in straight lines with right angle moves, only moves the predefined distance, and it doesn't seem to take the robot size into consideration.

7/23/17