ROS FUN: Dave Is Getting A ROS Odometer

Dave has been a bit neglected since “running” his 1k, but tonight he made progress on a “ROS Odometer”.

I have a GoPiGo3 API wheellog program which runs when Dave powers up that is keeping track of every silly millimeter Dave moves around the house, but a ROSbot needs a ROS Odometer to track travel commanded while under the influence of ROS!

Rather than make the odometer GoPiGo3 specific by subscribing to the GoPiGo3 ROS node’s wheel encoder topic, I wanted to make this “ROS Odometer” log the typical /odom topic published by all ROS bots so this node can track the travel of Dave, or the Create3 robot I am hoping to be allowed to test also.

The program is not logging to a file yet, but the first test tonight proved the ROS Odometer is going to work. I started the odometer, then drove Dave trying to stop after traveling one floor board as best I could. The floor board is 1.065 meters, and the odometer reported 1.073 meters. At this late hour I am taking that as right on and retire for the night.

$ ./run_odometer.sh 
[INFO] [1635994472.930004656] [odometer]: odometry topic subscriber created
started moving
current_point - x: 0.046 y: 0.001 z: 0.000 - moved: 0.002
current_point - x: 0.049 y: 0.001 z: 0.000 - moved: 0.005
current_point - x: 0.052 y: 0.001 z: 0.000 - moved: 0.009
current_point - x: 0.056 y: 0.001 z: 0.000 - moved: 0.013
... (a few brief moves first)

NOW THE TEST RUN:

started moving
current_point - x: 0.048 y: 0.001 z: 0.000 - moved: 0.002
current_point - x: 0.051 y: 0.001 z: 0.000 - moved: 0.006
current_point - x: 0.054 y: 0.001 z: 0.000 - moved: 0.009
current_point - x: 0.058 y: 0.001 z: 0.000 - moved: 0.013
current_point - x: 0.062 y: 0.001 z: 0.000 - moved: 0.017

...
current_point - x: 1.098 y: 0.002 z: 0.000 - moved: 1.052
current_point - x: 1.101 y: 0.002 z: 0.000 - moved: 1.056
current_point - x: 1.104 y: 0.002 z: 0.000 - moved: 1.059
current_point - x: 1.108 y: 0.002 z: 0.000 - moved: 1.062
current_point - x: 1.111 y: 0.002 z: 0.000 - moved: 1.065
current_point - x: 1.114 y: 0.002 z: 0.000 - moved: 1.069
current_point - x: 1.118 y: 0.002 z: 0.000 - moved: 1.072
current_point - x: 1.119 y: 0.002 z: 0.000 - moved: 1.073
current_point - x: 1.119 y: 0.002 z: 0.000 - moved: 1.073 total moved: 1.306
stopped moving
2 Likes