Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
robotran
mbsysc
Commits
fdd6c64e
Commit
fdd6c64e
authored
Jan 13, 2021
by
Olivier Lantsoght
Browse files
[MBsysPy][Bug] Functions set_qu/qv/qdriven/... can use MbsData::qu[1:] and similar list as input.
parent
620700c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
MBsysC/mbs_interface/MBsysPy/mbsyspy/mbs_data.py
View file @
fdd6c64e
...
...
@@ -2110,7 +2110,9 @@ class MbsData(object):
"""
if
isinstance
(
indices
,
(
list
,
np
.
ndarray
)):
for
index
in
indices
:
# local list to avoid self-modification (ie. set all driven joints as independent)
local_indices
=
list
(
indices
)
for
index
in
local_indices
:
libutilities
.
mbs_set_qu
(
self
.
mbs_data_ptr
,
index
)
else
:
libutilities
.
mbs_set_qu
(
self
.
mbs_data_ptr
,
indices
)
...
...
@@ -2125,7 +2127,9 @@ class MbsData(object):
The ids of the joints to set as dependent.
"""
if
isinstance
(
indices
,
(
list
,
np
.
ndarray
)):
for
index
in
indices
:
# local list to avoid self-modification (ie. set all independent to dependent)
local_indices
=
list
(
indices
)
for
index
in
local_indices
:
libutilities
.
mbs_set_qv
(
self
.
mbs_data_ptr
,
index
)
else
:
libutilities
.
mbs_set_qv
(
self
.
mbs_data_ptr
,
indices
)
...
...
@@ -2140,7 +2144,9 @@ class MbsData(object):
The ids of the joints to set as driven.
"""
if
isinstance
(
indices
,
(
list
,
np
.
ndarray
)):
for
index
in
indices
:
# local list to avoid self-modification (ie. set all independent to driven)
local_indices
=
list
(
indices
)
for
index
in
local_indices
:
libutilities
.
mbs_set_qdriven
(
self
.
mbs_data_ptr
,
index
)
else
:
libutilities
.
mbs_set_qdriven
(
self
.
mbs_data_ptr
,
indices
)
...
...
@@ -2159,6 +2165,7 @@ class MbsData(object):
The ids of the joints to set as actuated.
"""
if
isinstance
(
indices
,
(
list
,
np
.
ndarray
)):
# No need of local list
for
index
in
indices
:
libutilities
.
mbs_set_qa
(
self
.
mbs_data_ptr
,
index
)
else
:
...
...
@@ -2174,7 +2181,9 @@ class MbsData(object):
The ids of the joints to be removed from the actuated list.
"""
if
isinstance
(
indices
,
(
list
,
np
.
ndarray
)):
for
index
in
indices
:
# local list to avoid self-modification (ie. unset all qa)
local_indices
=
list
(
indices
)
for
index
in
local_indices
:
libutilities
.
mbs_unset_qa
(
self
.
mbs_data_ptr
,
index
)
else
:
libutilities
.
mbs_unset_qa
(
self
.
mbs_data_ptr
,
indices
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment