Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
4dcea71b
Unverified
Commit
4dcea71b
authored
Nov 13, 2020
by
Justin Carpentier
Committed by
GitHub
Nov 13, 2020
Browse files
Merge pull request #1339 from jcarpent/topic/python
Minor fixes
parents
c4d99741
b77ecf0b
Pipeline
#14162
canceled with stage
in 17 minutes and 12 seconds
Changes
6
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
bindings/python/multibody/geometry-object.hpp
View file @
4dcea71b
...
...
@@ -23,9 +23,9 @@ namespace pinocchio
:
public
boost
::
python
::
def_visitor
<
GeometryObjectPythonVisitor
>
{
typedef
GeometryObject
::
CollisionGeometryPtr
CollisionGeometryPtr
;
template
<
class
PyClass
>
void
visit
(
PyClass
&
cl
)
const
void
visit
(
PyClass
&
cl
)
const
{
cl
.
def
(
bp
::
init
<
std
::
string
,
FrameIndex
,
JointIndex
,
CollisionGeometryPtr
,
SE3
,
...
...
@@ -63,13 +63,13 @@ namespace pinocchio
"Index of the parent frame."
)
.
def_readwrite
(
"placement"
,
&
GeometryObject
::
placement
,
"Position of geometry object in parent joint's frame."
)
.
def_read
only
(
"meshPath"
,
&
GeometryObject
::
meshPath
,
"Path to the mesh file."
)
.
def_read
only
(
"overrideMaterial"
,
&
GeometryObject
::
overrideMaterial
,
"Boolean that tells whether material information is stored inside the given GeometryObject."
)
.
def_read
only
(
"meshTexturePath"
,
&
GeometryObject
::
meshTexturePath
,
"Path to the mesh texture file."
)
.
def_read
write
(
"meshPath"
,
&
GeometryObject
::
meshPath
,
"Path to the mesh file."
)
.
def_read
write
(
"overrideMaterial"
,
&
GeometryObject
::
overrideMaterial
,
"Boolean that tells whether material information is stored inside the given GeometryObject."
)
.
def_read
write
(
"meshTexturePath"
,
&
GeometryObject
::
meshTexturePath
,
"Path to the mesh texture file."
)
.
def
(
bp
::
self
==
bp
::
self
)
.
def
(
bp
::
self
!=
bp
::
self
)
...
...
@@ -98,7 +98,7 @@ namespace pinocchio
)
.
def
(
GeometryObjectPythonVisitor
())
;
bp
::
enum_
<
GeometryType
>
(
"GeometryType"
)
.
value
(
"VISUAL"
,
VISUAL
)
.
value
(
"COLLISION"
,
COLLISION
)
...
...
@@ -107,7 +107,7 @@ namespace pinocchio
}
};
}
// namespace python
}
// namespace pinocchio
...
...
bindings/python/multibody/model.hpp
View file @
4dcea71b
...
...
@@ -220,8 +220,8 @@ namespace pinocchio
.
add_property
(
"nvs"
,
&
Model
::
nvs
)
.
add_property
(
"parents"
,
&
Model
::
parents
)
.
add_property
(
"names"
,
&
Model
::
names
)
.
add_property
(
"name"
,
&
Model
::
name
)
.
add_property
(
"referenceConfigurations"
,
&
Model
::
referenceConfigurations
)
.
def_readwrite
(
"name"
,
&
Model
::
name
)
.
def_readwrite
(
"referenceConfigurations"
,
&
Model
::
referenceConfigurations
)
.
def_readwrite
(
"rotorInertia"
,
&
Model
::
rotorInertia
,
"Vector of rotor inertia parameters."
)
...
...
examples/CMakeLists.txt
View file @
4dcea71b
...
...
@@ -67,7 +67,7 @@ IF(BUILD_PYTHON_INTERFACE)
inverse-dynamics-derivatives
)
IF
(
BUILD_WITH_U
D
RF_SUPPORT
)
IF
(
BUILD_WITH_UR
D
F_SUPPORT
)
LIST
(
APPEND
${
PROJECT_NAME
}
_PYTHON_EXAMPLES
overview-urdf
gepetto-viewer
...
...
@@ -77,7 +77,7 @@ IF(BUILD_PYTHON_INTERFACE)
robot-wrapper-viewer
geometry-models
)
ENDIF
(
BUILD_WITH_U
D
RF_SUPPORT
)
ENDIF
(
BUILD_WITH_UR
D
F_SUPPORT
)
IF
(
hpp-fcl_FOUND
)
LIST
(
APPEND
${
PROJECT_NAME
}
_PYTHON_EXAMPLES
...
...
examples/build-reduced-model.py
View file @
4dcea71b
import
pinocchio
as
pin
import
numpy
as
np
from
os.path
import
*
from
os.path
import
*
# Goal: Build a reduced model from an existing URDF model by fixing the desired joints at a specified position.
# Load UR robot arm
# This path refers to Pinocchio source code but you can define your own directory here.
pinocchio_model_dir
=
join
(
dirname
(
os
.
dirname
(
str
(
abspath
(
__file__
)))),
"models"
)
pinocchio_model_dir
=
join
(
dirname
(
dirname
(
str
(
abspath
(
__file__
)))),
"models"
)
model_path
=
pinocchio_model_dir
+
'/others/robots'
mesh_dir
=
model_path
# You should change here to set up your own URDF file
...
...
package.xml
View file @
4dcea71b
<?xml version="1.0"?>
<package
format=
"3"
>
<name>
pinocchio
</name>
<version>
2.5.
2
</version>
<version>
2.5.
3
</version>
<description>
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives.
</description>
<!-- The maintainer listed here is for the ROS release to receive emails for the buildfarm.
Please check the repository URL for full list of authors and maintainers. -->
...
...
unittest/python/bindings_model.py
View file @
4dcea71b
...
...
@@ -14,6 +14,7 @@ class TestModel(TestCase):
self
.
assertEqual
(
model
.
nbodies
,
1
)
self
.
assertEqual
(
model
.
nq
,
0
)
self
.
assertEqual
(
model
.
nv
,
0
)
model
.
name
=
"empty_model"
def
test_add_joint
(
self
):
model
=
pin
.
Model
()
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment