I have a custom robot arm simulated inside gazebo that uses ros_control in order to control the robot from ROS.Apparently everything is working well, but I keep getting some warnings from MoveIt and from the controller that are really bugging me.Whether I send an end-effector pose to the robot with the C++ API or with the the RVIZ gui , the controller always returns GOAL TOLERANCE VIOLATED as soon as the arm reaches the goal (it has a lil bit of overshooting), even though I set goal tolerances as high as 0.5.
And then I noticed two things:-Although it says its gonna abort the action, it finishes to complete the action and succesfully achieves the desired goal.
-The second is that in the controllerś terminal screen the controller always gets me the following warning:[ WARN] [1398541940.787273604, 37.613000000]: Dropping first 1 trajectory point(s) out of 10, as they occur before the current time.First valid point will be reached in 0.591s.
I know those are all just warnings that could easily be ignored, but I just wanna make sure I'm not overlooking anything that might turn out to be really important.Thanks in advance for any help with it,
Waldez Jr
Hi Adolfo,
On Mon, 28 Apr 2014 12:37:36 +0200
Adolfo Rodríguez Tsouroukdissian <adolfo.r...@pal-robotics.com>
wrote:
> here<http://wiki.ros.org/joint_trajectory_controller/UnderstandingTrajectoryReplacement> .
> You have an eye for detail. This warning won't cause any execution
> issues, and is unrelated to controller overshooting. It's MoveIt! and
> ros_control mildly not getting along ;-). MoveIt! generates motion
> plans where the trajectory start time is zero (meaning start now) and
> the first waypoint has zero time from start (meaning be there now).
> The joint_trajectory_controller, OTOH rejects all waypoints whose
> timestamp is not in the future, because there is no way to reach a
> configuration in zero time. Of course, if the first waypoint is the
> current configuration it can be reached (it already has). The details
> on how the joint_trajectory_controller handles trajectory replacement
> are documented
>
> This point deserves some discussion in its own right. Is it really
> necessary to add the current configuration to the plan?
It definitely makes sense to add the current configuration to the plan.
I wrote a joint trajectory action server for the Katana arm; I have to
use the (dumb) controller boards on the arm, so I can't do clever
trajectory replacement. All I can do is check whether the current state
is identical to the first trajectory point; if yes, fine, otherwise
reject.
Also, the first trajectory point contains essential information
about the velocities and speeds. Perhaps the ros_control implementation
always recalculates the first trajectory point, but that's a special
case.
All very good questions. There should be a clear specification of the
> , and if so,
> could it be timestamped in the future?. On the controller side, would
> it make sense to change the policy and accept waypoints happening
> 'now'?.
JointTrajectory action that clarifies these points.
As a short-term workaround it may make sense if ros_control would check
if the unreachable trajectory point is reasonably close in time and
positions to the current state, and only output the warning if not.
Alternatively, it could print the time and joint angle differences in
the error message so the user could check that it's a false alarm.
Cheers,
Martin
Hi Adolfo,
On Mon, 28 Apr 2014 18:54:52 +0200
> Hey Martin,
>
>
> > It definitely makes sense to add the current configuration to the
> > plan. I wrote a joint trajectory action server for the Katana arm;
> > I have to use the (dumb) controller boards on the arm, so I can't
> > do clever trajectory replacement. All I can do is check whether the
> > current state is identical to the first trajectory point; if yes,
> > fine, otherwise reject.
>
>
> I understand your usecase. Still, I'm not very fond of this option,
> as it involves specifying additional ad-hoc tolerances. A
> trajectory_msgs::JointTrajectory waypoint can be specified up to the
> acceleration level, so that would mean having to potentially
> tolerance-check positions, velocities and accelerations. Furthermore,
> it's not customary to have joint acceleration measurements readily
> available. One could circumvent this issue by not using actual joint
> measurements but sampling the active trajectory (which yields
> accelerations), but I'd not trust that the robot will in general be
> where it should. AFAIK MoveIt! does not specify funky initial
> trajectory points with nonzero velocities and accelerations, but the
> joint_trajectory_controller should be general enough to support well
> these scenarios.
Yes, I think what the joint_trajectory_controller does is correct:
Print out a warning when it's asked to execute an impossible trajectory
and had to drop trajectory points. The question is what trajectories
should MoveIt generate so that they can be properly executed (see
below).
All I was saying is that MoveIt shouldn't drop the initial point from
the trajectory. Sure, we can always recover it from the current joint
states and recompute velocities and accelerations, but that's going to
make dumber implementations of joint trajectory action servers a bit
more complex, and also doesn't make the joint trajectory message easier
to understand.
> In fact, if supporting zero-time waypoints is really a desired
> feature, I'd prefer to just accept the waypoint and let the robot's
> low-level joint limit enforcing mitigate the jump, if any. I'm open
> to this one.
Unless time_from_start = 0.0 has some special semantics (like "as soon
as possible"), which I don't think it has,
trajectories with zero-time
waypoints are not strictly speaking executable, so I don't think that's
a desired feature.
> Two simple workarounds (not fixes) to this issue that are
> straightforward to implement would be to either lower the severity of
> the warning that notifies about discarded waypoints to DEBUG, or
> offsetting motion plans a bit to the future, so the first waypoint
> does not start at exactly zero (IIRC, arm_navigation did just this).
> I don't like either, but I put them here for the record.
I'm not fond either about lowering the severity to DEBUG, since dropped
trajectory points *could* point to a severe problem. So we should
instead make sure that MoveIt sends trajectories that ros_control is
happy with, so that ros_control only prints this warning when there
actually is a problem.
To me, it sounds like offsetting motion plans a bit to the future is
exactly what we should do. Why don't you like that method?
The problem is that a zero-time initial waypoint is impossible to
reach, except when it coincides exactly with the current state, right?
And they basically never coincide exactly, due to slight fluctuations
in the joint states when the controller is trying to "hold" the arm.
So, in the most common use case, the arm is still stopped in *almost*
the same position as when we started planning. So if we shifted the
time_from_start of the first trajectory point from 0.0 to 0.01, it
should be reachable. So, if MoveIt would generate plans like this,
ros_control would be happy, right? Sounds like it could easily be done
with a PlanningRequestAdapter.
> Also, the first trajectory point contains essential information
> > about the velocities and speeds. Perhaps the ros_control
> > implementation always recalculates the first trajectory point, but
> > that's a special case.
> >
>
> If the first waypoint of a new command has a non-zero
> time_from_start, a bridge spline segment is created between the
> current trajectory and the new one. Since both the current and new
> trajectories are known, they can be sampled at any time.
I know. So the solution seems to be to make MoveIt issue non-zero
time_from_start.
Cheers,
Martin