111

Dependencies:   yezhong_main_controller_copy mbed1-dev

Committer:
yezhong
Date:
Thu Nov 19 07:59:28 2020 +0000
Revision:
2:cd74a8cb03b0
Parent:
0:d80c66cb1b3a
Child:
5:2503c88a564f
11

Who changed what in which revision?

UserRevisionLine numberNew contents of line
panzhan 0:d80c66cb1b3a 1 #ifndef _CAN_H
panzhan 0:d80c66cb1b3a 2 #define _CAN_H
panzhan 0:d80c66cb1b3a 3
panzhan 0:d80c66cb1b3a 4 // 头文件
panzhan 0:d80c66cb1b3a 5 #include "mbed.h"
panzhan 0:d80c66cb1b3a 6 #include "math_ops.h"
panzhan 0:d80c66cb1b3a 7 #include "leg_message.h"
panzhan 0:d80c66cb1b3a 8 #include "used_leg_message.h"
panzhan 0:d80c66cb1b3a 9
panzhan 0:d80c66cb1b3a 10
panzhan 0:d80c66cb1b3a 11 // 宏定义
panzhan 0:d80c66cb1b3a 12 #define CAN_ID 0x01 // Master CAN ID
panzhan 0:d80c66cb1b3a 13
panzhan 0:d80c66cb1b3a 14 #define P_MIN -12.5f // Value Limits
panzhan 0:d80c66cb1b3a 15 #define P_MAX 12.5f
panzhan 0:d80c66cb1b3a 16 #define V_MIN -45.0f
panzhan 0:d80c66cb1b3a 17 #define V_MAX 45.0f
panzhan 0:d80c66cb1b3a 18 #define KP_MIN 0.0f
panzhan 0:d80c66cb1b3a 19 #define KP_MAX 500.0f
panzhan 0:d80c66cb1b3a 20 #define KD_MIN 0.0f
panzhan 0:d80c66cb1b3a 21 #define KD_MAX 5.0f
panzhan 0:d80c66cb1b3a 22 #define T_MIN -18.0f
panzhan 0:d80c66cb1b3a 23 #define T_MAX 18.0f // Value Limits
panzhan 0:d80c66cb1b3a 24
panzhan 0:d80c66cb1b3a 25
panzhan 0:d80c66cb1b3a 26 // 对象外部申明
yezhong 2:cd74a8cb03b0 27 extern CAN pf_can, df_can; //设备的外部申明
yezhong 2:cd74a8cb03b0 28 extern CANMessage pf_rxMsg, df_rxMsg; // 主控收到的CAN消息
yezhong 2:cd74a8cb03b0 29 extern CANMessage PF_can, DF_can; // 主控发送的CAN消息
panzhan 0:d80c66cb1b3a 30
panzhan 0:d80c66cb1b3a 31 // 函数外部申明
panzhan 0:d80c66cb1b3a 32 void pack_cmd(CANMessage * msg, joint_control joint);
panzhan 0:d80c66cb1b3a 33 void PackAll();
panzhan 0:d80c66cb1b3a 34 void WriteAll();
yezhong 2:cd74a8cb03b0 35 void unpack_reply(CANMessage msg, ankle_state * ankle);
panzhan 0:d80c66cb1b3a 36
panzhan 0:d80c66cb1b3a 37
panzhan 0:d80c66cb1b3a 38
panzhan 0:d80c66cb1b3a 39 #endif