Incorrect/unexpected behavior from Trac-IK with calls to moveit::core::RobotState::setFromIK
I just switched to Melodic from Kinetic (yay!) and some of our existing code base started generating infeasible trajectories (nooo!). Upon further inspection it seems that RobotState's setFromIK was returning consecutive IK solves (of a Cartesian trajectory) with joint configuration flips (e.g., elbow, wrist, etc.). Multiple runs with the SAME trajectory sometimes fails / sometime passes. The flow of the trajectory IK routine is as follows:
- seed joint state with an initial posture
- loop through all Cartesian trajectory points with consecutive calls to setFromIK and save resulting joint positions
The code operates under the assumption that subsequent calls to setFromIK use the previous result as a seed (this has worked always in the past). I also tried explicitly seeding on every loop iteration with setVariablePositions (vs implicitly using the previous solution) with the same random flip results.
Switching to KDL from Trac-IK, however, resolves the issue. With that in mind, it seems to me that somehow either the current state is not making it as a seed to Trac-IK calls, it is being ignored by Trac-IK, or the wrong result is being selected. I don't know enough about the actual plugin communication/functionality to tell what exactly the issue is.
Thoughts? Anyone else seeing this? Can anyone offer insight or some direction to continue my debugging?
Follow-up posted at https://github.com/ros-planning/movei...