Skip to content

Commit 4dcea71

Browse files
authored
Merge pull request #1339 from jcarpent/topic/python
Minor fixes
2 parents c4d9974 + b77ecf0 commit 4dcea71

File tree

6 files changed

+20
-18
lines changed

6 files changed

+20
-18
lines changed

bindings/python/multibody/geometry-object.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ namespace pinocchio
2323
: public boost::python::def_visitor< GeometryObjectPythonVisitor >
2424
{
2525
typedef GeometryObject::CollisionGeometryPtr CollisionGeometryPtr;
26-
26+
2727
template<class PyClass>
28-
void visit(PyClass& cl) const
28+
void visit(PyClass& cl) const
2929
{
3030
cl
3131
.def(bp::init<std::string,FrameIndex,JointIndex,CollisionGeometryPtr,SE3,
@@ -63,13 +63,13 @@ namespace pinocchio
6363
"Index of the parent frame.")
6464
.def_readwrite("placement",&GeometryObject::placement,
6565
"Position of geometry object in parent joint's frame.")
66-
.def_readonly("meshPath", &GeometryObject::meshPath,
67-
"Path to the mesh file.")
68-
.def_readonly("overrideMaterial", &GeometryObject::overrideMaterial,
69-
"Boolean that tells whether material information is stored inside the given GeometryObject.")
70-
.def_readonly("meshTexturePath", &GeometryObject::meshTexturePath,
71-
"Path to the mesh texture file.")
72-
66+
.def_readwrite("meshPath", &GeometryObject::meshPath,
67+
"Path to the mesh file.")
68+
.def_readwrite("overrideMaterial", &GeometryObject::overrideMaterial,
69+
"Boolean that tells whether material information is stored inside the given GeometryObject.")
70+
.def_readwrite("meshTexturePath", &GeometryObject::meshTexturePath,
71+
"Path to the mesh texture file.")
72+
7373
.def(bp::self == bp::self)
7474
.def(bp::self != bp::self)
7575

@@ -98,7 +98,7 @@ namespace pinocchio
9898
)
9999
.def(GeometryObjectPythonVisitor())
100100
;
101-
101+
102102
bp::enum_<GeometryType>("GeometryType")
103103
.value("VISUAL",VISUAL)
104104
.value("COLLISION",COLLISION)
@@ -107,7 +107,7 @@ namespace pinocchio
107107
}
108108

109109
};
110-
110+
111111

112112
} // namespace python
113113
} // namespace pinocchio

bindings/python/multibody/model.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ namespace pinocchio
220220
.add_property("nvs",&Model::nvs)
221221
.add_property("parents",&Model::parents)
222222
.add_property("names",&Model::names)
223-
.add_property("name",&Model::name)
224-
.add_property("referenceConfigurations", &Model::referenceConfigurations)
223+
.def_readwrite("name",&Model::name)
224+
.def_readwrite("referenceConfigurations", &Model::referenceConfigurations)
225225

226226
.def_readwrite("rotorInertia",&Model::rotorInertia,
227227
"Vector of rotor inertia parameters.")

examples/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ IF(BUILD_PYTHON_INTERFACE)
6767
inverse-dynamics-derivatives
6868
)
6969

70-
IF(BUILD_WITH_UDRF_SUPPORT)
70+
IF(BUILD_WITH_URDF_SUPPORT)
7171
LIST(APPEND ${PROJECT_NAME}_PYTHON_EXAMPLES
7272
overview-urdf
7373
gepetto-viewer
@@ -77,7 +77,7 @@ IF(BUILD_PYTHON_INTERFACE)
7777
robot-wrapper-viewer
7878
geometry-models
7979
)
80-
ENDIF(BUILD_WITH_UDRF_SUPPORT)
80+
ENDIF(BUILD_WITH_URDF_SUPPORT)
8181

8282
IF(hpp-fcl_FOUND)
8383
LIST(APPEND ${PROJECT_NAME}_PYTHON_EXAMPLES

examples/build-reduced-model.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import pinocchio as pin
22
import numpy as np
3-
from os.path import*
3+
4+
from os.path import *
45

56
# Goal: Build a reduced model from an existing URDF model by fixing the desired joints at a specified position.
67

78
# Load UR robot arm
89
# This path refers to Pinocchio source code but you can define your own directory here.
9-
pinocchio_model_dir = join(dirname(os.dirname(str(abspath(__file__)))), "models")
10+
pinocchio_model_dir = join(dirname(dirname(str(abspath(__file__)))), "models")
1011
model_path = pinocchio_model_dir + '/others/robots'
1112
mesh_dir = model_path
1213
# You should change here to set up your own URDF file

package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<package format="3">
33
<name>pinocchio</name>
4-
<version>2.5.2</version>
4+
<version>2.5.3</version>
55
<description>A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives.</description>
66
<!-- The maintainer listed here is for the ROS release to receive emails for the buildfarm.
77
Please check the repository URL for full list of authors and maintainers. -->

unittest/python/bindings_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def test_empty_model_sizes(self):
1414
self.assertEqual(model.nbodies, 1)
1515
self.assertEqual(model.nq, 0)
1616
self.assertEqual(model.nv, 0)
17+
model.name = "empty_model"
1718

1819
def test_add_joint(self):
1920
model = pin.Model()

0 commit comments

Comments
 (0)