Randy,
Alex already gave excellent PID tuning instructions.
On top of monitoring the physical behaviour of your motors, I
recommend monitoring the actual PID outputs directly, through one of
the following:
(a) via ros_arduino_bridge (with Twist commands and changing the PID
parameters in the config file),
using rqt_plot to display /cmd_vel/linear/x, /cmd_vel/angular/z,
/odom/twist/twist/linear/x and /odom/twist/twist/angular/z
Example Twist commands:
$rostopic pub -r 15 /cmd_vel geometry_msgs/Twist '{linear: {x: 0.07,
y: 0, z: 0}, angular: {x: 0, y: 0, z: 0}}'
$rostopic pub -r 15 /cmd_vel geometry_msgs/Twist '{linear: {x: 0.2, y:
0, z: 0}, angular: {x: 0, y: 0, z: 0}}'
$rostopic pub -r 15 /cmd_vel geometry_msgs/Twist '{linear: {x: 0, y:
0, z: 0}, angular: {x: 0, y: 0, z: 0.6}}'
$rostopic pub -r 15 /cmd_vel geometry_msgs/Twist '{linear: {x: 0, y:
0, z: 0}, angular: {x: 0, y: 0, z: 1.0}}'
(b) directly on the arduino code by adding Serial.print() statements
in the PID controller code,
to display input/output while sending "u" commands to change PID
parameters and "m" motor commands.
I prefer (b), as it allows me to directly see the raw PID Input and
Outputs, rather than the input/output speeds.
(Note: if you are taking this route, do NOT forget to disable the
additional output before using the ros_arduino_bridge; otherwise it
will not work).
Also, in case you go for (a), it is useful to be able to dynamically
set the PID parameters using dynamic_configure. I wrote some code for
that at some point in time (see [1]), but never bothered merging that
upstream.
Happy tuning!
Kristof
[1]
https://github.com/KristofRobot/ros_arduino_bridge/commit/5df1f823b412b5dd355c6e9e61d93be44cf52ae3