toppra icon indicating copy to clipboard operation
toppra copied to clipboard

Jerk Limits

Open danbodily opened this issue 4 years ago • 39 comments

Curious if you've seen a way to extend this into Jerk limiting applications. Your current implementation assumes unbounded jerk no?

danbodily avatar Jul 23 '20 16:07 danbodily

Hi, jerk limits are hard to handle during optimal time-parametrization. At the moment I can only suggest that you smooth the velocity profile before re-parametrize the geometric path.

hungpham2511 avatar Jul 28 '20 02:07 hungpham2511

@dbodily1 Please refer to the following paper for a discussion on third-order constraints (which include jerk bounds): H. Pham, Q.-C. Pham. On the structure of the time-optimal path parameterization problem with third-order constraints. ICRA 2017

quangounet avatar Jul 30 '20 03:07 quangounet

It seems that jerk constraints in joints space are too hard to be managed (the problem is not convex anymore, at least with the actual formulation). For practical usage even a regularization factor could be enough. In some sense the problem here is solved as sequential 2d-LP. If the acceleration u_i is the optimization variable in i-step, maybe the following linear constraints could be added in the formulation:

u_i+1 - u_i <= J * h
u_i - u_i+1 <= J * h

An higher order model could be used too (or using speed as optimization variable).

Do you think it's a possible way to extend the algorithm?

EmanueleSiego avatar Feb 01 '21 14:02 EmanueleSiego

I found a new paper that could be useful to extend TOPP-RA including jerk constraint along the path: https://www.sciencedirect.com/science/article/abs/pii/S0921889021000294

What do you think about?

EmanueleSiego avatar Mar 06 '21 10:03 EmanueleSiego

@hungpham2511 In regards to your much earlier comment, is your recommendation to smooth the path paramaterization (squared path velocity) prior to generating time stamps?

thummel42 avatar Mar 18 '21 22:03 thummel42

It's definitely a possible approach.

hungpham2511 avatar Mar 19 '21 04:03 hungpham2511

I found a new paper that could be useful to extend TOPP-RA including jerk constraint along the path: https://www.sciencedirect.com/science/article/abs/pii/S0921889021000294

What do you think about?

Certainly non-linear optimization is a possible extension. It might not yield the globally optimal solution, but in reality, the locally optimal one is usually good enough.

hungpham2511 avatar Mar 19 '21 04:03 hungpham2511

It's definitely a possible approach.

Would you be able to recommend an approach(s)? In this case even jerk reduction while still maintaining sane kinematics would be sufficient.

thummel42 avatar Aug 05 '21 01:08 thummel42

@hungpham2511 , also curious if we can constrain the torque rate in the planning process?

yakunsjtu avatar Aug 26 '21 08:08 yakunsjtu

Hi, in practice I think smoothing the acceleration profile should produce some reasonable results. It should perhaps be done in the space of the sd(s) function instead of the sd^2(s) due to the scaling issue of the latter one.

Alternatively, you can try "interpolate" or smooth the function s(t). The idea is to approximate it with a cubic polynomial with the same initial condition, minimize distance to the original function and minimize jerk via a quadratic objective.

hungpham2511 avatar Aug 26 '21 10:08 hungpham2511

I found a new paper that could be useful to extend TOPP-RA including jerk constraint along the path: https://www.sciencedirect.com/science/article/abs/pii/S0921889021000294

What do you think about?

Basically, they are constraining $\dddot s$, which is remotely related to joint torque rate limit. For this purpose, a fir filter might do just as well on the velocity profile.

xbaosong avatar Aug 20 '22 02:08 xbaosong

Yeah actually that could work too. I remember trying that sometimes ago. However we would need to be careful regarding the sequence of velocities that the FIR filter is applied on. Ideally it should be w.r.t to time and not position.

However it is not straightforward how to apply FIR w.r.t time for this problem actually.

hungpham2511 avatar Aug 24 '22 00:08 hungpham2511

Actually, one can apply the FIR to $s-t$ curve directly, which is a direct output of TOPPRA. This little trick can readily obtain jerk-bounded trajectories (not respecting specific jerk bounds though).

xbaosong avatar Aug 28 '22 15:08 xbaosong

Actually, one can apply the FIR to s−t curve directly, which is a direct output of TOPPRA. This little trick can readily obtain jerk-bounded trajectories (not respecting specific jerk bounds though).

Sound great. Do you use low-pass FIR?

If you don't mind contributing the code that would be awesome.

hungpham2511 avatar Aug 28 '22 22:08 hungpham2511

The basic idea is to cascade a fir filter. The parameterization result goes into the buffer first. The commanded $s$ is the average of the buffer. (and of course, you can use other FIR filter).

I do have a Matlab file demonstrating the idea, as appended. fir_filter.zip

I haven't put together the fir filter with TOPPRA, but I think it's okay to do so.

xbaosong avatar Aug 29 '22 07:08 xbaosong

I’ve actually tried using LP filtering s vs t many different ways and unfortunately it does not work very well. The first issue is the phase shift introduced by the filter will actually cause both limit violations and arbitrarily change ending conditions. You can use zero-phase shift filtering but we still have the issue of limit violations in many cases, especially in the middle of the paths (this is because the filter also reduces deceleration, causing velocity violations in some circumstances). A zero phase filter could probably work for pure single waypoint joint moves but beyond that it won’t work as intended if using for complex/arbitrary paths…but then again for a simple joint move it’s trivial to just use a properly constructed quintic spline for the trajectory instead of an algorithm…

thummel42 avatar Aug 29 '22 13:08 thummel42

