23 #define RMP_CAN_ID_SHUTDOWN 0x0412 24 #define RMP_CAN_ID_COMMAND 0x0413 25 #define RMP_CAN_ID_MSG1 0x0400 26 #define RMP_CAN_ID_MSG2 0x0401 27 #define RMP_CAN_ID_MSG3 0x0402 28 #define RMP_CAN_ID_MSG4 0x0403 29 #define RMP_CAN_ID_MSG5 0x0404 30 #define RMP_CAN_ID_MSG6 0x0405 31 #define RMP_CAN_ID_MSG7 0x0406 32 #define RMP_CAN_ID_MSG8 0x0407 34 #define RMP_CAN_CMD_NONE 0 35 #define RMP_CAN_CMD_MAX_VEL 10 36 #define RMP_CAN_CMD_MAX_ACCL 11 37 #define RMP_CAN_CMD_MAX_TURN 12 38 #define RMP_CAN_CMD_GAIN_SCHED 13 39 #define RMP_CAN_CMD_CURR_LIMIT 14 40 #define RMP_CAN_CMD_RST_INT 50 42 #define RMP_CAN_RST_RIGHT 0x01 43 #define RMP_CAN_RST_LEFT 0x02 44 #define RMP_CAN_RST_YAW 0x04 45 #define RMP_CAN_RST_FOREAFT 0x08 46 #define RMP_CAN_RST_ALL (RMP_CAN_RST_RIGHT | \ 51 #define RMP_COUNT_PER_M 33215 52 #define RMP_COUNT_PER_DEG 7.8 53 #define RMP_COUNT_PER_M_PER_S 332 54 #define RMP_COUNT_PER_DEG_PER_S 7.8 55 #define RMP_COUNT_PER_MM_PER_S 0.32882963 56 #define RMP_COUNT_PER_DEG_PER_SS 7.8 57 #define RMP_COUNT_PER_REV 112644 59 #define RMP_MAX_TRANS_VEL_MM_S 3576 60 #define RMP_MAX_ROT_VEL_DEG_S 18 // from rmi_demo: 1300*0.013805056 61 #define RMP_MAX_TRANS_VEL_COUNT 1176 62 #define RMP_MAX_ROT_VEL_COUNT 1024 64 #define RMP_GEOM_WHEEL_SEP 0.54 87 int16_t gain_schedule;
89 uint16_t powerbase_battery;
102 bool IsReady() {
return ready == 0xFF; }
117 rmp_frame_t::AddPacket(
const CanPacket &pkt)
123 case RMP_CAN_ID_MSG1:
127 case RMP_CAN_ID_MSG2:
128 pitch = pkt.GetSlot(0);
129 pitch_dot = pkt.GetSlot(1);
130 roll = pkt.GetSlot(2);
131 roll_dot = pkt.GetSlot(3);
134 case RMP_CAN_ID_MSG3:
135 left_dot = (int16_t) pkt.GetSlot(0);
136 right_dot = (int16_t) pkt.GetSlot(1);
137 yaw_dot = (int16_t) pkt.GetSlot(2);
138 frames = pkt.GetSlot(3);
141 case RMP_CAN_ID_MSG4:
142 left = (uint32_t)(((uint32_t)pkt.GetSlot(1) << 16) |
143 (uint32_t)pkt.GetSlot(0));
144 right = (uint32_t)(((uint32_t)pkt.GetSlot(3) << 16) |
145 (uint32_t)pkt.GetSlot(2));
148 case RMP_CAN_ID_MSG5:
149 foreaft = (uint32_t)(((uint32_t)pkt.GetSlot(1) << 16) |
150 (uint32_t)pkt.GetSlot(0));
151 yaw = (uint32_t)(((uint32_t)pkt.GetSlot(3) << 16) |
152 (uint32_t)pkt.GetSlot(2));
154 case RMP_CAN_ID_MSG6:
155 left_torque = (int16_t) pkt.GetSlot(0);
156 right_torque = (int16_t) pkt.GetSlot(1);
159 case RMP_CAN_ID_MSG7:
160 op_mode = (int16_t) pkt.GetSlot(0);
161 gain_schedule = (int16_t) pkt.GetSlot(1);
162 ui_battery = (uint16_t) pkt.GetSlot(2);
163 powerbase_battery = (uint16_t) pkt.GetSlot(3);
166 case RMP_CAN_ID_MSG8:
167 rec_speed = (int16_t) pkt.GetSlot(0);
168 rec_turn = (int16_t) pkt.GetSlot(1);
177 ready |= (1 << (pkt.id & 0xFF));
Definition: rmp_frame.h:67