Skip to content

Commit

Permalink
Merge pull request #1339 from jcarpent/topic/python
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
jcarpent authored Nov 13, 2020
2 parents c4d9974 + b77ecf0 commit 4dcea71
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
22 changes: 11 additions & 11 deletions bindings/python/multibody/geometry-object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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_readonly("meshPath", &GeometryObject::meshPath,
"Path to the mesh file.")
.def_readonly("overrideMaterial", &GeometryObject::overrideMaterial,
"Boolean that tells whether material information is stored inside the given GeometryObject.")
.def_readonly("meshTexturePath", &GeometryObject::meshTexturePath,
"Path to the mesh texture file.")
.def_readwrite("meshPath", &GeometryObject::meshPath,
"Path to the mesh file.")
.def_readwrite("overrideMaterial", &GeometryObject::overrideMaterial,
"Boolean that tells whether material information is stored inside the given GeometryObject.")
.def_readwrite("meshTexturePath", &GeometryObject::meshTexturePath,
"Path to the mesh texture file.")

.def(bp::self == bp::self)
.def(bp::self != bp::self)

Expand Down Expand Up @@ -98,7 +98,7 @@ namespace pinocchio
)
.def(GeometryObjectPythonVisitor())
;

bp::enum_<GeometryType>("GeometryType")
.value("VISUAL",VISUAL)
.value("COLLISION",COLLISION)
Expand All @@ -107,7 +107,7 @@ namespace pinocchio
}

};


} // namespace python
} // namespace pinocchio
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/multibody/model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ IF(BUILD_PYTHON_INTERFACE)
inverse-dynamics-derivatives
)

IF(BUILD_WITH_UDRF_SUPPORT)
IF(BUILD_WITH_URDF_SUPPORT)
LIST(APPEND ${PROJECT_NAME}_PYTHON_EXAMPLES
overview-urdf
gepetto-viewer
Expand All @@ -77,7 +77,7 @@ IF(BUILD_PYTHON_INTERFACE)
robot-wrapper-viewer
geometry-models
)
ENDIF(BUILD_WITH_UDRF_SUPPORT)
ENDIF(BUILD_WITH_URDF_SUPPORT)

IF(hpp-fcl_FOUND)
LIST(APPEND ${PROJECT_NAME}_PYTHON_EXAMPLES
Expand Down
5 changes: 3 additions & 2 deletions examples/build-reduced-model.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
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
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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. -->
Expand Down
1 change: 1 addition & 0 deletions unittest/python/bindings_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def test_empty_model_sizes(self):
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()
Expand Down

0 comments on commit 4dcea71

Please sign in to comment.