hungpham2511 / toppra

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

N-dof ptah velocity calculation #219

Closed botoph4 closed 1 year ago

botoph4 commented 1 year ago

Update after read doc carefully again, maybe some mistakes were make when I asked the third question. Plz correct me if I was wrong.

alternative way to get pose and vel is:

jnt_traj = instance.compute_trajectory(0, 0)
pose_n = jnt_traj(POINT_NUM_N, 0)
vel_n =  jnt_traj(POINT_NUM_N, 1)

So pose_n has shape of (n,1).


Hey,

when playing with example script plot_straight_line.py, I noticed that the joint poses are not directly obtained by

jnt_traj = instance.compute_trajectory(0, 0)
jnt_traj.waypoints

rather

qs_sample = jnt_traj.eval(ts_sample)  # sampled joint positions

Hence jnt_traj.waypoints returns None.

So here are some questions I would kindly ask:

  1. In which condition will None returns instead of an array;
  2. Should use .eval , .evald and .evaldd for pose, vel and acc calculation at each point of trajectory or the return value of compute_parameterization( );
  3. When calculate a n-dof trajectory the return object of instance.compute_parameterization( ), according to doc the path vel has shape of (N, 1) instead of (N ,n).

Cheers

hungpham2511 commented 1 year ago

Very sorry for the late response. Here it is anyway .

In which condition will None returns instead of an array;

When the trajectory is not constructed from waypoints. The output trajectory of TOPPRA is not so there is no waypoints.

Should use .eval , .evald and .evaldd for pose, vel and acc calculation at each point of trajectory or the return value of compute_parameterization( );

Yes.

When calculate a n-dof trajectory the return object of instance.compute_parameterization( ), according to doc the path vel has shape of (N, 1) instead of (N ,n)

Yes the parametrization should have shape (N,1).

botoph4 commented 1 year ago

Thanks for your kind reply @hungpham2511 ! I will close this issue and it would be great if more infos of calling APIs will be offered in doc.