Controlling a Turtlebot using Python

Using the Geany text editor, create a ROS Python node named forward.py. Your node should move the Turtlebot directly forward at a fixed, constant rate of .2 meters per second. (This node will need a publisher object, but you won't need any subscribers.)

Use either the Gazebo simulator or a Turtlebot to test your finished node.

Getting Smarter...

Make a copy of the node you completed above named bumper.py. Modify this file so that it stops forward motion whenever the bumper is depressed. Forward motion should resume when the bumper is released.

Use either the Gazebo simulator or a Turtlebot to test your finished node.

Submit both of your finished nodes through Canvas. Make sure that your submission contains the names of all group members.

Using the /scan Topic (If You Have Time)

Create a new node named wander.py that subscribes to the /scan topic. Instead of waiting until the Turtlebot actually bumps into something, this node should halt forward progress as soon as an object is observed less than one meter in front of the Turtlebot.

Note that the data stored in a LaserScan message will contain NaN readings if obstacles are too close to the sensor. You can check for NaN values using the math.isnan function.

If you are feeling ambitious, modify your wander node so that it rotates to avoid looming obstacles. Your finished node should be able to wander around while avoiding obstacles in the robot's path.