@@ -1382,14 +1382,16 @@ def JointStatesFromTraj(robot, traj, times, derivatives=[0, 1, 2]):
1382
1382
@param traj An OpenRAVE trajectory
1383
1383
@param times List of times in seconds
1384
1384
@param derivatives list of desired derivatives defaults to [0, 1, 2]
1385
- @return pva_list List of list of derivatives at specified times.
1386
- Inserts 'None' for unavailable or undesired fields
1387
- The i-th element is the derivatives[i]-th derivative
1388
- of position of size |times| x |derivatives|
1389
-
1385
+ @return List of list of derivatives at specified times.
1386
+ Inserts 'None' for unavailable or undesired fields
1387
+ The i-th element is the derivatives[i]-th derivative
1388
+ of position of size |times| x |derivatives|
1390
1389
"""
1391
- duration = traj .GetDuration ()
1390
+ if not IsTimedTrajectory (traj ):
1391
+ raise ValueError ("Joint states can only be interpolated"
1392
+ " on a timed trajectory." )
1392
1393
1394
+ duration = traj .GetDuration ()
1393
1395
times = numpy .array (times )
1394
1396
if any (times > duration ):
1395
1397
raise ValueError ('Input times {0:} exceed duration {1:.2f}'
@@ -1418,10 +1420,10 @@ def JointStateFromTraj(robot, traj, time, derivatives=[0, 1, 2]):
1418
1420
@param traj An OpenRAVE trajectory
1419
1421
@param time time in seconds
1420
1422
@param derivatives list of desired derivatives defaults to [0, 1, 2]
1421
- @return pva_list List of list of derivatives at specified times.
1422
- Inserts 'None' for unavailable or undesired fields
1423
- The i-th element is the derivatives[i]-th derivative
1424
- of position of size |times| x |derivatives|
1423
+ @return List of list of derivatives at specified times.
1424
+ Inserts 'None' for unavailable or undesired fields
1425
+ The i-th element is the derivatives[i]-th derivative
1426
+ of position of size |times| x |derivatives|
1425
1427
"""
1426
1428
return JointStatesFromTraj (robot , traj , (time ,), derivatives )[0 ]
1427
1429
0 commit comments