Skip to content

How to use JointStatesFromTraj() & JointStateFromTraj() #295

@DavidB-CMU

Description

@DavidB-CMU

What is the difference between these two functions, and how do I use them?

prpy.util.JointStatesFromTraj()
prpy.util.JointStateFromTraj()

.

For example, I have a timed trajectory.

waypoint idx 10 has delta_time = 0.578625550278

Extracting waypoint 10 gives me 15 values, including position and velocity:

[ 4.72509056 -0.80361648 -0.40874884 1.62480367 -0.44666198 -0.80896596
-2.5743101 -0.19636848 0.20038932 -0.25245062 -0.74623971 -0.61489159
0.65293156 1. 0.04002589]

Then JointStatesFromTraj() for waypoint idx 10 gives me this:

pva_list[10] = [array([ 0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ,
4.74008604, 0. , -0.82155363, 0. , -0.42307695,
1.58725633, -0.43116916, -0.82954712, -2.57900286, 0. , 0. ]), array([ 0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ,
-0.09723434, 0. , 0.15674668, 0. , -0.27341786,
-0.8 , -0.47945874, 0.57077024, 0.8395961 , 0. , 0. ]), None]

containing two arrays of 26 values and the 3rd empty.
There's a lot of zeros in there.

.

The docstring for JointStateFromTraj() is the same as JointStatesFromTraj(), so I don't know what it's supposed to be doing.
Calling JointStateFromTraj() on my trajectory returns

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions