You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.6 KiB
51 lines
1.6 KiB
#pragma once
|
|
#include <stdint.h>
|
|
|
|
namespace iflytop {
|
|
using namespace std;
|
|
|
|
#define STATE_INDEX(type, subconfigindex) (type + subconfigindex)
|
|
typedef enum {
|
|
|
|
/**
|
|
* @brief 电机状态
|
|
*
|
|
* 0 -> 100 模块通用状态
|
|
* 100 -> 199 电机1状态
|
|
* 100 -> 299 电机2状态
|
|
* 1000 -> 1100 xy电机状态
|
|
*
|
|
*
|
|
*/
|
|
|
|
kstate_module_status = STATE_INDEX(0, 0), // 0idle,1busy,2error
|
|
kstate_module_errorcode = STATE_INDEX(0, 1), //
|
|
|
|
kstate_motor1_move = STATE_INDEX(100, 0), //
|
|
kstate_motor1_enable = STATE_INDEX(100, 1), //
|
|
kstate_motor1_current = STATE_INDEX(100, 2), //
|
|
kstate_motor1_vel = STATE_INDEX(100, 3), //
|
|
kstate_motor1_pos = STATE_INDEX(100, 4), //
|
|
kstate_motor1_temperature = STATE_INDEX(100, 5), //
|
|
kstate_motor1_dpos = STATE_INDEX(100, 6), //
|
|
|
|
kstate_motor2_move = STATE_INDEX(110, 0), //
|
|
kstate_motor2_enable = STATE_INDEX(110, 1), //
|
|
kstate_motor2_current = STATE_INDEX(110, 2), //
|
|
kstate_motor2_vel = STATE_INDEX(110, 3), //
|
|
kstate_motor2_pos = STATE_INDEX(110, 4), //
|
|
kstate_motor2_temperature = STATE_INDEX(110, 5), //
|
|
kstate_motor2_dpos = STATE_INDEX(110, 6), //
|
|
|
|
kstate_xyrobot_move = STATE_INDEX(1000, 0), //
|
|
kstate_xyrobot_enable = STATE_INDEX(1000, 1), //
|
|
kstate_xyrobot_x_pos = STATE_INDEX(1000, 2), //
|
|
kstate_xyrobot_y_pos = STATE_INDEX(1000, 3), //
|
|
kstate_xyrobot_z_pos = STATE_INDEX(1000, 4), //
|
|
kstate_xyrobot_x_dpos = STATE_INDEX(1000, 5), //
|
|
kstate_xyrobot_y_dpos = STATE_INDEX(1000, 6), //
|
|
kstate_xyrobot_z_dpos = STATE_INDEX(1000, 7), //
|
|
|
|
} state_index_t;
|
|
|
|
} // namespace iflytop
|