Skip to content
Snippets Groups Projects
Commit 5b81caf1 authored by jcarpent's avatar jcarpent
Browse files

[Python] Add copy constructor to spatial classes

parent 40b10a75
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,7 @@ namespace se3
((bp::arg("linear"),bp::arg("angular")),
"Initialize from linear and angular components (dont mix the order)."))
.def(bp::init<Vector6_fx>((bp::arg("Vector 6d")),"Init from vector 6 [f,n]"))
.def(bp::init<Force_fx>((bp::arg("other")),"Copy constructor."))
.add_property("linear",&ForcePythonVisitor::getLinear,&ForcePythonVisitor::setLinear)
.add_property("angular",&ForcePythonVisitor::getAngular,&ForcePythonVisitor::setAngular)
......
......@@ -75,6 +75,7 @@ namespace se3
bp::default_call_policies(),
(bp::arg("mass"),bp::arg("lever"),bp::arg("inertia"))),
"Initialize from mass, lever and 3d inertia.")
.def(bp::init<Inertia_fx>((bp::arg("other")),"Copy constructor."))
.add_property("mass", &InertiaPythonVisitor::getMass, &InertiaPythonVisitor::setMass)
.add_property("lever", &InertiaPythonVisitor::getLever, &InertiaPythonVisitor::setLever)
......
......@@ -73,6 +73,7 @@ namespace se3
((bp::arg("linear"),bp::arg("angular")),
"Initialize from linear and angular components (dont mix the order)."))
.def(bp::init<Vector6_fx>((bp::arg("Vector 6d")),"Init from vector 6 [v,w]"))
.def(bp::init<Motion_fx>((bp::arg("other")),"Copy constructor."))
.add_property("linear",&MotionPythonVisitor::getLinear,&MotionPythonVisitor::setLinear)
.add_property("angular",&MotionPythonVisitor::getAngular,&MotionPythonVisitor::setAngular)
......
//
// Copyright (c) 2015 CNRS
// Copyright (c) 2015-2016 CNRS
// Copyright (c) 2016 Wandercraft, 86 rue de Paris 91400 Orsay, France.
//
// This file is part of Pinocchio
......@@ -67,13 +67,12 @@ namespace se3
template<class PyClass>
void visit(PyClass& cl) const
{
cl
.def(bp::init<Matrix3_fx,Vector3_fx>
((bp::arg("Rotation"),bp::arg("translation")),
"Initialize from rotation and translation."))
.def(bp::init<int>
((bp::arg("trivial arg (should be 1)")),
"Init to identity."))
cl
.def(bp::init<Matrix3_fx,Vector3_fx>
((bp::arg("Rotation"),bp::arg("translation")),
"Initialize from rotation and translation."))
.def(bp::init<int>((bp::arg("trivial arg (should be 1)")),"Init to identity."))
.def(bp::init<SE3_fx> ((bp::arg("other")), "Copy constructor."))
.add_property("rotation",&SE3PythonVisitor::getRotation,&SE3PythonVisitor::setRotation)
.add_property("translation",&SE3PythonVisitor::getTranslation,&SE3PythonVisitor::setTranslation)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment