mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-23 17:08:15 +08:00
expose motor_dir
This commit is contained in:
@@ -137,6 +137,7 @@ const Endpoint endpoints[] = {
|
||||
Endpoint::make_property("pll_ki", &motors[0].encoder.pll_ki),
|
||||
Endpoint::make_property("encoder_offset", &motors[0].encoder.encoder_offset),
|
||||
Endpoint::make_property("encoder_state", &motors[0].encoder.encoder_state),
|
||||
Endpoint::make_property("motor_dir", &motors[0].encoder.motor_dir),
|
||||
Endpoint::close_tree(),
|
||||
Endpoint::make_function("set_pos_setpoint", &motors_0_set_pos_setpoint_func),
|
||||
Endpoint::make_property("pos_setpoint", &motors[0].set_pos_setpoint_args.pos_setpoint),
|
||||
@@ -189,8 +190,9 @@ const Endpoint endpoints[] = {
|
||||
Endpoint::make_property("pll_vel", &motors[1].encoder.pll_vel),
|
||||
Endpoint::make_property("pll_kp", &motors[1].encoder.pll_kp),
|
||||
Endpoint::make_property("pll_ki", &motors[1].encoder.pll_ki),
|
||||
Endpoint::make_property("encoder_offset", reinterpret_cast<int32_t*>(&motors[1].encoder.encoder_offset)),
|
||||
Endpoint::make_property("encoder_state", reinterpret_cast<int32_t*>(&motors[1].encoder.encoder_state)),
|
||||
Endpoint::make_property("encoder_offset", &motors[1].encoder.encoder_offset),
|
||||
Endpoint::make_property("encoder_state", &motors[1].encoder.encoder_state),
|
||||
Endpoint::make_property("motor_dir", &motors[1].encoder.motor_dir),
|
||||
Endpoint::close_tree(),
|
||||
Endpoint::make_function("set_pos_setpoint", &motors_1_set_pos_setpoint_func),
|
||||
Endpoint::make_property("pos_setpoint", &motors[1].set_pos_setpoint_args.pos_setpoint),
|
||||
|
||||
@@ -117,7 +117,7 @@ typedef struct {
|
||||
int encoder_cpr;
|
||||
int32_t encoder_offset;
|
||||
int32_t encoder_state;
|
||||
int motor_dir; // 1/-1 for fwd/rev alignment to encoder.
|
||||
int32_t motor_dir; // 1/-1 for fwd/rev alignment to encoder.
|
||||
float phase;
|
||||
float pll_pos;
|
||||
float pll_vel;
|
||||
|
||||
Reference in New Issue
Block a user