Skip to content

Commit

Permalink
[Spinal][Servo] resize the servo message as same as maximum servo num.
Browse files Browse the repository at this point in the history
  • Loading branch information
sugihara-16 committed May 15, 2024
1 parent 7c147cb commit ae4e197
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ void DirectServo::init(UART_HandleTypeDef* huart, ros::NodeHandle* nh, osMutexI
nh_->advertiseService(servo_config_srv_);

//temp
servo_state_msg_.servos_length = 4;
servo_state_msg_.servos = new spinal::ServoState[4];
servo_torque_state_msg_.torque_enable_length = 4;
servo_torque_state_msg_.torque_enable = new uint8_t[4];
servo_state_msg_.servos_length = MAX_SERVO_NUM;
servo_state_msg_.servos = new spinal::ServoState[MAX_SERVO_NUM];
servo_torque_state_msg_.torque_enable_length = MAX_SERVO_NUM;
servo_torque_state_msg_.torque_enable = new uint8_t[MAX_SERVO_NUM];

servo_handler_.init(huart, mutex);

Expand Down

0 comments on commit ae4e197

Please sign in to comment.