Robotics StackExchange | Archived questions

getGlobalLinkTransform("r_tcp") gives different results when in nodelet

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: robotstate::RobotState armCurrentState = *armMoveGroup.getCurrentState(); armCurrentState.setToDefaultValues(armCurrentState.getJointModelGroup("rarm"),"home"); armMoveGroup.setJointValueTarget(armCurrentState); success = armMoveGroup.plan(myplan); armMoveGroup.execute(myplan); 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?

Asked by davevh on 2016-10-09 10:43:40 UTC

Comments

I've never heard of someone using http://wiki.ros.org/nodelet with MoveIt! - that's impressive and I have no experience with nodelets

Asked by Dave Coleman on 2016-10-31 11:35:25 UTC

Answers