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

asked 2016-10-09 10:43:40 -0500

davevh gravatar image

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?

edit retag flag offensive close merge delete


I've never heard of someone using with MoveIt! - that's impressive and I have no experience with nodelets

Dave Coleman gravatar image Dave Coleman  ( 2016-10-31 11:35:25 -0500 )edit