diff --git a/tm_driver/src/tm_robot_state.cpp b/tm_driver/src/tm_robot_state.cpp index 29317fa..54125ed 100644 --- a/tm_driver/src/tm_robot_state.cpp +++ b/tm_driver/src/tm_robot_state.cpp @@ -135,9 +135,12 @@ TmRobotState::~TmRobotState() void TmRobotState::set_joint_states(const std::vector &pos, const std::vector &vel, const std::vector &tor) { - joint_angle() = pos; - joint_speed() = vel; - joint_torque() = tor; + for (size_t i = 0; i < 6; ++i) { + tmRobotStateDataFromEthernet.joint_angle[i] = pos[i] * (180.0 / M_PI); + tmRobotStateDataFromEthernet.joint_speed[i] = vel[i]; + tmRobotStateDataFromEthernet.joint_torque[i] = tor[i]; + } + multiThreadCache.set_catch_data(tmRobotStateDataFromEthernet); } std::vector TmRobotState::mtx_tcp_force_vec()