Yeah, I think I have to agree with you on this. See below constraint violation at s = 2, 4, 6.

image

xbaosong avatar Aug 29 '22 17:08 xbaosong

Exactly the same experience that I had.

Does anyone have any experience with a similar library called rugkig? Apparently they can do jerk limit motion.

hungpham2511 avatar Sep 03 '22 01:09 hungpham2511

Hey yes I found that the community version of Ruckig for things like velocity control, single goal point motions, dynamically changing goal point motions, and “move process, constant speed” type motions works reasonably well. It breaks down when you have intermediate waypoints but still require the fastest possible trajectory through those waypoints. The non-free edition can support intermediate waypoints but only a few in practical terms, and you lose optimality (more waypoints result in drastically slower trajectory times). It is essentially a modernization of the old Reflexxes library that i suspect is no longer available because the original author now works at Intrinisc.

thummel42 avatar Sep 03 '22 01:09 thummel42

I had some experience with Reflexxes library. Kroger wrote a book (Onlie) explaining the idea. The problem solved, as quoted from the book

Although there has been much research on this objective, there is still one important question that has not been answered yet: If we consider a robot in an arbitrary state of motion, how can we calculate a trajectory, if we want the robot to react instantaneously to unforeseen sensor events?

As I remember, the algorithm considers only constant constraints. I doubt if they can be extended to handle cartesian constraints such as linear speed or torque constraints. The algorithm targets scenarios when switching to and from sensor-guided / sensor-guarded motion are necessary, in which case no predefined path is available anymore, which is different from TOPPRA.

Major problems appear when all these fields are merged together: We must be able to switch abruptly at unforeseen time instants from one kind of robot control to another. If we arbitrarily switch one or more DOFs from trajectory- following control to sensor-guided control, this problem is usually a solved. By using the transfer function of a desired controller, command variables for lower-level control can be generated at any time instant. But how can we switch one, some, or all DOFs of a robotic system from sensor-guided control to trajectory-following control? If we consider a robot in an arbitrary state of motion how can we calculate a trajectory if we want the robot to react instantaneously to unforeseen (sensor) events?

xbaosong avatar Sep 03 '22 15:09 xbaosong

@xbaosong Could this constrain torque-rate?

oridong avatar Sep 12 '22 10:09 oridong

Hi, I've currently researched TOPP concerning third-order constraints. I've read the paper "On the structure of the time-optimal path parameterization problem with third-order constraints". I am interested in this work, and I intend to compare your work with mine. Is it possible to share the codes of TOPP3? That would help me comprehend your method and compare the methods rigorously.

Spencer-Huang2019 avatar Oct 18 '22 01:10 Spencer-Huang2019

A forwarded email below for people interested into this topic (time-optimized, jerk-limited motion planning library):

Hi,

I wanted to share some exciting details about a new robot arm motion planning library. Using the Jacobi library, you can compute a time-optimized, jerk-limited, and collision-free robot arm motion plan from a start to a goal pose or following a user-defined path. And the best part - the installation process is painless through an online cloud-based version (although there is also an on-premise version if needed).

You can find the library and the documentation here: https://www.jacobirobotics.com/ To get access, fill out the form here: https://www.jacobirobotics.com/get-started

Please feel free to pass this on to anyone who might benefit from it.

Thanks, Yahav

s-trinh avatar Nov 08 '22 22:11 s-trinh

Thanks. Look pretty intriguing. Does anyone have experience with this library and perharps has any familiarity with their technical approach?

hungpham2511 avatar Nov 17 '22 00:11 hungpham2511

Nice! Thanks for the reference @s-trinh

Ruckig's velocity profiles look rather intriguing. I have not seen any path-constrained algorithms producing velocity/acceleration profiles looking that simple. Look like they modify the path as well.

As a disclaimer I have not read their paper.

hungpham2511 avatar Nov 20 '22 14:11 hungpham2511

Exactly the same experience that I had.

Does anyone have any experience with a similar library called rugkig? Apparently they can do jerk limit motion.

I tried ruckig. It is primarily for joint-space interpolation. It does not handle well paths defined by dense points in space.

maxpla3 avatar Jan 19 '23 16:01 maxpla3

Now I'm trying the approach in: R. Wang, Y. Xie, X. Chen and Y. Li, "Path-Constrained Time-Optimal Motion Planning for Robot Manipulators With Third-Order Constraints," in IEEE/ASME Transactions on Mechatronics.

It solves a sequence of LPs integrating forward and backward. Maybe it could be redesigned in the Reachability Analysis framework as TOPP-RA.

What do you think about?

EmanueleSiego avatar Feb 15 '23 21:02 EmanueleSiego

Path-Constrained Time-Optimal Motion Planning for Robot Manipulators With Third-Order Constraints

Sorry I have not had the chance to work through this paper. Please share your experience, it might be useful for others who are interested in this as well.

hungpham2511 avatar Feb 27 '23 06:02 hungpham2511

Now I'm trying the approach in: R. Wang, Y. Xie, X. Chen and Y. Li, "Path-Constrained Time-Optimal Motion Planning for Robot Manipulators With Third-Order Constraints," in IEEE/ASME Transactions on Mechatronics.

It solves a sequence of LPs integrating forward and backward. Maybe it could be redesigned in the Reachability Analysis framework as TOPP-RA.

What do you think about?

The method described in that paper requires a second-order trajectory as input. The computation time is reasonable (~1sec on 1.8GHz CPU). This method might be a nice extension for TOPP-RA.

maxpla3 avatar May 22 '23 09:05 maxpla3