-
Notifications
You must be signed in to change notification settings - Fork 943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
totg timing algorithm sometimes gives invalid accelerations #1665
Comments
@Dale-Koenig thanks or reporting this. This is indeed strange behavior but I don't see any way how this could be related to the robot hardware. Can you provide a full example (trajectory with populated robot state and velocity/acceleration factors) that allows us to reproduce this issue? I think that some configuration must be different when you launch the real robot, i.e. joint limits. I guess it's worth looking at the robot model. TOTG only reads the robot trajectory and acceleration/velocity factors which depend on setup and planner, not on the used hardware or controller. |
@henningkayser The code run on this trajectory is essentially:
After which we convert back to a message and immediately validate the accelerations and find that a couple of the times have ridiculous values like mentioned above. I'm pretty sure I printed out the start robot state's position/velocity/acceleration values at some point before and they matched up with the first trajectory state. I'm not sure how much other aspects of the robot model/start robot state affect totg though. |
@henningkayser I made a test where totg generates nan values for one of the accelerations https://github.com/Dale-Koenig/moveit/tree/test_totg
The nan values seem to be caused by the fact that this line can create length 0 line segments, and calculating the tangent of a length 0 line segment has division by 0. It's not completely clear this is the same as the original problem though, because as far as I can tell this can only happen at the very end of the path. |
The reason why it's giving This's a simpler test that reproduces the error link When constructing Regarding the acceleration values, these two issues could be related 1 and 2. |
I see, I suppose I added a couple extra waypoints when making the test. I
can, however testify that creating a Path with the exact same
function arguments (without the duplicated waypoints) is what gave the
large accelerations when running on the real robot. It doesn't seem to
cause the same problem when running the test without the real robot, so
somehow there is a strange hardware/similar dependence without the totg
code itself.
…On Sun, Oct 20, 2019 at 3:21 AM Jafar Abdi ***@***.***> wrote:
The reason why it's giving nan is that you added the last waypoint 3
times in 1
<https://github.com/Dale-Koenig/moveit/blob/9889c3519508228985a9656bbbbf17efcbc0985f/moveit_core/trajectory_processing/test/test_time_optimal_trajectory_generation.cpp#L248>,
2
<https://github.com/Dale-Koenig/moveit/blob/test_totg/moveit_core/trajectory_processing/test/test_time_optimal_trajectory_generation.cpp#L246>,
and 3
<https://github.com/Dale-Koenig/moveit/blob/test_totg/moveit_core/trajectory_processing/test/test_time_optimal_trajectory_generation.cpp#L244>
This's a simpler test that reproduces the error link
<https://gist.github.com/JafarAbdi/aed3dc2766a18f22ad9228eeefbad37f>
The TimeOptimalTrajectoryGeneration handles this situation See
<https://github.com/ros-planning/moveit/blob/master/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp#L952>
Regarding the acceleration values, these two issues could be related 1
<tobiaskunz/trajectories#1> and 2
<tobiaskunz/trajectories#2>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1665>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMAEPFVARWHEZD6JDSWZBO3QPNFZ3ANCNFSM4IV7UL2Q>
.
--
Dale Koenig
Robotics Software Engineer
Rapyuta Robotics
"empowering lives with connected machines"
www.rapyuta-robotics.com
|
Anyway I will continue to investigate / put tons of debug messages while
running with the real robot.
On Sun, Oct 20, 2019 at 11:25 PM Dale Koenig <
dale.koenig@rapyuta-robotics.com> wrote:
… I see, I suppose I added a couple extra waypoints when making the test. I
can, however testify that creating a Path with the exact same
function arguments (without the duplicated waypoints) is what gave the
large accelerations when running on the real robot. It doesn't seem to
cause the same problem when running the test without the real robot, so
somehow there is a strange hardware/similar dependence without the totg
code itself.
On Sun, Oct 20, 2019 at 3:21 AM Jafar Abdi ***@***.***>
wrote:
> The reason why it's giving nan is that you added the last waypoint 3
> times in 1
> <https://github.com/Dale-Koenig/moveit/blob/9889c3519508228985a9656bbbbf17efcbc0985f/moveit_core/trajectory_processing/test/test_time_optimal_trajectory_generation.cpp#L248>,
> 2
> <https://github.com/Dale-Koenig/moveit/blob/test_totg/moveit_core/trajectory_processing/test/test_time_optimal_trajectory_generation.cpp#L246>,
> and 3
> <https://github.com/Dale-Koenig/moveit/blob/test_totg/moveit_core/trajectory_processing/test/test_time_optimal_trajectory_generation.cpp#L244>
>
> This's a simpler test that reproduces the error link
> <https://gist.github.com/JafarAbdi/aed3dc2766a18f22ad9228eeefbad37f>
>
> The TimeOptimalTrajectoryGeneration handles this situation See
> <https://github.com/ros-planning/moveit/blob/master/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp#L952>
>
> Regarding the acceleration values, these two issues could be related 1
> <tobiaskunz/trajectories#1> and 2
> <tobiaskunz/trajectories#2>.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#1665>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AMAEPFVARWHEZD6JDSWZBO3QPNFZ3ANCNFSM4IV7UL2Q>
> .
>
--
Dale Koenig
Robotics Software Engineer
Rapyuta Robotics
"empowering lives with connected machines"
www.rapyuta-robotics.com
--
Dale Koenig
Robotics Software Engineer
Rapyuta Robotics
"empowering lives with connected machines"
www.rapyuta-robotics.com
|
https://github.com/Dale-Koenig/moveit/tree/test_totg Test updated. It now gives very large (non nan) accelerations on my machine. |
This test is the same test provided by @Dale-Koenig but with commented waypoints which don't affect the test failing (having big acceleration) Some observations
I'll try to add UB sanitizer to the test and see if there's UB when having high precision waypoints |
@Dale-Koenig After diving again in the test you provided the bug happens inside integrateForward function, when the path_pos of a TrajectoryStep is very close to a switching point (for example for the reduced test it's about if (next_discontinuity != switching_points.end() && path_pos > next_discontinuity->first)
{
if (path_pos - next_discontinuity->first < 10e-8)
{
continue;
}
path_vel = old_path_vel +
(next_discontinuity->first - old_path_pos) * (path_vel - old_path_vel) / (path_pos - old_path_pos);
path_pos = next_discontinuity->first;
} The paper has a section which discusses the numerical aspect of the algorithm but seems like it didn't include this case -- see section VIII |
Description
Totg sometimes gives acceleration values on the order of 10^10 or higher despite acceleration joint limits on the order of 1 to 10
Your environment
Steps to reproduce
Expected behaviour
Accelerations within joint limits
Actual behaviour
One waypoint (usually around the 5th or 6th) will have accelerations on the order of +- 10^11
The acceleration values are normal before the call to totg, and there are no (related) problems with iptp or itsp
Backtrace or Console output
The offending part of the trajectory
The text was updated successfully, but these errors were encountered: