TransformFunction.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2022 CNRS-UM LIRMM, CNRS-AIST JRL
3  */
4 
5 #pragma once
6 
7 #include <mc_tvm/api.h>
8 #include <mc_tvm/fwd.h>
9 
10 #include <mc_rbdyn/fwd.h>
11 
12 #include <tvm/function/abstract/Function.h>
13 
14 #include <RBDyn/Jacobian.h>
15 
16 #include <SpaceVecAlg/SpaceVecAlg>
17 
18 namespace mc_tvm
19 {
20 
22 class MC_TVM_DLLAPI TransformFunction : public tvm::function::abstract::Function
23 {
24 public:
25  SET_UPDATES(TransformFunction, Value, Velocity, Jacobian, NormalAcceleration)
26 
27 
33 
35  void reset();
36 
38  inline const sva::PTransformd & pose() const noexcept { return pose_; }
39 
41  inline void pose(const sva::PTransformd & pose) noexcept { pose_ = pose; }
42 
44  inline const Eigen::Vector6d & refVel() const noexcept { return refVel_; }
45 
47  inline void refVel(const Eigen::Vector6d & refVel) noexcept { refVel_ = refVel; }
48 
50  inline const Eigen::Vector6d & refAccel() const noexcept { return refAccel_; }
51 
53  inline void refAccel(const Eigen::Vector6d & refAccel) noexcept { refAccel_ = refAccel; }
54 
56  inline const mc_rbdyn::RobotFrame & frame() const noexcept { return *frame_; }
57 
58 protected:
59  void updateValue();
60  void updateVelocity();
61  void updateJacobian();
62  void updateNormalAcceleration();
63 
66 
68  rbd::Jacobian frameJac_;
69  Eigen::MatrixXd shortJacMat_;
70  Eigen::MatrixXd jacMat_;
71  sva::MotionVecd err_p_;
72  sva::MotionVecd w_p_p_;
73  sva::MotionVecd V_err_p_;
74 
76  sva::PTransformd pose_;
77  Eigen::Vector6d refVel_;
78  Eigen::Vector6d refAccel_;
79 };
80 
81 } // namespace mc_tvm
mc_tvm::TransformFunction::frame
const mc_rbdyn::RobotFrame & frame() const noexcept
Definition: TransformFunction.h:56
mc_tvm::TransformFunction::refVel
const Eigen::Vector6d & refVel() const noexcept
Definition: TransformFunction.h:44
mc_tvm::TransformFunction::pose
const sva::PTransformd & pose() const noexcept
Definition: TransformFunction.h:38
mc_tvm::TransformFunction::jacMat_
Eigen::MatrixXd jacMat_
Definition: TransformFunction.h:70
mc_tvm::TransformFunction::refVel
void refVel(const Eigen::Vector6d &refVel) noexcept
Definition: TransformFunction.h:47
MC_TVM_DLLAPI
#define MC_TVM_DLLAPI
Definition: api.h:47
mc_tvm::TransformFunction::frameJac_
rbd::Jacobian frameJac_
Definition: TransformFunction.h:68
mc_tvm
Definition: CollisionFunction.h:15
mc_tvm::TransformFunction::pose_
sva::PTransformd pose_
Definition: TransformFunction.h:76
mc_tvm::TransformFunction::tvm_frame_
mc_tvm::RobotFrame & tvm_frame_
Definition: TransformFunction.h:65
mc_rbdyn::RobotFrame
Definition: RobotFrame.h:21
mc_tvm::TransformFunction::refAccel
const Eigen::Vector6d & refAccel() const noexcept
Definition: TransformFunction.h:50
mc_tvm::TransformFunction::pose
void pose(const sva::PTransformd &pose) noexcept
Definition: TransformFunction.h:41
fwd.h
fwd.h
mc_tvm::TransformFunction::refVel_
Eigen::Vector6d refVel_
Definition: TransformFunction.h:77
mc_rbdyn::ConstRobotFramePtr
std::shared_ptr< const RobotFrame > ConstRobotFramePtr
Definition: fwd.h:25
mc_tvm::RobotFrame
Definition: RobotFrame.h:27
mc_tvm::TransformFunction::shortJacMat_
Eigen::MatrixXd shortJacMat_
Definition: TransformFunction.h:69
mc_tvm::TransformFunction::V_err_p_
sva::MotionVecd V_err_p_
Definition: TransformFunction.h:73
mc_tvm::TransformFunction::refAccel_
Eigen::Vector6d refAccel_
Definition: TransformFunction.h:78
mc_tvm::TransformFunction::frame_
mc_rbdyn::ConstRobotFramePtr frame_
Definition: TransformFunction.h:64
api.h
mc_tvm::TransformFunction::refAccel
void refAccel(const Eigen::Vector6d &refAccel) noexcept
Definition: TransformFunction.h:53
mc_tvm::TransformFunction::w_p_p_
sva::MotionVecd w_p_p_
Definition: TransformFunction.h:72
mc_tvm::TransformFunction::err_p_
sva::MotionVecd err_p_
Definition: TransformFunction.h:71
mc_tvm::TransformFunction
Definition: TransformFunction.h:22