10#ifndef CROCODDYL_MULTIBODY_RESIDUALS_FRAME_TRANSLATION_HPP_
11#define CROCODDYL_MULTIBODY_RESIDUALS_FRAME_TRANSLATION_HPP_
13#include <pinocchio/multibody/fwd.hpp>
15#include "crocoddyl/multibody/fwd.hpp"
16#include "crocoddyl/core/residual-base.hpp"
17#include "crocoddyl/multibody/states/multibody.hpp"
18#include "crocoddyl/multibody/data/multibody.hpp"
19#include "crocoddyl/core/utils/exception.hpp"
36template <
typename _Scalar>
39 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
41 typedef _Scalar Scalar;
48 typedef typename MathBase::VectorXs VectorXs;
49 typedef typename MathBase::Vector3s Vector3s;
60 const Vector3s& xref,
const std::size_t nu);
72 const Vector3s& xref);
82 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
83 const Eigen::Ref<const VectorXs>& u);
92 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
93 const Eigen::Ref<const VectorXs>& u);
113 void set_id(
const pinocchio::FrameIndex
id);
125 virtual void print(std::ostream& os)
const;
135 pinocchio::FrameIndex id_;
137 boost::shared_ptr<typename StateMultibody::PinocchioModel> pin_model_;
140template <
typename _Scalar>
142 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
144 typedef _Scalar Scalar;
148 typedef typename MathBase::Matrix6xs Matrix6xs;
150 template <
template <
typename Scalar>
class Model>
152 :
Base(model, data),
fJf(6, model->get_state()->get_nv()) {
157 throw_pretty(
"Invalid argument: the shared data should be derived from DataCollectorMultibody");
178#include "crocoddyl/multibody/residuals/frame-translation.hxx"
Abstract class for residual models.
bool u_dependent_
Label that indicates if the residual function depends on u.
boost::shared_ptr< StateAbstract > state_
State description.
std::size_t nu_
Control dimension.
VectorXs unone_
No control vector.
bool v_dependent_
Label that indicates if the residual function depends on v.
Frame translation residual.
void set_reference(const Vector3s &reference)
Modify the reference frame translation reference.
const Vector3s & get_reference() const
Return the reference frame translation.
virtual boost::shared_ptr< ResidualDataAbstract > createData(DataCollectorAbstract *const data)
Create the frame translation residual data.
virtual void print(std::ostream &os) const
Print relevant information of the frame-translation residual.
void set_id(const pinocchio::FrameIndex id)
Modify the reference frame id.
ResidualModelFrameTranslationTpl(boost::shared_ptr< StateMultibody > state, const pinocchio::FrameIndex, const Vector3s &xref, const std::size_t nu)
Initialize the frame translation residual model.
ResidualModelFrameTranslationTpl(boost::shared_ptr< StateMultibody > state, const pinocchio::FrameIndex id, const Vector3s &xref)
Initialize the frame translation residual model.
virtual void calc(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the frame translation residual.
pinocchio::FrameIndex get_id() const
Return the reference frame id.
virtual void calcDiff(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the derivatives of the frame translation residual.
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.
Matrix6xs fJf
Local Jacobian of the frame.
DataCollectorAbstract * shared
Shared data allocated by the action model.
pinocchio::DataTpl< Scalar > * pinocchio
Pinocchio data.