8000 jtraj: fix qd1 ,mstraj qdf -- ensure they are ndarray using getvector by mfkenson · Pull Request #181 · petercorke/robotics-toolbox-python · GitHub
[go: up one dir, main page]

Skip to content

jtraj: fix qd1 ,mstraj qdf -- ensure they are ndarray using getvector #181

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

Merged
merged 1 commit into from
Feb 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
< 8000 svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="anim-rotate"> Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion roboticstoolbox/tools/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def jtraj(q0, qf, tv, qd0=None, qd1=None):
if qd1 is None:
qd1 = np.zeros(q0.shape)
else:
qd0 = getvector(qd0)
qd1 = getvector(qd1)
if not len(qd1) == len(q0):
raise ValueError('qd1 has wrong size')

Expand Down Expand Up @@ -742,16 +742,19 @@ def mstraj(
if isinstance(Tacc, (int, float)):
Tacc = np.tile(Tacc, (ns,))
else:
Tacc = getvector(Tacc)
if not len(Tacc) == ns:
raise ValueError('Tacc is wrong size')
if qd0 is None:
qd0 = np.zeros((nj,))
else:
qd0 = getvector(qd0)
if not len(qd0) == len(q0):
raise ValueError('qd0 is wrong size')
if qdf is None:
qdf = np.zeros((nj,))
else:
qdf = getvector(qdf)
if not len(qdf) == len(q0):
raise ValueError('qdf is wrong size')

Expand Down
0