hungpham2511 / toppra

robotic motion planning library
https://hungpham2511.github.io/toppra/index.html
MIT License
625 stars 170 forks source link

Constant Time Trajectories #2

Closed JadBatmobile closed 6 years ago

JadBatmobile commented 6 years ago

Is it possible to plan trajectories with a specific duration?

JadBatmobile commented 6 years ago

So including Time constraint instead of/ as well as V and A constraints

hungpham2511 commented 6 years ago

Hi @JadBatmobile,

Yes, it is possible to plan/retime trajectories to specific durations if one such parameterization exists. However, this feature is currently not implemented, but it will definitely be in near future.

Stay tuned, Hung

JadBatmobile commented 6 years ago

Great, Can we talk about how i can help with is more? can we speak privately? jd224234@dal.ca

hungpham2511 commented 6 years ago

The idea is to compute two parameterizations, the fastest and the slowest and then interpolate them to get the parameterization with the desired duration.

The fastest parameterization can be obtained using the current implementation. The slowest one is not, but can be implemented quite easily: simply select the lowest acceleration at each step in the forward stage. Then you can consider the family of parameterizations

alpha fastest_param + (1-alpha) slowest_param

and find one with the specified duration.

JadBatmobile commented 6 years ago

so you are saying:

fastest_duration <- current implementation slowest_duration <- current implementation + lowest accel. at each step in the forward stage.

desired_duration = alphafastest_duration + (1-alpha) slowest_duration

solve for alpha?

hungpham2511 commented 6 years ago

@JadBatmobile That's correct. You can refer to this function for the current implementation of the forward pass as a starting point.

JadBatmobile commented 6 years ago

After i have alpha, do i simply multiply the velocities and accelerations of the fastest profile with alpha?

So in total:

fastest_duration <- current implementation slowest_duration <- current implementation + lowest accel. at each step in the forward stage.

desired_duration = alphafastest_duration + (1-alpha) slowest_duration

?? desired_trajectory_velocity = current_implementation_velocity x alpha desired_trajectory_acceleration = current_implementation_acceleration x alpha desired_trajectory_positions = current_implementation_positions ??

hungpham2511 commented 6 years ago

Hmm @JadBatmobile I think I missed this line you wrote

desired_duration = alphafastest_duration + (1-alpha) slowest_duration

It is actually not correct. The duration here must be computed from the parameterization, which is the vector xs := [x_0, x_1,....,x_n].

In any case, I will try to implement that functionality later this week. Thank you for your interest.

JadBatmobile commented 6 years ago

I would seriously appreciate that since my application involves moving targets and it would be much easier if i can generate trajectories with fixed time.

I tried my best to do it today but the code was too much to handle wrapping my head around. If it is easy for you to do this i would appreciate it tremendously.

Cheers from Canada.

hungpham2511 commented 6 years ago

This functionality is now implemented in commit https://github.com/hungpham2511/toppra/commit/74b99fa0de972e49fdb422c5a3ba8c072338c469 Please see examples/kinematics_duration.py for more details

JadBatmobile commented 6 years ago

THANK YOU SIR

hungpham2511 commented 6 years ago

You are welcome. Glad this is useful for you. If you find any bugs, please raise a separate issue.

Get Outlook for iOShttps://aka.ms/o0ukef


From: JadBatmobile notifications@github.com Sent: Tuesday, July 31, 2018 12:56:50 AM To: hungpham2511/toppra Cc: hungpham2511; State change Subject: Re: [hungpham2511/toppra] Constant Time Trajectories (#2)

THANK YOU SIR

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/hungpham2511/toppra/issues/2#issuecomment-408934827, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJQ_TGxOnHyHlg0E0dAqPAZ9SUf8i8_wks5uLzrRgaJpZM4VaA2b.