Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
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
Stack Of Tasks
pinocchio
Commits
3b4b95b5
Commit
3b4b95b5
authored
6 years ago
by
jcarpent
Browse files
Options
Downloads
Patches
Plain Diff
[Examples] Update example of loading URDF
parent
4c6bec99
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/python/load-urdf.py
+30
-6
30 additions, 6 deletions
examples/python/load-urdf.py
with
30 additions
and
6 deletions
examples/python/load-urdf.py
+
30
−
6
View file @
3b4b95b5
##
## Copyright (c) 2018 CNRS
##
## This file is part of Pinocchio
## Pinocchio is free software: you can redistribute it
## and/or modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation, either version
## 3 of the License, or (at your option) any later version.
##
## Pinocchio is distributed in the hope that it will be
## useful, but WITHOUT ANY WARRANTY; without even the implied warranty
## of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Lesser Public License for more details. You should have
## received a copy of the GNU Lesser General Public License along with
## Pinocchio If not, see
## <http:##www.gnu.org/licenses/>.
##
##
## In this short script, we show how to a load a robot model from its URDF description.
## Here, the robot model is ROMEO, but a similar approach can be done by with rospkg.
##
import
pinocchio
as
pin
from
pinocchio.romeo_wrapper
import
Ro
meo
Wrapper
from
pinocchio.romeo_wrapper
import
Ro
bot
Wrapper
#
# Load Romeo with RomeoWrapper
# Load Romeo with RomeoWrapper
import
os
current_path
=
os
.
getcwd
()
...
...
@@ -11,14 +34,15 @@ mesh_dir = model_path
urdf_filename
=
"
romeo.urdf
"
urdf_model_path
=
model_path
+
"
/urdf/
"
+
urdf_filename
robot
=
Ro
meo
Wrapper
(
urdf_model_path
,
[
mesh_dir
])
robot
=
Ro
bot
Wrapper
(
urdf_model_path
,
[
mesh_dir
])
#
# alias
# alias
model
=
robot
.
model
data
=
robot
.
data
#
# do whatever, e.g. compute the center of mass position in the world frame
# do whatever, e.g. compute the center of mass position
expressed
in the world frame
q0
=
robot
.
q0
com
=
robot
.
com
(
q0
)
# This last command is similar to
# This last command is similar to:
com2
=
pin
.
centerOfMass
(
model
,
data
,
q0
)
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