Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
example-robot-data
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
Gepetto
example-robot-data
Commits
a31c03f4
Commit
a31c03f4
authored
4 years ago
by
Guilhem Saurel
Browse files
Options
Downloads
Patches
Plain Diff
load: allow to load multiple robots with different rootNodeName
parent
e07b30ed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#12392
passed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/example_robot_data/robots_loader.py
+11
-7
11 additions, 7 deletions
python/example_robot_data/robots_loader.py
with
11 additions
and
7 deletions
python/example_robot_data/robots_loader.py
+
11
−
7
View file @
a31c03f4
...
...
@@ -470,24 +470,28 @@ ROBOTS = {
}
def
loader
(
name
,
display
=
False
):
def
loader
(
name
,
display
=
False
,
rootNodeName
=
''
):
"""
Load a robot by its name, and optionnaly display it in a viewer.
"""
if
name
not
in
ROBOTS
:
robots
=
"
,
"
.
join
(
sorted
(
ROBOTS
.
keys
()))
raise
ValueError
(
"
Robot
'
%s
'
not found. Possible values are %s
"
%
(
name
,
robots
))
inst
=
ROBOTS
[
name
]()
if
display
:
inst
.
robot
.
initViewer
(
loadModel
=
True
)
inst
.
robot
.
display
(
inst
.
q0
)
if
rootNodeName
:
inst
.
robot
.
initViewer
()
inst
.
robot
.
viz
.
loadViewerModel
(
rootNodeName
=
rootNodeName
)
else
:
inst
.
robot
.
initViewer
(
loadModel
=
True
)
inst
.
robot
.
display
(
inst
.
robot
.
q0
)
return
inst
def
load
(
name
,
display
=
False
):
def
load
(
name
,
display
=
False
,
rootNodeName
=
''
):
"""
Load a robot by its name, and optionnaly display it in a viewer.
"""
return
loader
(
name
,
display
).
robot
return
loader
(
name
,
display
,
rootNodeName
).
robot
def
load_full
(
name
,
display
=
False
):
def
load_full
(
name
,
display
=
False
,
rootNodeName
=
''
):
"""
Load a robot by its name, optionnaly display it in a viewer, and provide its q0 and paths.
"""
inst
=
loader
(
name
,
display
)
inst
=
loader
(
name
,
display
,
rootNodeName
)
return
inst
.
robot
,
inst
.
q0
,
inst
.
urdf_path
,
inst
.
srdf_path
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