Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sot-dynamic-pinocchio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guilhem Saurel
sot-dynamic-pinocchio
Commits
d03438b5
Unverified
Commit
d03438b5
authored
3 years ago
by
Guilhem Saurel
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #90 from florent-lamiraux/devel
[python] Add method to get actuated joints
parents
aa1a11ce
b191d478
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dynamic_graph/sot/dynamic_pinocchio/humanoid_robot.py
+28
-0
28 additions, 0 deletions
src/dynamic_graph/sot/dynamic_pinocchio/humanoid_robot.py
with
28 additions
and
0 deletions
src/dynamic_graph/sot/dynamic_pinocchio/humanoid_robot.py
+
28
−
0
View file @
d03438b5
...
...
@@ -147,6 +147,16 @@ class AbstractRobot(ABC):
mimicJoints
.
append
(
name
)
self
.
removeJoints
(
mimicJoints
)
def
_storeRootJointType
(
self
,
rootJointType
):
if
rootJointType
==
pinocchio
.
JointModelFreeFlyer
:
self
.
rootJointType
=
'
freeflyer
'
elif
rootJointType
==
pinocchio
.
JointModelPlanar
:
self
.
rootJointType
=
'
planar
'
elif
rootJointType
is
None
:
self
.
rootJointType
=
'
fixed
'
else
:
raise
TypeError
(
'
rootJointType should be either JointModelFreeflyer, JointModelPlanar, or None.
'
)
def
removeJoints
(
self
,
joints
):
"""
- param joints: a list of joint names to be removed from the self.pinocchioModel
...
...
@@ -172,6 +182,7 @@ class AbstractRobot(ABC):
self
.
pinocchioData
=
pinocchio
.
Data
(
self
.
pinocchioModel
)
if
removeMimicJoints
:
self
.
_removeMimicJoints
(
urdfString
=
urdfString
)
self
.
_storeRootJointType
(
rootJointType
)
def
loadModelFromUrdf
(
self
,
urdfPath
,
...
...
@@ -208,6 +219,7 @@ class AbstractRobot(ABC):
self
.
pinocchioData
=
pinocchio
.
Data
(
self
.
pinocchioModel
)
if
removeMimicJoints
:
self
.
_removeMimicJoints
(
urdfFile
=
urdfFile
)
self
.
_storeRootJointType
(
rootJointType
)
def
initializeOpPoints
(
self
):
for
op
in
self
.
OperationalPoints
:
...
...
@@ -406,6 +418,22 @@ class AbstractRobot(ABC):
self
.
dynamic
.
signal
(
self
.
OperationalPointsMap
[
op
]).
recompute
(
self
.
device
.
state
.
time
+
1
)
self
.
dynamic
.
signal
(
'
J
'
+
self
.
OperationalPointsMap
[
op
]).
recompute
(
self
.
device
.
state
.
time
+
1
)
def
getActuatedJoints
(
self
):
"""
Return the list of indices in the velocity vector of actuated
joints.
This method is particularly useful to define a posture task where only
the actuated joints are controlled.
"""
if
self
.
rootJointType
==
"
freeflyer
"
:
return
range
(
6
,
self
.
dynamic
.
model
.
nv
)
if
self
.
rootJointType
==
"
planar
"
:
return
range
(
3
,
self
.
dynamic
.
model
.
nv
)
if
self
.
rootJointType
==
"
fixed
"
:
return
range
(
0
,
self
.
dynamic
.
model
.
nv
)
raise
TypeError
(
"
unknown rootJointType
"
)
class
AbstractHumanoidRobot
(
AbstractRobot
):
def
__init__
(
self
,
name
,
tracer
=
None
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment