message.hpp
Go to the documentation of this file.
1 #ifndef _QUORI_MESSAGE_HPP_
2 #define _QUORI_MESSAGE_HPP_
3 
4 #include <stdint.h>
5 #include <string>
6 #include <string.h>
7 
8 #define QUORI_MESSAGE __attribute__((packed))
9 
10 namespace quori
11 {
12  namespace message
13  {
14  enum class Type : uint8_t
15  {
16  Initialize = 0x1,
17  SetPositions = 0x2,
18  GetStates = 0x3,
19  Set = 0x4,
21  Coast,
22  SetLimit,
23  SetPositionsRes = 0xD0,
24  Initialized = 0xF0,
25  States = 0xF1,
26  Log = 0xF2
27  };
28 
30  {
31  Initialize();
32  uint8_t marker;
33  };
34 
36  {
37  SetPositions();
38  uint8_t marker;
39  float positions[3];
40  };
41 
43  {
44  Set();
45  uint8_t marker;
46  float positions[3];
47  float velocities[3];
48  float efforts[3];
49  };
50 
52  {
54  uint8_t marker;
55  float values[4];
56  };
57 
59  {
60  GetStates();
61  uint8_t marker;
62  };
63 
65  {
66  SetVelocities();
67  uint8_t marker;
68  float velocities[3];
69  };
70 
72  {
73  Coast();
74  uint8_t marker;
75  };
76 
78  {
79  SetLimit();
80  uint8_t marker;
81  bool limit;
82  };
83 
84  size_t string_length(const std::string &t);
85  size_t string_length(const char *const t);
86 
87  const char *c_string(const std::string &t);
88  const char *c_string(const char *const t);
89 
91  {
92  uint8_t marker;
93  char _0[20];
94  char _1[20];
95  char _2[20];
96  uint8_t modes[3];
97 
98  private:
99  Initialized() = delete;
100  };
101 
103  {
104  Log();
105  uint8_t marker;
106  char message[32];
107  };
108 
110  {
111  States();
112 
113  uint8_t marker;
116 
117  float measured[3];
118  float positions[3];
119  // float velocities[3];
120  // float efforts[3];
121  };
122  }
123 
124 }
125 
126 #endif
quori::message::c_string
const char * c_string(const std::string &t)
Definition: message.cpp:67
quori::message::SetPositionsRes
Definition: message.hpp:51
quori::message::SetVelocities::marker
uint8_t marker
Definition: message.hpp:67
quori::message::SetPositions::marker
uint8_t marker
Definition: message.hpp:38
quori::message::States::measured_presence
uint8_t measured_presence
Definition: message.hpp:114
quori::message::Set::marker
uint8_t marker
Definition: message.hpp:45
quori::message::Coast
Definition: message.hpp:71
quori::message::Initialize
Definition: message.hpp:29
quori::message::States::positions_presence
uint8_t positions_presence
Definition: message.hpp:115
quori::message::Log::marker
uint8_t marker
Definition: message.hpp:105
quori::message::string_length
size_t string_length(const std::string &t)
Definition: message.cpp:57
quori::message::Type
Type
Definition: message.hpp:14
quori::message::GetStates
Definition: message.hpp:58
quori::message::States::marker
uint8_t marker
Definition: message.hpp:113
quori::message::SetPositions
Definition: message.hpp:35
quori::message::Set
Definition: message.hpp:42
quori::message::Type::SetVelocities
@ SetVelocities
quori::message::Initialized::marker
uint8_t marker
Definition: message.hpp:92
quori::message::GetStates::marker
uint8_t marker
Definition: message.hpp:61
quori::message::Type::SetLimit
@ SetLimit
quori::message::Type::Coast
@ Coast
quori::message::SetLimit::limit
bool limit
Definition: message.hpp:81
quori::message::Initialize::marker
uint8_t marker
Definition: message.hpp:32
quori::message::SetLimit::marker
uint8_t marker
Definition: message.hpp:80
quori
Definition: message.hpp:10
quori::message::Coast::marker
uint8_t marker
Definition: message.hpp:74
quori::message::Initialized
Definition: message.hpp:90
quori::message::States
Definition: message.hpp:109
quori::message::Log
Definition: message.hpp:102
QUORI_MESSAGE
#define QUORI_MESSAGE
Definition: message.hpp:8
quori::message::SetPositionsRes::marker
uint8_t marker
Definition: message.hpp:54
quori::message::SetVelocities
Definition: message.hpp:64
quori::message::SetLimit
Definition: message.hpp:77


quori_controller
Author(s):
autogenerated on Wed Mar 2 2022 00:53:16