This section describes how to port your code from the Pinocchio 2 to Pinocchio 3.
All Pinocchio 2 deprecated functions had been removed.
The following functions and headers have been renamed or moved:
pinocchio::BiasZeroTpl
by pinocchio::MotionZeroTpl
pinocchio::fusion::JointVisitorBase
by pinocchio::fusion::JointUnaryVisitorBase
pinocchio::fusion::push_front
by pinocchio::fusion::append
pinocchio::regressor::computeStaticRegressor
by pinocchio::computeStaticRegressor
pinocchio::jointJacobian
by pinocchio::computeJointJacobian
pinocchio::frameJacobian
by pinocchio::computeFrameJacobian
pinocchio::framesForwardKinematics
by pinocchio::updateFramePlacements
pinocchio::kineticEnergy
by pinocchio::computeKineticEnergy
pinocchio::potentialEnergy
by pinocchio::computePotentialEnergy
pinocchio::computeCentroidalDynamics
by pinocchio::computeCentroidalMomentum
and pinocchio::computeCentroidalMomentumTimeVariation
pinocchio::centerOfMass(const ModelTpl&, DataTpl&, int, bool)
by pinocchio::centerOfMass(const ModelTpl&, DataTpl&, KinematicLevel, bool)
pinocchio::copy(const ModelTpl&, const DataTpl&, DataTpl&, int)
by pinocchio::copy(const ModelTpl&, const DataTpl&, DataTpl&, KinematicLevel)
pinocchio/algorithm/dynamics.hpp
by pinocchio/algorithm/constrained-dynamics.hpp
pinocchio::GeometryObject
's constructorsIf the compiler complains about missing pinocchio::computeDistances
or pinocchio::computeCollisions
function you can either:
PINOCCHIO_ENABLE_COMPATIBILITY_WITH_VERSION_2
when building your projectThe following functions have been removed:
pinocchio::setGeometryMeshScales
pinocchio::forwardDynamics
signaturespinocchio::impulseDynamics
signaturesThe following functions and headers are now deprecated:
pinocchio/algorithm/parallel/geometry.hpp
moved at pinocchio/collision/parallel/geometry.hpp
pinocchio/spatial/fcl-pinocchio-conversions.hpp
moved at pinocchio/collision/fcl-pinocchio-conversions.hpp
pinocchio/parsers/sample-models.hpp
moved at pinocchio/multibody/sample-models.hpp
pinocchio/math/cppad.hpp
moved at pinocchio/autodiff/cppad.hpp
pinocchio/math/cppadcg.hpp
moved at pinocchio/autodiff/cppadcg.hpp
pinocchio/math/casadi.hpp
moved at pinocchio/autodiff/casadi.hpp
pinocchio::FrameTpl::parent
replaced by pinocchio::FrameTpl::parentJoint
pinocchio::FrameTpl::previousFrame
replaced by pinocchio::FrameTpl::parentFrame
pinocchio/algorithm/contact-dynamics.hpp
algorithms replaced by pinocchio/algorithm/constrained-dynamics.hpp
Pinocchio 3 has been split into multiple CMake targets:
pinocchio
: Link against all available Pinocchio librariespinocchio_headers
: Link against Pinocchio header only core librarypinocchio_double
: Link against Pinocchio core library explicitly template instantiated for double scalar typepinocchio_casadi
: Link against Pinocchio core library explicitly template instantiated for casadi scalar typepinocchio_cppad
: Link against Pinocchio core library explicitly template instantiated for cppad scalar typepinocchio_cppadcg
: Link against Pinocchio core library explicitly template instantiated for cppadcg scalar typepinocchio_parsers
: Link against Pinocchio parsers librarypinocchio_parallel
: Link against Pinocchio parallel algorithms librarypinocchio_collision
: Link against Pinocchio collision librarypinocchio_collision_parallel
: Link against Pinocchio collision parallel algorithms librarypinocchio_extra
: Link against Pinocchio extra algorithms libraryAll Pinocchio 2 deprecated functions had been removed.
The following functions have been renamed or moved:
pinocchio.utils.skew
by pinocchio.skew
pinocchio.utils.se3ToXYZQUAT
by pinocchio.SE3ToXYZQUATtuple
pinocchio.utils.XYZQUATToSe3
by pinocchio.XYZQUATToSE3
pinocchio.robot_wrapper.RobotWrapper.frameClassicAcceleration
by pinocchio.robot_wrapper.RobotWrapper.frameClassicalAcceleration
pinocchio.robot_wrapper.RobotWrapper.jointJacobian
by pinocchio.robot_wrapper.RobotWrapper.computeJointJacobian
pinocchio.robot_wrapper.RobotWrapper.frameJacobian
by pinocchio.robot_wrapper.RobotWrapper.computeFrameJacobian
pinocchio.robot_wrapper.RobotWrapper.initDisplay
by pinocchio.robot_wrapper.RobotWrapper.initViewer
pinocchio.robot_wrapper.RobotWrapper.loadDisplayModel
by pinocchio.robot_wrapper.RobotWrapper.loadViewerModel
pinocchio.deprecated.se3ToXYZQUATtuple
by pinocchio.SE3ToXYZQUATtuple
pinocchio.deprecated.se3ToXYZQUAT
by pinocchio.SE3ToXYZQUAT
pinocchio.deprecated.XYZQUATToSe3
by pinocchio.XYZQUATToSE3
pinocchio.deprecated.buildGeomFromUrdf(model, filename, [str])
by pinocchio.buildGeomFromUrdf(model, filename, type, package_dirs, mesh_loader)
pinocchio.rpy.npToTTuple
by pinocchio.utils.npToTTuple
pinocchio.rpy.npToTuple
by pinocchio.utils.npToTuple
pinocchio.jacobianSubtreeCoMJacobian
by pinocchio.jacobianSubtreeCenterOfMass
The following functions have been removed:
pinocchio.utils.cross
pinocchio.robot_wrapper.RobotWrapper.initMeshcatDisplay
pinocchio.deprecated.setGeometryMeshScales
by pinocchio
This section describes how to port your code from the latest Pinocchio 1 release (1.3.3) to 2.0.
Note that this section does not cover API changes that were made before Pinocchio 1.3.3. Therefore, if you are still using an older version of Pinocchio 1, it is recommended that before you switch to 2.0 you should upgrade to 1.3.3 and make sure everything still works. In particular, remove all calls to deprecated methods and replace them appropriately.
The vast majority of the changes took place in C++.
Although the class system was heavily re-worked, it should not make a lot of difference from the user's point of view. Relevant changes are listed below.
Pinocchio is now fully header-only. This means you do not have to link to the Pinocchio library when compiling your code. On the other hand, you might need to link to additional system libraries.
The most important change is the namespace. Now, the top-level Pinocchio namespace is not se3
anymore, but pinocchio
.
Therefore, all occurrences of se3
in your code should be replaced by pinocchio
.
If you feel like "pinocchio" is too long to type but you do not want to employ using namespace pinocchio
, you can use
Your code will not compile if you try to use namespace se3
. In order to make it work, you need to compile it with the following flag
The following marcos are not employed anymore
in favor of
Therefore, you now need to issue the new macros in your compilation commands.
If you are using them in your code, in order to make them work, you can do
Many methods which were taking a ReferenceFrame = {WORLD/LOCAL}
enum as template parameter, such as getJointJacobian
, are now deprecated. The reference frame is now passed as an input. For instance, you should switch from
to
Notice that in principle your old code will still work, but you will get deprecation warnings.
Changes in Python are relatively minor.
No real changes took place, but you are encouraged to stop using the idiom import pinocchio as se3
.
From now on, the recommended practice is import pinocchio as pin
.
The constructor signature has changed from
to
so that a model can be directly provided without the need of resorting to URDF. To recover the previous construction technique, you can use the static method
Also, the signature
was changed to
which should not change anything if you were only ever calling it with two arguments.