ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
ax12_driver_core::MotorStateList contains an array of ax12_driver_core::MotorState messages. In C++, ROS arrays are converted to C++ std::vector.
To print the motor position of the first MotorState in the array you might use something like:
ROS_INFO("I heard : %d", msg->motor_states[0].position;);
You might want to also check that motor_states vector has at least 1 element :
if (msg->motor_states.size() > 0)
2 | No.2 Revision |
ax12_driver_core::MotorStateList contains an array of ax12_driver_core::MotorState messages. In C++, ROS arrays are converted to C++ std::vector.
To print the motor position of the first MotorState in the array you might use something like:
ROS_INFO("I heard : %d", You might want to also check that motor_states vector has at least 1 element :
if (msg->motor_states.size() >