From ae4e197afe39e1b7f8d3a15fdfdf58a604d37ea6 Mon Sep 17 00:00:00 2001 From: Junichiro Sugihara Date: Wed, 15 May 2024 21:51:00 +0900 Subject: [PATCH] [Spinal][Servo] resize the servo message as same as maximum servo num. --- .../spinal/mcu_project/lib/Jsk_Lib/servo/servo.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aerial_robot_nerve/spinal/mcu_project/lib/Jsk_Lib/servo/servo.cpp b/aerial_robot_nerve/spinal/mcu_project/lib/Jsk_Lib/servo/servo.cpp index 5a15daebb..18e1f8c68 100644 --- a/aerial_robot_nerve/spinal/mcu_project/lib/Jsk_Lib/servo/servo.cpp +++ b/aerial_robot_nerve/spinal/mcu_project/lib/Jsk_Lib/servo/servo.cpp @@ -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);