9 #ifndef CROCODDYL_MULTIBODY_RESIDUALS_FRAME_VELOCITY_HPP_
10 #define CROCODDYL_MULTIBODY_RESIDUALS_FRAME_VELOCITY_HPP_
12 #include <pinocchio/multibody/fwd.hpp>
13 #include <pinocchio/spatial/motion.hpp>
15 #include "crocoddyl/core/residual-base.hpp"
16 #include "crocoddyl/core/utils/exception.hpp"
17 #include "crocoddyl/multibody/data/multibody.hpp"
18 #include "crocoddyl/multibody/fwd.hpp"
19 #include "crocoddyl/multibody/states/multibody.hpp"
39 template <
typename _Scalar>
42 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
44 typedef _Scalar Scalar;
51 typedef pinocchio::MotionTpl<Scalar> Motion;
52 typedef typename MathBase::VectorXs VectorXs;
65 const pinocchio::FrameIndex
id,
66 const Motion& velocity,
67 const pinocchio::ReferenceFrame type,
68 const std::size_t nu);
82 const pinocchio::FrameIndex
id,
83 const Motion& velocity,
84 const pinocchio::ReferenceFrame type);
94 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract>& data,
95 const Eigen::Ref<const VectorXs>& x,
96 const Eigen::Ref<const VectorXs>& u);
105 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract>& data,
106 const Eigen::Ref<const VectorXs>& x,
107 const Eigen::Ref<const VectorXs>& u);
133 void set_id(
const pinocchio::FrameIndex
id);
143 void set_type(
const pinocchio::ReferenceFrame type);
150 virtual void print(std::ostream& os)
const;
159 pinocchio::FrameIndex id_;
161 pinocchio::ReferenceFrame type_;
162 boost::shared_ptr<typename StateMultibody::PinocchioModel>
166 template <
typename _Scalar>
168 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
170 typedef _Scalar Scalar;
174 typedef typename MathBase::Matrix6xs Matrix6xs;
176 template <
template <
typename Scalar>
class Model>
179 :
Base(model, data) {
185 "Invalid argument: the shared data should be derived from "
186 "DataCollectorMultibody");
205 #include "crocoddyl/multibody/residuals/frame-velocity.hxx"
Abstract class for residual models.
boost::shared_ptr< StateAbstract > state_
State description.
std::size_t nu_
Control dimension.
std::size_t nr_
Residual vector dimension.
const Motion & get_reference() const
Return the reference velocity.
virtual void print(std::ostream &os) const
Print relevant information of the frame-velocity residual.
void set_reference(const Motion &velocity)
Modify reference velocity.
ResidualModelFrameVelocityTpl(boost::shared_ptr< StateMultibody > state, const pinocchio::FrameIndex id, const Motion &velocity, const pinocchio::ReferenceFrame type)
Initialize the frame velocity residual model.
ResidualModelFrameVelocityTpl(boost::shared_ptr< StateMultibody > state, const pinocchio::FrameIndex id, const Motion &velocity, const pinocchio::ReferenceFrame type, const std::size_t nu)
Initialize the frame velocity residual model.
void set_id(const pinocchio::FrameIndex id)
Modify reference frame id.
virtual void calc(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the frame velocity residual vector.
pinocchio::FrameIndex get_id() const
Return the reference frame id.
void set_type(const pinocchio::ReferenceFrame type)
Modify reference type of velocity.
virtual void calcDiff(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the Jacobians of the frame velocity residual.
pinocchio::ReferenceFrame get_type() const
Return the reference type of velocity.
virtual boost::shared_ptr< ResidualDataAbstract > createData(DataCollectorAbstract *const data)
Create the frame velocity residual data.
State multibody representation.
MatrixXs Ru
Jacobian of the residual vector with respect the control.
MatrixXs Rx
Jacobian of the residual vector with respect the state.
DataCollectorAbstract * shared
Shared data allocated by the action model.
VectorXs r
Residual vector.
DataCollectorAbstract * shared
Shared data allocated by the action model.
pinocchio::DataTpl< Scalar > * pinocchio
Pinocchio data.