CompoundJointFunction.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 
10 #include <mc_rbdyn/fwd.h>
11 
12 #include <tvm/function/abstract/LinearFunction.h>
13 
14 namespace mc_tvm
15 {
16 
22 struct MC_TVM_DLLAPI CompoundJointFunction : tvm::function::abstract::LinearFunction
23 {
24  SET_UPDATES(CompoundJointFunction, B)
25 
26 
31 
33  void dt(double dt);
34 
35 private:
36  void updateB();
37 
38  // Robot
39  const mc_rbdyn::Robot & robot_;
40  // Timestep
41  double dt_;
42  // Simplified form of the description
43  struct Desc
44  {
45  // Index of q1
46  size_t q1Idx;
47  // Index of q2
48  size_t q2Idx;
49  // x index of p1
50  double p1_x;
51  // y index of p1
52  double p1_y;
53  // P_x = p2_x - p1_x
54  double P_x;
55  // P_y = p2_y - p1_y
56  double P_y;
57  };
58  Desc desc_;
59  // Constant part of b
60  double b_cst_;
61 };
62 
63 using CompoundJointFunctionPtr = std::shared_ptr<CompoundJointFunction>;
64 
65 } // namespace mc_tvm
mc_rbdyn::CompoundJointConstraintDescription
Definition: CompoundJointConstraintDescription.h:23
MC_TVM_DLLAPI
#define MC_TVM_DLLAPI
Definition: api.h:47
mc_rbdyn::Robot
Definition: Robot.h:62
mc_tvm::CompoundJointFunction
Definition: CompoundJointFunction.h:22
mc_tvm
Definition: CollisionFunction.h:15
CompoundJointConstraintDescription.h
fwd.h
mc_tvm::CompoundJointFunctionPtr
std::shared_ptr< CompoundJointFunction > CompoundJointFunctionPtr
Definition: CompoundJointFunction.h:63
api.h