expose motor_dir

This commit is contained in:
Oskar Weigl
2018-01-26 22:59:21 -08:00
parent aaa5f802de
commit a7c8a85d30
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -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),
+1 -1
View File
@@ -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;