PositionFunction.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 namespace mc_tvm
15 {
16 
18 class MC_TVM_DLLAPI PositionFunction : public tvm::function::abstract::Function
19 {
20 public:
21  SET_UPDATES(PositionFunction, Value, Velocity, Jacobian, NormalAcceleration)
22 
23 
29 
31  void reset();
32 
34  inline const Eigen::Vector3d & position() const noexcept { return pos_; }
35 
37  inline void position(const Eigen::Vector3d & pos) noexcept { pos_ = pos; }
38 
40  inline const Eigen::Vector3d & refVel() const noexcept { return refVel_; }
41 
43  inline void refVel(const Eigen::Vector3d & refVel) noexcept { refVel_ = refVel; }
44 
46  inline const Eigen::Vector3d & refAccel() const noexcept { return refAccel_; }
47 
49  inline void refAccel(const Eigen::Vector3d & refAccel) noexcept { refAccel_ = refAccel; }
50 
52  inline const mc_rbdyn::RobotFrame & frame() const noexcept { return *robot_frame_; }
53 
54 protected:
55  void updateValue();
59 
62 
64  Eigen::Vector3d pos_;
65  Eigen::Vector3d refVel_;
66  Eigen::Vector3d refAccel_;
67 };
68 
69 } // namespace mc_tvm
Definition: PositionFunction.h:19
Eigen::Vector3d refAccel_
Definition: PositionFunction.h:66
const mc_rbdyn::RobotFrame & frame() const noexcept
Definition: PositionFunction.h:52
const Eigen::Vector3d & refAccel() const noexcept
Definition: PositionFunction.h:46
void refAccel(const Eigen::Vector3d &refAccel) noexcept
Definition: PositionFunction.h:49
const Eigen::Vector3d & refVel() const noexcept
Definition: PositionFunction.h:40
void position(const Eigen::Vector3d &pos) noexcept
Definition: PositionFunction.h:37
mc_tvm::RobotFrame & frame_
Definition: PositionFunction.h:61
void refVel(const Eigen::Vector3d &refVel) noexcept
Definition: PositionFunction.h:43
Eigen::Vector3d refVel_
Definition: PositionFunction.h:65
Eigen::Vector3d pos_
Definition: PositionFunction.h:64
mc_rbdyn::ConstRobotFramePtr robot_frame_
Definition: PositionFunction.h:60
#define MC_TVM_DLLAPI
Definition: api.h:47
Definition: generic_gripper.h:15
std::shared_ptr< const RobotFrame > ConstRobotFramePtr
Definition: fwd.h:25
Definition: CollisionFunction.h:16
Definition: RobotFrame.h:22
Definition: RobotFrame.h:28