From ae930ac3ad27022a720e8f3029d4f1a28b2c30c2 Mon Sep 17 00:00:00 2001 From: Joseph Mirabel <jmirabel@laas.fr> Date: Sun, 11 Nov 2018 09:45:29 +0100 Subject: [PATCH] Update to pinocchio v2 --- include/hpp/manipulation/fwd.hh | 4 ++-- src/device.cc | 11 +++++------ src/graph/helper.cc | 4 ++-- src/handle.cc | 4 ++-- src/steering-method/cross-state-optimization.cc | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/include/hpp/manipulation/fwd.hh b/include/hpp/manipulation/fwd.hh index f203ccd..e101c1c 100644 --- a/include/hpp/manipulation/fwd.hh +++ b/include/hpp/manipulation/fwd.hh @@ -32,8 +32,8 @@ namespace hpp { typedef pinocchio::JointPtr_t JointPtr_t; typedef pinocchio::JointIndex JointIndex; typedef std::vector<JointIndex> JointIndices_t; - typedef se3::FrameIndex FrameIndex; - typedef std::vector<se3::FrameIndex> FrameIndices_t; + typedef pinocchio::FrameIndex FrameIndex; + typedef std::vector<pinocchio::FrameIndex> FrameIndices_t; typedef pinocchio::Configuration_t Configuration_t; typedef pinocchio::ConfigurationIn_t ConfigurationIn_t; typedef pinocchio::ConfigurationOut_t ConfigurationOut_t; diff --git a/src/device.cc b/src/device.cc index d4f0109..680a5ea 100644 --- a/src/device.cc +++ b/src/device.cc @@ -29,8 +29,7 @@ namespace hpp { namespace manipulation { - using se3::Frame; - using se3::FrameIndex; + using ::pinocchio::Frame; pinocchio::DevicePtr_t Device::clone () const { @@ -48,7 +47,7 @@ namespace hpp { pinocchio::GeomModel& gm = geomModel(); // The root frame should be the first frame. Frame& rootFrame = m.frames[idxs[0]]; - if (rootFrame.type == se3::JOINT) { + if (rootFrame.type == ::pinocchio::JOINT) { JointIndex jid = m.getJointId (rootFrame.name); m.jointPlacements[jid] = t; return; @@ -61,16 +60,16 @@ namespace hpp { if (frame.parent == rootFrame.parent) { // frame is between rootFrame and next moving joints. frame.placement = shift * frame.placement; - if (frame.type == se3::BODY) { + if (frame.type == ::pinocchio::BODY) { // Update the geometry object placement. for (std::size_t k = 0; k < gm.geometryObjects.size(); ++k) { - se3::GeometryObject& go = gm.geometryObjects[k]; + ::pinocchio::GeometryObject& go = gm.geometryObjects[k]; if (go.parentFrame == idxs[i]) go.placement = shift * go.placement; } } - } else if ((frame.type == se3::JOINT) && (rootFrame.parent == m.parents[frame.parent])) { + } else if ((frame.type == ::pinocchio::JOINT) && (rootFrame.parent == m.parents[frame.parent])) { // frame corresponds to a child joint of rootFrame.parent m.jointPlacements[frame.parent] = shift * m.jointPlacements[frame.parent]; } diff --git a/src/graph/helper.cc b/src/graph/helper.cc index 66598e5..0e13b17 100644 --- a/src/graph/helper.cc +++ b/src/graph/helper.cc @@ -1103,8 +1103,8 @@ namespace hpp { // Loop over all frames of object, detect joint and create locked // joint. assert (robot.frameIndices.has (od.name)); - BOOST_FOREACH (const se3::FrameIndex& f, robot.frameIndices.get (od.name)) { - if (model.frames[f].type != se3::JOINT) continue; + BOOST_FOREACH (const FrameIndex& f, robot.frameIndices.get (od.name)) { + if (model.frames[f].type != ::pinocchio::JOINT) continue; const JointIndex j = model.frames[f].parent; JointPtr_t oj (new Joint (ps->robot(), j)); LiegroupSpacePtr_t space (oj->configurationSpace ()); diff --git a/src/handle.cc b/src/handle.cc index 1022ad1..2be7858 100644 --- a/src/handle.cc +++ b/src/handle.cc @@ -21,7 +21,7 @@ #include <boost/assign/list_of.hpp> -#include <pinocchio/multibody/joint/joint.hpp> +#include <pinocchio/multibody/joint/joint-generic.hpp> #include <hpp/util/debug.hh> @@ -62,7 +62,7 @@ namespace hpp { bool isHandleOnFreeflyer (const Handle& handle) { - if (handle.joint()->jointModel().shortname() == se3::JointModelFreeFlyer::classname() + if (handle.joint()->jointModel().shortname() == ::pinocchio::JointModelFreeFlyer::classname() && !handle.joint ()->parentJoint ()) { return true; } diff --git a/src/steering-method/cross-state-optimization.cc b/src/steering-method/cross-state-optimization.cc index a154034..53d0255 100644 --- a/src/steering-method/cross-state-optimization.cc +++ b/src/steering-method/cross-state-optimization.cc @@ -549,7 +549,7 @@ namespace hpp { bool _saturate (vectorIn_t q, vectorOut_t qSat, Eigen::VectorXi& sat) { bool ret = false; - const se3::Model& model = robot->model(); + const pinocchio::Model& model = robot->model(); for (std::size_t i = 1; i < model.joints.size(); ++i) { const size_type jnq = model.joints[i].nq(); -- GitLab