Unverified Commit 4e9ed4fc authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #1314 from jcarpent/topic/python

Fix bug + improve Python doc
parents 5cec00cd f1b6d8a2
Pipeline #11764 failed with stage
in 154 minutes and 4 seconds
......@@ -56,7 +56,7 @@ jobs:
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^
-DBUILD_WITH_URDF_SUPPORT=ON ^
-DBUILD_PYTHON_INTERFACE=OFF ^
-DBUILD_WITH_COLLISION_SUPPORT=OFF ^
-DBUILD_WITH_COLLISION_SUPPORT=ON ^
..
:: Build
......
......@@ -342,7 +342,8 @@ int main(int argc, const char ** argv)
updateFramePlacements(model, data);
total += timer.toc(timer.DEFAULT_UNIT);
}
std::cout << "Update Frame Placement = \t"; timer.toc(std::cout,NBT);
std::cout << "Update Frame Placement = \t" << (total/NBT)
<< " " << timer.unitName(timer.DEFAULT_UNIT) << std::endl;
timer.tic();
......
......@@ -63,12 +63,12 @@ namespace pinocchio
void visit(PyClass& cl) const
{
cl
.def(bp::init<>("Default constructor"))
.def(bp::init<>(bp::arg("self"),"Default constructor"))
.def(bp::init<Vector3,Vector3>
((bp::arg("linear"),bp::arg("angular")),
((bp::arg("self"),bp::arg("linear"),bp::arg("angular")),
"Initialize from linear and angular components of a Wrench vector (don't mix the order)."))
.def(bp::init<Vector6>((bp::arg("Vector 6d")),"Init from a vector 6 [force,torque]"))
.def(bp::init<Force>((bp::arg("other")),"Copy constructor."))
.def(bp::init<Vector6>((bp::args("self","array")),"Init from a vector 6 [force,torque]"))
.def(bp::init<Force>((bp::args("self","other")),"Copy constructor."))
.add_property("linear",
bp::make_function(&ForcePythonVisitor::getLinear,
......@@ -139,7 +139,7 @@ namespace pinocchio
bp::class_<Force>("Force",
"Force vectors, in se3* == F^6.\n\n"
"Supported operations ...",
bp::init<>())
bp::no_init)
.def(ForcePythonVisitor<Force>())
.def(CopyableVisitor<Force>())
.def(PrintableVisitor<Force>())
......
......@@ -68,7 +68,7 @@ namespace pinocchio
bp::default_call_policies(),
(bp::arg("mass"),bp::arg("lever"),bp::arg("inertia"))),
"Initialize from mass, lever and 3d inertia.")
.def(bp::init<Inertia>((bp::arg("other")),"Copy constructor."))
.def(bp::init<Inertia>((bp::arg("self"),bp::arg("other")),"Copy constructor."))
.add_property("mass",
&InertiaPythonVisitor::getMass,
......@@ -210,7 +210,7 @@ namespace pinocchio
bp::class_<Inertia>("Inertia",
"This class represenses a sparse version of a Spatial Inertia and its is defined by its mass, its center of mass location and the rotational inertia expressed around this center of mass.\n\n"
"Supported operations ...",
bp::init<>())
bp::init<>(bp::arg("self"),"Default constructor."))
.def(InertiaPythonVisitor<Inertia>())
.def(CopyableVisitor<Inertia>())
.def(PrintableVisitor<Inertia>())
......
......@@ -67,12 +67,12 @@ namespace pinocchio
void visit(PyClass& cl) const
{
cl
.def(bp::init<>("Default constructor"))
.def(bp::init<>(bp::arg("self"),"Default constructor"))
.def(bp::init<Vector3,Vector3>
((bp::arg("linear"),bp::arg("angular")),
((bp::arg("self"),bp::arg("linear"),bp::arg("angular")),
"Initialize from linear and angular components of a Motion vector (don't mix the order)."))
.def(bp::init<Vector6>((bp::arg("vec")),"Init from a vector 6 [linear velocity, angular velocity]"))
.def(bp::init<Motion>((bp::arg("other")),"Copy constructor."))
.def(bp::init<Vector6>((bp::arg("self"),bp::arg("array")),"Init from a vector 6 [linear velocity, angular velocity]"))
.def(bp::init<Motion>((bp::arg("self"),bp::arg("other")),"Copy constructor."))
.add_property("linear",
bp::make_function(&MotionPythonVisitor::getLinear,
......@@ -153,7 +153,7 @@ namespace pinocchio
bp::class_<Motion>("Motion",
"Motion vectors, in se3 == M^6.\n\n"
"Supported operations ...",
bp::init<>())
bp::no_init)
.def(MotionPythonVisitor<Motion>())
.def(CopyableVisitor<Motion>())
.def(PrintableVisitor<Motion>())
......
......@@ -62,15 +62,15 @@ namespace pinocchio
{
cl
.def(bp::init<Matrix3,Vector3>
((bp::arg("rotation"),bp::arg("translation")),
((bp::arg("self"),bp::arg("rotation"),bp::arg("translation")),
"Initialize from a rotation matrix and a translation vector."))
.def(bp::init<Quaternion,Vector3>
((bp::arg("quat"),bp::arg("translation")),
((bp::arg("self"),bp::arg("quat"),bp::arg("translation")),
"Initialize from a quaternion and a translation vector."))
.def(bp::init<int>((bp::arg("int")),"Init to identity."))
.def(bp::init<SE3>((bp::arg("other")), "Copy constructor."))
.def(bp::init<int>((bp::arg("self"),bp::arg("int")),"Init to identity."))
.def(bp::init<SE3>((bp::arg("self"),bp::arg("other")), "Copy constructor."))
.def(bp::init<Matrix4>
((bp::arg("homegeneous_matrix")),
((bp::arg("self"),bp::arg("array")),
"Initialize from an homogeneous matrix."))
.add_property("rotation",
......@@ -180,7 +180,7 @@ namespace pinocchio
{
bp::class_<SE3>("SE3",
"SE3 transformation defined by a 3d vector and a rotation matrix.",
bp::init<>())
bp::init<>(bp::arg("self"),"Default constructor."))
.def(SE3PythonVisitor<SE3>())
.def(CopyableVisitor<SE3>())
.def(PrintableVisitor<SE3>())
......
......@@ -200,7 +200,7 @@ namespace pinocchio
typedef details::AppendJointOfModelAlgoTpl<Scalar, Options, JointCollectionTpl> AppendJointOfModelAlgo;
typedef typename AppendJointOfModelAlgo::ArgsType ArgsType;
PINOCCHIO_CHECK_INPUT_ARGUMENT(frameInModelA < (FrameIndex) modelA.nframes,
PINOCCHIO_CHECK_INPUT_ARGUMENT((bool)(frameInModelA < (FrameIndex) modelA.nframes),
"frameInModelA is an invalid Frame index, greater than the number of frames contained in modelA.");
typedef ModelTpl<Scalar,Options,JointCollectionTpl> Model;
......@@ -489,8 +489,8 @@ namespace pinocchio
const GeometryModel::GeometryObject & geom = *it;
const JointIndex joint_id_in_input_model = geom.parentJoint;
PINOCCHIO_CHECK_INPUT_ARGUMENT(joint_id_in_input_model < (JointIndex)input_model.njoints,
"Invalid joint parent index for the geometry with name " + geom.name);
_PINOCCHIO_CHECK_INPUT_ARGUMENT_2((joint_id_in_input_model < (JointIndex)input_model.njoints),
"Invalid joint parent index for the geometry with name " + geom.name);
const std::string & parent_joint_name = input_model.names[joint_id_in_input_model];
JointIndex reduced_joint_id = (JointIndex)-1;
......
......@@ -195,13 +195,13 @@ namespace pinocchio
/// The object contains a pointer on the collision geometries contained in geomModel.geometryObjects.
/// \sa GeometryModel::geometryObjects and GeometryObjects
///
std::vector<fcl::CollisionObject> collisionObjects PINOCCHIO_DEPRECATED;
PINOCCHIO_DEPRECATED std::vector<fcl::CollisionObject> collisionObjects;
///
/// \brief Defines what information should be computed by distance computation.
///
/// \deprecated use \ref distanceRequests instead
fcl::DistanceRequest distanceRequest PINOCCHIO_DEPRECATED;
PINOCCHIO_DEPRECATED fcl::DistanceRequest distanceRequest;
///
/// \brief Defines what information should be computed by distance computation.
......@@ -217,7 +217,7 @@ namespace pinocchio
/// \brief Defines what information should be computed by collision test.
///
/// \deprecated use \ref collisionRequests instead
fcl::CollisionRequest collisionRequest PINOCCHIO_DEPRECATED;
PINOCCHIO_DEPRECATED fcl::CollisionRequest collisionRequest;
///
/// \brief Defines what information should be computed by collision test.
......
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