-
Notifications
You must be signed in to change notification settings - Fork 118
Trajectory start doesn't match Current Position, when using plan/execute #442
Comments
I had the same problem with a UR10 in both simulation and real robot. |
I sometimes observe a similar behaviour, but with regards to an object being attached or not. As JimmyDaSilva noted, I can increase the likelyhood of this to happen by calling setStartStateToCurrentState() So I call attachObject(...); sleep(5); and then setPoseTarget and plan. Now the planing will happen without considering the attached object (including no collision checking of course). It is also executed without considering the attached object (it does get moved, but there is no collision checking for it) |
In C++ I use the following workaround: const std::string PLANNING_SCENE_SERVICE = "get_planning_scene";
robot_state::RobotState getCurrentRobotState(planning_scene_monitor::PlanningSceneMonitorPtr planning_scene_monitor_)
{
// each time the current state is needed
planning_scene_monitor_->requestPlanningSceneState(PLANNING_SCENE_SERVICE);
planning_scene_monitor::LockedPlanningSceneRW ps(planning_scene_monitor_);
ps->getCurrentStateNonConst().update();
robot_state::RobotState current_state = ps->getCurrentState();
return current_state;
}
planning_scene_monitor::PlanningSceneMonitorPtr planning_scene_monitor_ =
boost::make_shared<planning_scene_monitor::PlanningSceneMonitor>("robot_description"/*, tf_listener_*/);
group.setStartState(getCurrentRobotState(planning_scene_monitor_)); I'm on Indigo btw |
Hi all, I am coming back to using moveit and especially on this issue. It seems that it's been discussed a lot and some modifications have been merged: #407 Unfortunately I am still stuck with this same exact problem: If two successive plans are too close (less than 1sec) it seems that the state update is not made properly and so I see "jumps" at the beginning of the trajectory. I tried:
or Problem goes away if I add a 1 second sleep after the end of the execution; @davetcoleman @isucan @sachinchitta Did you ever face this issue ? Thank you for your help ! PS: Running on Ubuntu 14.04 and Indigo |
We ran into this issue too. I created PR #671 which contains a hot-fix for this problem which ensures that MoveIt! does not start planning on the basis of an outdated RobotState. |
@andreaskoepf Thank you so much. Works great ! |
fix race conditions when updating PlanningScene state, fixes #442
imported Fanuc robot config from ROS industrial imported https://gist.github.com/JeremyZoss/63dfdf24a97c5e6e7d65 from #442
Fixed in #716 et al. |
the use of QDockWidget is not necessary. Using the provided Widget function setAssociatedWidget to add the panel to the display instead. The previous code was incomplete, e.g. the panel was visible when RViz is started with a disabled motion planning display.
When sending back-to-back motion commands to MoveIt (using blocking calls), the trajectory start position should match (approximately) the goal position of the previous move. This works when using the all-in-one
move()
call, but not when using separateplan()
andexecute(plan)
calls. In that case, it seems like the start position is using an outdated representation of the robot state, which lags behind the current robot state.The expected behavior can be coerced using a few workarounds:
MotionPlanRequest
current state to the current joint position reported by MoveItmove()
method instead.I have tested this behavior using both a physical robot (Motoman FS100/SIA-20D) and a "virtual robot" (the ROS-Industrial Industrial_Robot_Simulator), under both groovy and hydro releases.
Steps to Reproduce
Launch any MoveIt package. For example:
Disable any MoveIt RViz planning displays, so that only the current robot state is displayed.
Download the test script from here
Run the test script, using its default configuration
Observe the odd RViz motion and reported error messages. See below for a more detailed explanation.
Test Script Explanation
The test script creates a sequence of joint positions, using fixed-offsets from the current robot position. It's easiest to observe what's happening if the robot starts in a "clean" position (all-zeros, or similar). The script then executes a move to each of the positions, using blocking
plan
andexecute(plan)
calls. The planned trajectory is compared against both thecurrent_joint_values
(as reported by MoveIt) and the target goal position, to verify the start/end positions. If the values differ, an error message is reported.Here is a sample of the reported planning error:
The correct behavior is for the script to execute cleanly, with no reported trajectory validation errors. The observed behavior is that the start position does not match the current position reported by MoveIt.
Experimentation
To further experiment with this issue, you can try the following things:
./moveit_trajStart.py 1.0
set_start_state
, to explicitly force the start state in theMotionPlanRequest
to match the reported current state.plan()
,validate_plan()
, andexecute()
lines, and uncomment thego()
line.The text was updated successfully, but these errors were encountered: