I launch identical code as an executable node and as a nodelet and get different results when I execute the following lines after moving and arm to the home position:
const Eigen::Affine3d &affine = sideCurrentState.getGlobalLinkTransform("r_tcp");
std::cout << "\n sideCurrentState.getGlobalLinkTransform\n" << affine.translation() << std::endl;
The code to move the arm is:
robot_state::RobotState armCurrentState = *armMoveGroup_.getCurrentState();
armCurrentState.setToDefaultValues(armCurrentState.getJointModelGroup("r_arm"),"home");
armMoveGroup_.setJointValueTarget(armCurrentState);
success = armMoveGroup_.plan(my_plan);
armMoveGroup_.execute(my_plan);
armMoveGroup_.setStartState(armCurrentState);
When running as an executable node, I get the correct values from getGlobalLinkTransform(...) after the arm is moved using the code above. When running as a nodelet, I get the values as if the arm didn't move at all. I know the arm moved in both cases because I can see the arm move in Gazebo before the getGlobalLinkTransform(...) line gets executed. What gives?
↧