ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I solved this problem by assuming that the call to kinematic_state was failing and replaced with:
move_group = new moveit::planning_interface::MoveGroupInterface(PLANNING_GROUP);
joint_model_group = move_group->getCurrentState()->getJointModelGroup(PLANNING_GROUP);
const std::vector<std::string>& joint_names = joint_model_group->getVariableNames();
std::vector<double> joint_values;
moveit::core::RobotStatePtr current_state = move_group->getCurrentState();
current_state->copyJointGroupPositions(joint_model_group, joint_values);
for (std::size_t i = 0; i < joint_names.size(); ++i) {
ROS_INFO("Joint %s: %f", joint_names[i].c_str(), joint_values[i]);
}