Cheetah Software  1.0
ti_boardcontrol.h
Go to the documentation of this file.
1 #ifndef TI_BOARDCONTROL_H
2 #define TI_BOARDCONTROL_H
3 
4 #include "cTypes.h"
5 
6 // class for a simulated TI board
7 // replaces the old TI board control code, which required keeping track of the
8 // command/data state data.
9 struct TiBoardCommand {
10  float position_des[3];
11  float velocity_des[3];
12  float kp[3];
13  float kd[3];
14  float force_ff[3];
15  float tau_ff[3];
17  float max_torque;
18 };
19 
20 struct TiBoardData {
21  float position[3];
22  float velocity[3];
23  float force[3];
24  float q[3];
25  float dq[3];
26  float tau[3];
27  float tau_des[3];
31 };
32 
34  public:
35  TI_BoardControl() = default;
36  void init(float side_sign);
37  void run_ti_board_iteration();
38  void reset_ti_board_data();
39  void reset_ti_board_command();
40  void set_link_lengths(float l1, float l2, float l3);
43 
44  // for Ben's TI board code that uses pointers
46 
47  private:
48  void kinematics(const float side_sign, const float q[3], const float dq[3],
49  float* p, float* v, float J[][3]);
50  void impedanceControl(const float side_sign, const float q[3],
51  const float dq[3], const float position_des[3],
52  const float velocity_des[3], const float kp[3],
53  const float kd[3], const float force_bias[3],
54  const float torque_bias[3], float* position,
55  float* velocity, float* force, float* torque);
56 
57  float _side_sign;
58  float _l1, _l2, _l3;
59  bool link_lengths_set = false;
60 };
61 
62 #endif // TI_BOARDCONTROL_H
Common types that are only valid in C++.
uint32_t u32
Definition: cTypes.h:18
float velocity_des[3]
TiBoardData * data
TiBoardData data_structure
int32_t s32
Definition: cTypes.h:23
TiBoardCommand command
float position_des[3]