FrameVelocity.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 
20 struct MC_TVM_DLLAPI FrameVelocity : public tvm::function::abstract::Function
21 {
22  SET_UPDATES(FrameVelocity, Value, Velocity, Jacobian)
23 
24 
28  FrameVelocity(const mc_rbdyn::RobotFrame & frame, const Eigen::Vector6d & dof);
29 
31  inline void reset() {}
32 
34  inline const mc_rbdyn::RobotFrame & frame() const noexcept { return *frame_; }
35 
37  inline const Eigen::Vector6d & dof() const noexcept { return dof_; }
38 
40  inline void dof(const Eigen::Vector6d & dof) noexcept { dof_ = dof; }
41 
43  inline void refVel(const Eigen::Vector6d & refV) noexcept { refVel_ = refV; }
45  inline const Eigen::Vector6d & refVel() const noexcept { return refVel_; }
46 
48  inline void refAccel(const Eigen::Vector6d & refA) noexcept { refAccel_ = refA; }
50  inline const Eigen::Vector6d & refAccel() const noexcept { return refAccel_; }
51 
52 private:
54  Eigen::Vector6d dof_;
55  Eigen::Vector6d refVel_ = Eigen::Vector6d::Zero();
56  Eigen::Vector6d refAccel_ = Eigen::Vector6d::Zero();
57 
58  rbd::Jacobian jac_;
59  rbd::Blocks blocks_;
60  Eigen::MatrixXd jacobian_;
61 
62  void updateValue();
63  void updateVelocity();
64  void updateJacobian();
65 };
66 
67 using FrameVelocityPtr = std::shared_ptr<FrameVelocity>;
68 
69 } // namespace mc_tvm
mc_tvm::FrameVelocity
Definition: FrameVelocity.h:20
mc_tvm::FrameVelocity::dof
void dof(const Eigen::Vector6d &dof) noexcept
Definition: FrameVelocity.h:40
MC_TVM_DLLAPI
#define MC_TVM_DLLAPI
Definition: api.h:47
mc_tvm::FrameVelocity::refVel
const Eigen::Vector6d & refVel() const noexcept
Definition: FrameVelocity.h:45
mc_tvm
Definition: CollisionFunction.h:15
mc_tvm::FrameVelocity::refAccel
const Eigen::Vector6d & refAccel() const noexcept
Definition: FrameVelocity.h:50
mc_rbdyn::RobotFrame
Definition: RobotFrame.h:21
mc_tvm::FrameVelocity::frame
const mc_rbdyn::RobotFrame & frame() const noexcept
Definition: FrameVelocity.h:34
fwd.h
fwd.h
mc_rbdyn::ConstRobotFramePtr
std::shared_ptr< const RobotFrame > ConstRobotFramePtr
Definition: fwd.h:25
mc_tvm::FrameVelocity::refAccel
void refAccel(const Eigen::Vector6d &refA) noexcept
Definition: FrameVelocity.h:48
mc_tvm::FrameVelocity::refVel
void refVel(const Eigen::Vector6d &refV) noexcept
Definition: FrameVelocity.h:43
mc_tvm::FrameVelocity::reset
void reset()
Definition: FrameVelocity.h:31
mc_tvm::FrameVelocity::dof
const Eigen::Vector6d & dof() const noexcept
Definition: FrameVelocity.h:37
api.h
mc_tvm::FrameVelocityPtr
std::shared_ptr< FrameVelocity > FrameVelocityPtr
Definition: FrameVelocity.h:67