That is the github root of ROSbot Dave.
$ more ~/Dexter/gpg3_config.json
{"wheel-diameter": 66.77, "wheel-base-width": 106.14, "ticks": 16, "motor_gear_ratio": 120}
Notice my bot has 16 ticks - “Classic” GoPiGo3s have 6 ticks. Also my effective wheel diameter is pretty close to the default 66.5, but the wheel base is 11mm different than the default 117 mm.
Because ROSbot Dave has no desktop installed, I couldn’t use the DI desktop control panel app to determine the correct wheel diameter, wheel base, (and encoder ticks), and because the version of gopigo3.py at the time I was starting ROSbot did not automatically generate a gpg_config.json with the correct encoder ticks, I created the file manually, (and saved it off to “rosbot-on-gopigo3/configs/” so that it would not get lost when any update wiped out the ~/Dexter directories. The update management of any existing gpg_config.json file would be a merge nightmare for ModRobotics.)
BTW, the ros-gopigo3/gopigo3_node (and HandsOnROS) use a very hard coded wheel diameter and wheel base (as in Class Variable with no ROS parameter) which makes the published odometry and pose slightly wrong when a bot has an effective wheel diameter or effective wheel base different than the defaults. (The flat contact area of the tires, any motor shaft tilt, and radius variation all cause the actual contact points to change the momentary wheel base. The effective wheel base is the value that makes the pose angle and commanded angle best match the actual angle turned. The effective wheel diameter is the value that makes the odometry and commanded distance best match the actual distance traveled.)
The automatic creation of ~/Dexter/gpg_config.json with the (probably) correct encoder ticks and default wheel base and wheel diameter values, and the use of the file by gopigo3.py.GoPiGo3() class is in this latest update. I have written my ROS2 gopigo3_node to set the WIDTH and CIRCUMFERENCE “constants” in the class initialization instead of in the class definition to make the ROS2 node aware if the user has configured the wheel diameter or wheel base.
$ ros2 run ros2_gopigo3_node gopigo3_node
==================================
GoPiGo3 info:
Manufacturer : Dexter Industries
Board : GoPiGo3
Serial Number : 56ECD67E5152415447202020FF192614
Hardware version: 3.x.x
Firmware version: 1.0.0
GoPiGo3 Configuration:
WHEEL_DIAMETER: 66.770 mm
WHEEL_BASE_WIDTH: 106.140 mm
ENCODER_TICKS_PER_ROTATION: 16 (per one motor revolution)
MOTOR_GEAR_RATIO: 120 (motor revolutions per wheel revolution)
MOTOR_TICKS_PER_DEGREE: 5.333333333333333 (of wheel rotation)
(Using default values or ~/Dexter/gpg3_config.json if present)
Odometry Precision: 0.11 mm
==================================
[INFO] [1626702553.544924216] [gopigo3_node]: ros2_gopigo3_node: created main loop callback at 1 Hz
That Odometry Precision on a “Classic GoPiGo3” works out to 0.29 mm. I have not determined if there is actually any accuracy difference.
I just ran ROSbot Dave approx 42 inches 1.067 meters, and the /odom reported 1.058 meters, so 8mm difference between reported and actual. Turning approximately 360 degrees by eye/hand response gave a reported heading change of -1 degree and visually it looks like it turned about 361 so perhaps 2 degree error. I’ll have to verify my gpg_config.json values.
p.s. A really pedantic developer would add a ROS2 arg “gpg3_config_file” and pass it to GoPiGo3(config_file_path=node.get_arg(“gpg3_config_file”)) or something like that but that will have to remain on the TODO list.