Ben Katz / SPIne

Dependencies:   mbed-dev_spine

Fork of Teleop_Controller by Ben Katz

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers leg_message.h Source File

leg_message.h

00001 #ifndef _leg_message
00002 #define _leg_message
00003 
00004 #include <stdint.h>
00005 
00006 // 60 bytes
00007 // 30 16-bit words
00008 struct spi_data_t
00009 {
00010     float q_abad[2];
00011     float q_hip[2];
00012     float q_knee[2];
00013     float qd_abad[2];
00014     float qd_hip[2];
00015     float qd_knee[2];
00016     int32_t flags[2];
00017     int32_t checksum;
00018 };
00019 
00020 // 132 bytes
00021 // 66 16-bit words
00022 struct spi_command_t
00023 {
00024     float q_des_abad[2];
00025     float q_des_hip[2];
00026     float q_des_knee[2];
00027     float qd_des_abad[2];
00028     float qd_des_hip[2];
00029     float qd_des_knee[2];
00030     float kp_abad[2];
00031     float kp_hip[2];
00032     float kp_knee[2];
00033     float kd_abad[2];
00034     float kd_hip[2];
00035     float kd_knee[2];
00036     float tau_abad_ff[2];
00037     float tau_hip_ff[2];
00038     float tau_knee_ff[2];
00039     int32_t flags[2];
00040     int32_t checksum;
00041 };
00042 
00043 
00044 
00045 struct joint_control{
00046     float p_des, v_des, kp, kd, t_ff;
00047     };
00048     
00049 struct joint_state{
00050     float p, v, t;
00051     };
00052     
00053 struct leg_state{
00054     joint_state a, h, k;
00055     };
00056 struct leg_control{
00057     joint_control a, h, k;
00058     }
00059     ;
00060 #endif