VectorOrientationFunction.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 namespace mc_tvm
17 {
18 
21 class MC_TVM_DLLAPI VectorOrientationFunction : public tvm::function::abstract::Function
22 {
23 public:
24  SET_UPDATES(VectorOrientationFunction, Value, Velocity, Jacobian, NormalAcceleration)
25 
26 
31  VectorOrientationFunction(const mc_rbdyn::RobotFrame & frame, const Eigen::Vector3d & frameVector);
32 
34  void reset();
35 
37  inline const Eigen::Vector3d & target() const noexcept { return target_; }
38 
40  inline void target(const Eigen::Vector3d & target) noexcept { target_ = target; }
41 
43  inline const Eigen::Vector3d & frameVector() const noexcept { return frameVectorIn_; }
44 
46  void frameVector(const Eigen::Vector3d & frameVector) noexcept;
47 
49  inline const Eigen::Vector3d & actual() const noexcept { return actualVector_; }
50 
52  inline const Eigen::Vector3d & refVel() const noexcept { return refVel_; }
53 
55  inline void refVel(const Eigen::Vector3d & refVel) noexcept { refVel_ = refVel; }
56 
58  inline const Eigen::Vector3d & refAccel() const noexcept { return refAccel_; }
59 
61  inline void refAccel(const Eigen::Vector3d & refAccel) noexcept { refAccel_ = refAccel; }
62 
64  inline const mc_rbdyn::RobotFrame & frame() const noexcept { return *frame_; }
65 
66 protected:
67  void updateValue();
68  void updateVelocity();
69  void updateJacobian();
70  void updateNormalAcceleration();
71 
74 
76  Eigen::Vector3d frameVectorIn_;
77 
79  rbd::Jacobian jac_;
80  Eigen::Vector3d actualVector_;
81  Eigen::Vector3d bodyVector_;
82  Eigen::Matrix3d bodyVectorHat_;
83  Eigen::MatrixXd fullJacobian_;
84  Eigen::Matrix3d E_0_b_;
85  Eigen::Vector3d w_b_b_;
86 
88  Eigen::Vector3d target_;
89  Eigen::Vector3d refVel_;
90  Eigen::Vector3d refAccel_;
91 };
92 
93 } // namespace mc_tvm
mc_tvm::VectorOrientationFunction::refAccel_
Eigen::Vector3d refAccel_
Definition: VectorOrientationFunction.h:90
mc_tvm::VectorOrientationFunction::E_0_b_
Eigen::Matrix3d E_0_b_
Definition: VectorOrientationFunction.h:84
mc_tvm::VectorOrientationFunction::fullJacobian_
Eigen::MatrixXd fullJacobian_
Definition: VectorOrientationFunction.h:83
mc_tvm::VectorOrientationFunction::jac_
rbd::Jacobian jac_
Definition: VectorOrientationFunction.h:79
MC_TVM_DLLAPI
#define MC_TVM_DLLAPI
Definition: api.h:47
mc_tvm::VectorOrientationFunction::body_frame_
mc_tvm::RobotFrame & body_frame_
Definition: VectorOrientationFunction.h:73
mc_tvm::VectorOrientationFunction::refAccel
const Eigen::Vector3d & refAccel() const noexcept
Definition: VectorOrientationFunction.h:58
mc_tvm::VectorOrientationFunction::refAccel
void refAccel(const Eigen::Vector3d &refAccel) noexcept
Definition: VectorOrientationFunction.h:61
mc_tvm::VectorOrientationFunction::frame
const mc_rbdyn::RobotFrame & frame() const noexcept
Definition: VectorOrientationFunction.h:64
mc_tvm
Definition: CollisionFunction.h:15
mc_tvm::VectorOrientationFunction::frameVector
const Eigen::Vector3d & frameVector() const noexcept
Definition: VectorOrientationFunction.h:43
mc_rbdyn::RobotFrame
Definition: RobotFrame.h:21
mc_tvm::VectorOrientationFunction::w_b_b_
Eigen::Vector3d w_b_b_
Definition: VectorOrientationFunction.h:85
fwd.h
fwd.h
mc_tvm::VectorOrientationFunction::bodyVectorHat_
Eigen::Matrix3d bodyVectorHat_
Definition: VectorOrientationFunction.h:82
mc_rbdyn::ConstRobotFramePtr
std::shared_ptr< const RobotFrame > ConstRobotFramePtr
Definition: fwd.h:25
mc_tvm::VectorOrientationFunction::refVel_
Eigen::Vector3d refVel_
Definition: VectorOrientationFunction.h:89
mc_tvm::RobotFrame
Definition: RobotFrame.h:27
mc_tvm::VectorOrientationFunction::target
void target(const Eigen::Vector3d &target) noexcept
Definition: VectorOrientationFunction.h:40
mc_tvm::VectorOrientationFunction::frame_
mc_rbdyn::ConstRobotFramePtr frame_
Definition: VectorOrientationFunction.h:72
mc_tvm::VectorOrientationFunction::target
const Eigen::Vector3d & target() const noexcept
Definition: VectorOrientationFunction.h:37
mc_tvm::VectorOrientationFunction::bodyVector_
Eigen::Vector3d bodyVector_
Definition: VectorOrientationFunction.h:81
mc_tvm::VectorOrientationFunction::refVel
const Eigen::Vector3d & refVel() const noexcept
Definition: VectorOrientationFunction.h:52
mc_tvm::VectorOrientationFunction
Definition: VectorOrientationFunction.h:21
mc_tvm::VectorOrientationFunction::frameVectorIn_
Eigen::Vector3d frameVectorIn_
Definition: VectorOrientationFunction.h:76
mc_tvm::VectorOrientationFunction::actual
const Eigen::Vector3d & actual() const noexcept
Definition: VectorOrientationFunction.h:49
api.h
mc_tvm::VectorOrientationFunction::refVel
void refVel(const Eigen::Vector3d &refVel) noexcept
Definition: VectorOrientationFunction.h:55
mc_tvm::VectorOrientationFunction::target_
Eigen::Vector3d target_
Definition: VectorOrientationFunction.h:88
mc_tvm::VectorOrientationFunction::actualVector_
Eigen::Vector3d actualVector_
Definition: VectorOrientationFunction.h:80