Unverified Commit 4dcea71b authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
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
......@@ -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_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)
......@@ -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
......
......@@ -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.")
......
......@@ -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
......@@ -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
......
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
......
<?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. -->
......
......@@ -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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment