pacmod_core.h
Go to the documentation of this file.
1 #ifndef PACMOD_PACMOD_CORE_H
2 #define PACMOD_PACMOD_CORE_H
3 
4 /*
5 * Unpublished Copyright (c) 2009-2017 AutonomouStuff, LLC, All Rights Reserved.
6 *
7 * This file is part of the PACMod ROS 1.0 driver which is released under the MIT license.
8 * See file LICENSE included with this software or go to https://opensource.org/licenses/MIT for full license details.
9 */
10 
11 #include <sstream>
12 #include <cstdint>
13 #include <memory>
14 #include <string>
15 #include <vector>
16 
17 namespace AS
18 {
19 namespace Drivers
20 {
21 namespace PACMod
22 {
24 {
29 };
30 
32 {
33 public:
34  static std::shared_ptr<PacmodTxMsg> make_message(const int64_t& can_id);
35  virtual void parse(uint8_t *in) = 0;
36 };
37 
38 // TX Messages
39 class GlobalRptMsg :
40  public PacmodTxMsg
41 {
42 public:
43  static const int64_t CAN_ID;
44 
45  bool enabled;
52 
53  void parse(uint8_t *in);
54 };
55 
56 class VinRptMsg :
57  public PacmodTxMsg
58 {
59 public:
60  static const int64_t CAN_ID;
61 
62  std::string mfg_code;
63  std::string mfg;
65  uint32_t model_year;
66  uint32_t serial;
67 
68  void parse(uint8_t *in);
69 };
70 
72  public PacmodTxMsg
73 {
74 public:
75  uint32_t manual_input;
76  uint32_t command;
77  uint32_t output;
78 
79  void parse(uint8_t *in);
80 };
81 
83  public SystemRptIntMsg
84 {
85 public:
86  static const int64_t CAN_ID;
87 };
88 
90  public SystemRptIntMsg
91 {
92 public:
93  static const int64_t CAN_ID;
94 };
95 
96 class HornRptMsg :
97  public SystemRptIntMsg
98 {
99 public:
100  static const int64_t CAN_ID;
101 };
102 
103 class WiperRptMsg :
104  public SystemRptIntMsg
105 {
106 public:
107  static const int64_t CAN_ID;
108 };
109 
110 class ShiftRptMsg :
111  public SystemRptIntMsg
112 {
113 public:
114  static const int64_t CAN_ID;
115 };
116 
118  public PacmodTxMsg
119 {
120 public:
121  double manual_input;
122  double command;
123  double output;
124 
125  void parse(uint8_t *in);
126 };
127 
128 class AccelRptMsg :
129  public SystemRptFloatMsg
130 {
131 public:
132  static const int64_t CAN_ID;
133 };
134 
135 class SteerRptMsg :
136  public SystemRptFloatMsg
137 {
138 public:
139  static const int64_t CAN_ID;
140 };
141 
143  public SystemRptFloatMsg
144 {
145 public:
146  static const int64_t CAN_ID;
147 };
148 
150  public SystemRptFloatMsg
151 {
152 public:
153  static const int64_t CAN_ID;
154 };
155 
156 class BrakeRptMsg :
157  public SystemRptFloatMsg
158 {
159 public:
160  static const int64_t CAN_ID;
161 };
162 
164  public PacmodTxMsg
165 {
166 public:
167  static const int64_t CAN_ID;
168 
171  uint8_t vehicle_speed_raw[2];
172 
173  void parse(uint8_t *in);
174 };
175 
177  public PacmodTxMsg
178 {
179 public:
180  double current;
181  double position;
182 
183  void parse(uint8_t *in);
184 };
185 
187  public MotorRpt1Msg
188 {
189 public:
190  static const int64_t CAN_ID;
191 };
192 
194  public MotorRpt1Msg
195 {
196 public:
197  static const int64_t CAN_ID;
198 };
199 
201  public PacmodTxMsg
202 {
203 public:
204  double encoder_temp;
205  double motor_temp;
206  double velocity;
207 
208  void parse(uint8_t *in);
209 };
210 
212  public MotorRpt2Msg
213 {
214 public:
215  static const int64_t CAN_ID;
216 };
217 
219  public MotorRpt2Msg
220 {
221 public:
222  static const int64_t CAN_ID;
223 };
224 
226  public PacmodTxMsg
227 {
228 public:
230  double torque_input;
231 
232  void parse(uint8_t *in);
233 };
234 
236  public MotorRpt3Msg
237 {
238 public:
239  static const int64_t CAN_ID;
240 };
241 
243  public MotorRpt3Msg
244 {
245 public:
246  static const int64_t CAN_ID;
247 };
248 
250  public PacmodTxMsg
251 {
252 public:
253  static const int64_t CAN_ID;
254 
255  double yaw_rate;
256 
257  void parse(uint8_t *in);
258 };
259 
261  public PacmodTxMsg
262 {
263 public:
264  static const int64_t CAN_ID;
265 
272  double heading;
273 
274  void parse(uint8_t *in);
275 };
276 
278  public PacmodTxMsg
279 {
280 public:
281  static const int64_t CAN_ID;
282 
283  uint32_t year;
284  uint8_t month;
285  uint8_t day;
286  uint8_t hour;
287  uint8_t minute;
288  uint8_t second;
289 
290  void parse(uint8_t *in);
291 };
292 
294  public PacmodTxMsg
295 {
296 public:
297  static const int64_t CAN_ID;
298 
303 
304  void parse(uint8_t *in);
305 };
306 
308  public PacmodTxMsg
309 {
310 public:
311  static const int64_t CAN_ID;
312 
313  double dt;
314  double Kp;
315  double Ki;
316  double Kd;
317 
318  void parse(uint8_t *in);
319 };
320 
322  public PacmodTxMsg
323 {
324 public:
325  static const int64_t CAN_ID;
326 
327  double P_term;
328  double I_term;
329  double D_term;
330  double all_terms;
331 
332  void parse(uint8_t *in);
333 };
334 
336  public PacmodTxMsg
337 {
338 public:
339  static const int64_t CAN_ID;
340 
341  double new_torque;
344  double error;
345 
346  void parse(uint8_t *in);
347 };
348 
350  public PacmodTxMsg
351 {
352 public:
353  static const int64_t CAN_ID;
354 
357 
358  void parse(uint8_t *in);
359 };
360 
362  public PacmodTxMsg
363 {
364 public:
365  static const int64_t CAN_ID;
366 
368 
369  void parse(uint8_t *in);
370 };
371 
372 // RX Messages
374 {
375 public:
376  std::vector<uint8_t> data;
377 };
378 
380  public PacmodRxMsg
381 {
382 public:
383  static const int64_t CAN_ID;
384 
385  void encode(bool enable, bool clear_override, bool ignore_overide);
386 };
387 
389  public PacmodRxMsg
390 {
391 public:
392  static const int64_t CAN_ID;
393 
394  void encode(uint8_t turn_signal_cmd);
395 };
396 
398  public PacmodRxMsg
399 {
400 public:
401  static const int64_t CAN_ID;
402 
403  void encode(uint8_t headlight_cmd);
404 };
405 
406 class HornCmdMsg :
407  public PacmodRxMsg
408 {
409 public:
410  static const int64_t CAN_ID;
411 
412  void encode(uint8_t horn_cmd);
413 };
414 
415 class WiperCmdMsg :
416  public PacmodRxMsg
417 {
418 public:
419  static const int64_t CAN_ID;
420 
421  void encode(uint8_t wiper_cmd);
422 };
423 
424 class ShiftCmdMsg :
425  public PacmodRxMsg
426 {
427 public:
428  static const int64_t CAN_ID;
429 
430  void encode(uint8_t shift_cmd);
431 };
432 
433 class AccelCmdMsg :
434  public PacmodRxMsg
435 {
436 public:
437  static const int64_t CAN_ID;
438 
439  void encode(double accel_cmd);
440 };
441 
442 class SteerCmdMsg :
443  public PacmodRxMsg
444 {
445 public:
446  static const int64_t CAN_ID;
447 
448  void encode(double steer_pos, double steer_spd);
449 };
450 
451 class BrakeCmdMsg :
452  public PacmodRxMsg
453 {
454 public:
455  static const int64_t CAN_ID;
456 
457  void encode(double brake_cmd);
458 };
459 } // namespace PACMod
460 } // namespace Drivers
461 } // namespace AS
462 
463 #endif // PACMOD_PACMOD_CORE_H
static const int64_t CAN_ID
Definition: pacmod_core.h:455
static const int64_t CAN_ID
Definition: pacmod_core.h:114
static const int64_t CAN_ID
Definition: pacmod_core.h:410
static const int64_t CAN_ID
Definition: pacmod_core.h:437
Definition: pacmod_core.h:17
static const int64_t CAN_ID
Definition: pacmod_core.h:153
static const int64_t CAN_ID
Definition: pacmod_core.h:383
static const int64_t CAN_ID
Definition: pacmod_core.h:107
static const int64_t CAN_ID
Definition: pacmod_core.h:60
static const int64_t CAN_ID
Definition: pacmod_core.h:146
std::vector< uint8_t > data
Definition: pacmod_core.h:376
static const int64_t CAN_ID
Definition: pacmod_core.h:419
static const int64_t CAN_ID
Definition: pacmod_core.h:100
static const int64_t CAN_ID
Definition: pacmod_core.h:428
static const int64_t CAN_ID
Definition: pacmod_core.h:43
static const int64_t CAN_ID
Definition: pacmod_core.h:132
static const int64_t CAN_ID
Definition: pacmod_core.h:160
static const int64_t CAN_ID
Definition: pacmod_core.h:139
static std::shared_ptr< PacmodTxMsg > make_message(const int64_t &can_id)
Definition: pacmod_core.cpp:50
virtual void parse(uint8_t *in)=0
static const int64_t CAN_ID
Definition: pacmod_core.h:446


pacmod
Author(s): Joe Driscoll , Josh Whitley
autogenerated on Mon Jun 10 2019 14:08:17