Updated for checksum
Diff: leg_message.h
- Revision:
- 15:56a06363a698
- Parent:
- 13:87e7ce883f6a
--- a/leg_message.h Fri Feb 04 22:38:23 2022 +0000 +++ b/leg_message.h Wed Sep 28 16:32:46 2022 +0000 @@ -3,43 +3,27 @@ #include <stdint.h> -// 31*4 bytes = 124 8-bit words -// 31 32-bit numbers +// 9*2 bytes = 18 16-bit words 36 8-bit words +// 9 32-bit numbers struct spi_data_t { - float q_1s[3]; - float q_2s[3]; - float q_3s[3]; - float qd_1s[3]; - float qd_2s[3]; - float qd_3s[3]; - float tau_1s[3]; - float tau_2s[3]; - float tau_3s[3]; - uint32_t flags[3]; + float q_1s[2]; + float qd_1s[2]; + float tau_1s[2]; + int32_t flags[2]; uint32_t checksum; }; -// 49*4 bytes = 196 8-bit words -// 49 32-bit numbers +// 13*2 bytes = 26 16-bit words 52 8-bit words +// 13 32-bit numbers struct spi_command_t { - float q_des_1s[3]; //first motor on each can bus 0-can1, 1-can2, 2-can3 - float q_des_2s[3]; - float q_des_3s[3]; - float qd_des_1s[3]; - float qd_des_2s[3]; - float qd_des_3s[3]; - float kp_1s[3]; - float kp_2s[3]; - float kp_3s[3]; - float kd_1s[3]; - float kd_2s[3]; - float kd_3s[3]; - float tau_1s_ff[3]; - float tau_2s_ff[3]; - float tau_3s_ff[3]; - uint32_t flags[3]; + float q_des_1s[2]; //first motor on each can bus 0-can1, 1-can2, 2-can3 + float qd_des_1s[2]; + float kp_1s[2]; + float kd_1s[2]; + float tau_1s_ff[2]; + int32_t flags[2]; uint32_t checksum; }; @@ -54,10 +38,10 @@ }; struct grouped_act_state{ - joint_state a1, a2, a3; //removed a2 and a3 + joint_state a1; //removed a2 and a3 }; struct grouped_act_control{ - joint_control a1, a2, a3; + joint_control a1; } ; #endif \ No newline at end of file