## Re: [Playerstage-users] segwaryrmp driver and odometry for RMP100

 Re: [Playerstage-users] segwaryrmp driver and odometry for RMP100 From: Brian Gerkey - 2005-10-31 18:44:46 ```On Oct 26, 2005, at 7:37 PM, Jingshen Jimmy Zhang wrote: > > I'm working on modifying the segwayrmp driver for an RMP100 (I > think the original driver was written for an RMP 200?). The CAN > communication protocol seems to match up according to the rmp100 > manual I have, but odometry calculations in Player's segwayrmp > driver are off (1.2meters reported for 1meter). Looking at the file > 'rmp_frame.h', which contains the odometry constants, I noticed > that the wheel separation for my RMP100 is shorter (.47m versus . > 54) and I don't understand where the value for ' > RMP_COUNT_PER_MM_PER_S' comes from. Since the RMP is smaller, it > would make sense for odometry to overestimate the distance > traveled. Can anyone point me in the right direction toward > calibrating the odometry? Thanks. > hi Jimmy, I just had a quick look through the code (segwayrmp.cc). Regarding pose reporting: - The robot reports its total linear travel distance in counts; this value is divided by RMP_COUNT_PER_M to get meters traveled. - The robot reports its total angular travel distance in counts; this value is divided by RMP_COUNT_PER_REV then multiplied by 360 to get degrees rotated. Differences between consecutive values for these data are used in a first-order odometry integration model to produce the robot's (x,y,yaw) pose. Regarding velocity reporting: - The robot reports left and right wheel speeds, in counts; the values are averaged then divided by RMP_COUNT_PER_M_PER_S to get the robot's current forward velocity, in meters / second. - The robot also independently reports yaw velocity (from the IMU?), in counts; this value is divided by RMP_COUNT_PER_DEG_PER_S to get the robot's current yaw velocity, in degrees / second. Regarding velocity commands: - The robot accepts x and yaw velocity targets, both in counts. The commanded Player x speed, in mm / sec, is multiplied by RMP_COUNT_PER_MM_PER_S, and the commanded Player yaw speed, in deg / sec, is multiplied by RMP_COUNT_PER_DEG_PER_S. So you need to determine these values for your robot: - RMP_COUNT_PER_M - RMP_COUNT_PER_REV - RMP_COUNT_PER_M_PER_S - RMP_COUNT_PER_DEG_PER_S - RMP_COUNT_PER_MM_PER_S The wheel separation is not used when accessing the segwayrmp via the position interface (interestingly, when using the position3d interface, the yaw velocity is calculated from the left and right wheel velocities and the wheel separation, rather than from the IMU- reported yaw velocity). I can't explain the disparity between RMP_COUNT_PER_M_PER_S and RMP_COUNT_PER_MM_PER_S; it certainly seems like you should be able to multiply the latter by 1000 to get the former, but it doesn't quite work out. It should be possible to restructure these constants to isolate the wheel diameter, which is probably the only thing that changes between the larger and smaller robots (assuming that they use the same motors and encoders). Then only one number would have to be set, and it could easily done from the configuration file (or automatically if the robot reports its type somehow to the driver). One other gotcha: the robot's rectangular footprint is hardcoded as 0.508 x 0.610 (look for GET_GEOM in the code). This should also be variable. It's not used in the odometry calculations, but it is reported to anybody who asks for the robot's geometry, such as playerv. brian. > -->from original ../rmp/rmp_frame.h > ---------------------------------------------------------------------- > ------------ > #define RMP_COUNT_PER_M 33215 > #define RMP_COUNT_PER_DEG 7.8 > #define RMP_COUNT_PER_M_PER_S 332 > #define RMP_COUNT_PER_DEG_PER_S 7.8 > #define RMP_COUNT_PER_MM_PER_S 0.32882963 > #define RMP_COUNT_PER_DEG_PER_SS 7.8 > #define RMP_COUNT_PER_REV 112644 > > #define RMP_MAX_TRANS_VEL_MM_S 3576 > #define RMP_MAX_ROT_VEL_DEG_S 18 // from rmi_demo: > 1300*0.013805056 > #define RMP_MAX_TRANS_VEL_COUNT 1176 > #define RMP_MAX_ROT_VEL_COUNT 1024 > > #define RMP_GEOM_WHEEL_SEP 0.54 //originally .54meters... > ---------------------------------------------------------------------- > -------------- ```

 [Playerstage-users] segwaryrmp driver and odometry for RMP100 From: Jingshen Jimmy Zhang - 2005-10-27 02:38:07 ```Hi~ I'm working on modifying the segwayrmp driver for an RMP100 (I think the original driver was written for an RMP 200?). The CAN communication protocol seems to match up according to the rmp100 manual I have, but odometry calculations in Player's segwayrmp driver are off (1.2meters reported for 1meter). Looking at the file 'rmp_frame.h', which contains the odometry constants, I noticed that the wheel separation for my RMP100 is shorter (.47m versus .54) and I don't understand where the value for ' RMP_COUNT_PER_MM_PER_S' comes from. Since the RMP is smaller, it would make sense for odometry to overestimate the distance traveled. Can anyone point me in the right direction toward calibrating the odometry? Thanks. Jimmy -->from original ../rmp/rmp_frame.h ---------------------------------------------------------------------------------- #define RMP_COUNT_PER_M 33215 #define RMP_COUNT_PER_DEG 7.8 #define RMP_COUNT_PER_M_PER_S 332 #define RMP_COUNT_PER_DEG_PER_S 7.8 #define RMP_COUNT_PER_MM_PER_S 0.32882963 #define RMP_COUNT_PER_DEG_PER_SS 7.8 #define RMP_COUNT_PER_REV 112644 #define RMP_MAX_TRANS_VEL_MM_S 3576 #define RMP_MAX_ROT_VEL_DEG_S 18 // from rmi_demo: 1300*0.013805056 #define RMP_MAX_TRANS_VEL_COUNT 1176 #define RMP_MAX_ROT_VEL_COUNT 1024 #define RMP_GEOM_WHEEL_SEP 0.54 //originally .54meters... ------------------------------------------------------------------------------------ ```
 Re: [Playerstage-users] segwaryrmp driver and odometry for RMP100 From: Brian Gerkey - 2005-10-31 18:44:46 ```On Oct 26, 2005, at 7:37 PM, Jingshen Jimmy Zhang wrote: > > I'm working on modifying the segwayrmp driver for an RMP100 (I > think the original driver was written for an RMP 200?). The CAN > communication protocol seems to match up according to the rmp100 > manual I have, but odometry calculations in Player's segwayrmp > driver are off (1.2meters reported for 1meter). Looking at the file > 'rmp_frame.h', which contains the odometry constants, I noticed > that the wheel separation for my RMP100 is shorter (.47m versus . > 54) and I don't understand where the value for ' > RMP_COUNT_PER_MM_PER_S' comes from. Since the RMP is smaller, it > would make sense for odometry to overestimate the distance > traveled. Can anyone point me in the right direction toward > calibrating the odometry? Thanks. > hi Jimmy, I just had a quick look through the code (segwayrmp.cc). Regarding pose reporting: - The robot reports its total linear travel distance in counts; this value is divided by RMP_COUNT_PER_M to get meters traveled. - The robot reports its total angular travel distance in counts; this value is divided by RMP_COUNT_PER_REV then multiplied by 360 to get degrees rotated. Differences between consecutive values for these data are used in a first-order odometry integration model to produce the robot's (x,y,yaw) pose. Regarding velocity reporting: - The robot reports left and right wheel speeds, in counts; the values are averaged then divided by RMP_COUNT_PER_M_PER_S to get the robot's current forward velocity, in meters / second. - The robot also independently reports yaw velocity (from the IMU?), in counts; this value is divided by RMP_COUNT_PER_DEG_PER_S to get the robot's current yaw velocity, in degrees / second. Regarding velocity commands: - The robot accepts x and yaw velocity targets, both in counts. The commanded Player x speed, in mm / sec, is multiplied by RMP_COUNT_PER_MM_PER_S, and the commanded Player yaw speed, in deg / sec, is multiplied by RMP_COUNT_PER_DEG_PER_S. So you need to determine these values for your robot: - RMP_COUNT_PER_M - RMP_COUNT_PER_REV - RMP_COUNT_PER_M_PER_S - RMP_COUNT_PER_DEG_PER_S - RMP_COUNT_PER_MM_PER_S The wheel separation is not used when accessing the segwayrmp via the position interface (interestingly, when using the position3d interface, the yaw velocity is calculated from the left and right wheel velocities and the wheel separation, rather than from the IMU- reported yaw velocity). I can't explain the disparity between RMP_COUNT_PER_M_PER_S and RMP_COUNT_PER_MM_PER_S; it certainly seems like you should be able to multiply the latter by 1000 to get the former, but it doesn't quite work out. It should be possible to restructure these constants to isolate the wheel diameter, which is probably the only thing that changes between the larger and smaller robots (assuming that they use the same motors and encoders). Then only one number would have to be set, and it could easily done from the configuration file (or automatically if the robot reports its type somehow to the driver). One other gotcha: the robot's rectangular footprint is hardcoded as 0.508 x 0.610 (look for GET_GEOM in the code). This should also be variable. It's not used in the odometry calculations, but it is reported to anybody who asks for the robot's geometry, such as playerv. brian. > -->from original ../rmp/rmp_frame.h > ---------------------------------------------------------------------- > ------------ > #define RMP_COUNT_PER_M 33215 > #define RMP_COUNT_PER_DEG 7.8 > #define RMP_COUNT_PER_M_PER_S 332 > #define RMP_COUNT_PER_DEG_PER_S 7.8 > #define RMP_COUNT_PER_MM_PER_S 0.32882963 > #define RMP_COUNT_PER_DEG_PER_SS 7.8 > #define RMP_COUNT_PER_REV 112644 > > #define RMP_MAX_TRANS_VEL_MM_S 3576 > #define RMP_MAX_ROT_VEL_DEG_S 18 // from rmi_demo: > 1300*0.013805056 > #define RMP_MAX_TRANS_VEL_COUNT 1176 > #define RMP_MAX_ROT_VEL_COUNT 1024 > > #define RMP_GEOM_WHEEL_SEP 0.54 //originally .54meters... > ---------------------------------------------------------------------- > -------------- ```