As announced in the Robotics Lab 1, your homework for this week will be to implement the race program. To do so there are a number of tasks that you should do.
The robotics lab is a group work. Please share your program among your teammates regularly.
As such only one person needs to submit the files required below into gradebot. We need to know where to look for the file. So EVERYBODY needs to create a file called 'info.txt' in the root folder of the 'Robotics Lab Code' repo on gradebot. The file should have the following format:
So after 'main: ' the gradebot user name storing the groups files should be listed. After 'members:' all members of your group (including you) should be listed.
If you have not yet done so, finish Task 10 from the Robotics Lab 1. Be sure to test this a couple of times with your Arduino, such that you don't waste time debugging this during the second and third lab.
In 'race_ir.py' implement a function to decode the two signal values from the Int32. Take a look at the Arduino program to learn how they are encoded. Publish the two sensor values on two different topics. See the Publisher and Subscriber Tutorial about how to implement a publisher in ROS.
For this and the following tasks you can use the ros bagfile provided here. You can replay the bagfile using this command:
rosbag play -l robot2017.bag
The '-l' will loop the replay. Use 'rosbag info robot2017.bag' to get some information about the bag file. Replaying the bagfile will publish the 'ir_data' messages, such that you can test your program. This is also very useful for the following tasks.
In 'race_ir.py' publish the gathered range values as a sensor_msgs/LaserScan message. Make a screenshot of rviz showing the laser message, name it "rviz_scan.png" and save it in the 'Robotics Lab Code' repo.
In 'race_ir.py' implement a function to determine the control output send to the robot. This is your main task. You might want to implement a classical AI apporach (detect cones (e.g. jump-edge detection), find a (optimal) path between the cones, follow that path) or a behavior based approach. Be sure to check in the latest version of the race program.
Additionally implement a function that stops the robot if any of the 3 bumpers in front of the robot is pressed. Also implement that, if the robot is stopped because of a bumper activation, the robot resumes motion if the button "b0" is pressed.
Bonus Task 7
This bonus task is optional. If you succeed in the robotics lab 3 you will get 20% extra points for the robotics lab section.
Your task is to use the "laser" data created in Task 4 and feed it into one of the available ROS mapping algorithms. Good chices might be Gmapping, Hector SLAM or Google Cartographer. They all have tutorials and documentation, still Gmapping might be easiest to use and Google Cartographer the most complex. Show a live mapping run to Prof. Schwertfeger during lab 3 to receive the bonus points.