For this project you will create a ROS package named "approach" that will contain code to move the robot so that it maintains a desired distance to the nearest object in front of it.
Your package must contain a python-based ROS node named approach
that meets the following specifications:
/scan
topic in order to determine
the distance to the nearest object.
/approach/dist
topic to
determine the current goal distance. The message type for this
topic is Float32
.
/mobile_base/commands/velocity
. The PID class
should be used to control the velocity. You must also enforce a
maximum velocity (maybe .3 meters/second?) to avoid toppling the
robot.
/approach/pid_error
. See below for the
appropriate message type. Both the error and twist messages should be published at a rate of 10HZ.
You must also create two launch files:
approach.launch
This launch file should start the
Kinect and start the approach node.approach_plot.launch
This launch file should do everything
that approach.launch
does as well as bring up
an rqt_plot
node to display all three error terms.roslaunch approach approach.launchor
roslaunch approach approach_plot.launchYour launch file does not need to bring up the Turtlebot. You may assume that minimal.launch has already been run.
I'm providing the following code to get you started:
You will submit this project the same way you submitted Lab3. I will checkout your code as follows:
$ svn checkout https://svn.cs.jmu.edu/spragunr/GROUP/submit/approach/ cs480_ws/approach