@@ -243,11 +243,13 @@ std::vector<hardware_interface::StateInterface> URPositionHardwareInterface::exp
243243 state_interfaces.emplace_back (
244244 hardware_interface::StateInterface (tf_prefix + " tcp_pose" , " position.z" , &urcl_tcp_pose_[2 ]));
245245 state_interfaces.emplace_back (
246- hardware_interface::StateInterface (tf_prefix + " tcp_pose" , " orientation.r " , &tcp_orientation_rpy_[ 0 ] ));
246+ hardware_interface::StateInterface (tf_prefix + " tcp_pose" , " orientation.x " , &tcp_rotation_buffer. x ));
247247 state_interfaces.emplace_back (
248- hardware_interface::StateInterface (tf_prefix + " tcp_pose" , " orientation.p " , &tcp_orientation_rpy_[ 1 ] ));
248+ hardware_interface::StateInterface (tf_prefix + " tcp_pose" , " orientation.y " , &tcp_rotation_buffer. y ));
249249 state_interfaces.emplace_back (
250- hardware_interface::StateInterface (tf_prefix + " tcp_pose" , " orientation.y" , &tcp_orientation_rpy_[2 ]));
250+ hardware_interface::StateInterface (tf_prefix + " tcp_pose" , " orientation.z" , &tcp_rotation_buffer.z ));
251+ state_interfaces.emplace_back (
252+ hardware_interface::StateInterface (tf_prefix + " tcp_pose" , " orientation.w" , &tcp_rotation_buffer.w ));
251253
252254 return state_interfaces;
253255}
@@ -802,8 +804,7 @@ void URPositionHardwareInterface::extractToolPose()
802804 } else {
803805 tcp_rotation_quat_.setValue (0.0 , 0.0 , 0.0 , 1.0 ); // default Quaternion is 0,0,0,0 which is invalid
804806 }
805- auto rot_mat = tf2::Matrix3x3 (tcp_rotation_quat_);
806- rot_mat.getRPY (tcp_orientation_rpy_[0 ], tcp_orientation_rpy_[1 ], tcp_orientation_rpy_[2 ]);
807+ tcp_rotation_buffer.set (tcp_rotation_quat_);
807808}
808809
809810hardware_interface::return_type URPositionHardwareInterface::prepare_command_mode_switch (
0 commit comments