CoMFunction.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/CoM.h>
8 
9 #include <mc_rbdyn/fwd.h>
10 
11 #include <tvm/function/abstract/Function.h>
12 
13 namespace mc_tvm
14 {
15 
23 struct MC_TVM_DLLAPI CoMFunction : tvm::function::abstract::Function
24 {
25  SET_UPDATES(CoMFunction, Value, Velocity, Jacobian, NormalAcceleration, JDot)
26 
27 
31  CoMFunction(const mc_rbdyn::Robot & robot);
32 
34  void reset();
35 
37  inline const Eigen::Vector3d & com() const noexcept { return com_; }
38 
40  inline void com(const Eigen::Vector3d & com) noexcept { com_ = com; }
41 
43  inline const Eigen::Vector3d & actual() const noexcept { return comAlgo_.com(); }
44 
46  inline const Eigen::Vector3d & refVel() const noexcept { return refVel_; }
47 
49  inline void refVel(const Eigen::Vector3d & refVel) noexcept { refVel_ = refVel; }
50 
52  inline const Eigen::Vector3d & refAccel() const noexcept { return refAccel_; }
53 
55  inline void refAccel(const Eigen::Vector3d & refAccel) noexcept { refAccel_ = refAccel; }
56 
57 private:
58  const mc_tvm::CoM & comAlgo_;
59  Eigen::Vector3d com_;
60  Eigen::Vector3d refVel_;
61  Eigen::Vector3d refAccel_;
62 
63  void updateValue();
64  void updateVelocity();
65  void updateJacobian();
66  void updateNormalAcceleration();
67  void updateJDot();
68 };
69 
70 } // namespace mc_tvm
mc_tvm::CoMFunction::refVel
void refVel(const Eigen::Vector3d &refVel) noexcept
Definition: CoMFunction.h:49
MC_TVM_DLLAPI
#define MC_TVM_DLLAPI
Definition: api.h:47
mc_rbdyn::Robot
Definition: Robot.h:62
mc_tvm
Definition: CollisionFunction.h:15
mc_tvm::CoMFunction::refAccel
void refAccel(const Eigen::Vector3d &refAccel) noexcept
Definition: CoMFunction.h:55
mc_tvm::CoMFunction::com
void com(const Eigen::Vector3d &com) noexcept
Definition: CoMFunction.h:40
CoM.h
fwd.h
mc_tvm::CoMFunction::com
const Eigen::Vector3d & com() const noexcept
Definition: CoMFunction.h:37
mc_tvm::CoM
Definition: CoM.h:33
mc_tvm::CoMFunction::refVel
const Eigen::Vector3d & refVel() const noexcept
Definition: CoMFunction.h:46
mc_tvm::CoMFunction::actual
const Eigen::Vector3d & actual() const noexcept
Definition: CoMFunction.h:43
mc_tvm::CoMFunction::refAccel
const Eigen::Vector3d & refAccel() const noexcept
Definition: CoMFunction.h:52
mc_tvm::CoMFunction
Definition: CoMFunction.h:23