Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DavidB-CMU opened this issue Apr 5, 2016 · 0 comments
Open

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

DavidB-CMU opened this issue Apr 5, 2016 · 0 comments
Labels

Comments

@DavidB-CMU
Copy link
Contributor

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()

@mkoval mkoval added the bug label Apr 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants