pacmod3_core.h
Go to the documentation of this file.
1 #ifndef PACMOD3_CORE_HPP
2 #define PACMOD3_CORE_HPP
3 
4 /*
5 * Unpublished Copyright (c) 2009-2017 AutonomouStuff, LLC, All Rights Reserved.
6 *
7 * This file is part of the PACMod v3 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 <cstring>
12 #include <sstream>
13 #include <cstdint>
14 #include <memory>
15 #include <vector>
16 
17 namespace AS
18 {
19 namespace Drivers
20 {
21 namespace PACMod3
22 {
24  {
31  };
32 
33  enum DimLevel
34  {
48  };
49 
51  {
52  public:
53  static std::shared_ptr<Pacmod3TxMsg> make_message(const int64_t& can_id);
54  virtual void parse(uint8_t *in) = 0;
55  virtual bool isSystem();
56  };
57 
58  class SystemRptMsg :
59  public Pacmod3TxMsg
60  {
61  public:
62  SystemRptMsg();
63 
64  bool isSystem();
65 
66  bool enabled;
73  };
74 
76  public SystemRptMsg
77  {
78  public:
80 
82  bool command;
83  bool output;
84 
85  void parse(uint8_t *in);
86  };
87 
89  public SystemRptMsg
90  {
91  public:
93 
94  uint8_t manual_input;
95  uint8_t command;
96  uint8_t output;
97 
98  void parse(uint8_t *in);
99  };
100 
102  public SystemRptMsg
103  {
104  public:
106 
107  double manual_input;
108  double command;
109  double output;
110 
111  void parse(uint8_t *in);
112  };
113 
114  // TX Messages
115  class GlobalRptMsg :
116  public Pacmod3TxMsg
117  {
118  public:
119  static const int64_t CAN_ID;
120 
121  bool enabled;
131 
132  void parse(uint8_t *in);
133  };
134 
135  // System Reports
136  class AccelRptMsg :
137  public SystemRptFloatMsg
138  {
139  public:
140  static const int64_t CAN_ID;
141  };
142 
143  class BrakeRptMsg :
144  public SystemRptFloatMsg
145  {
146  public:
147  static const int64_t CAN_ID;
148  };
149 
151  public SystemRptIntMsg
152  {
153  public:
154  static const int64_t CAN_ID;
155  };
156 
158  public SystemRptIntMsg
159  {
160  public:
161  static const int64_t CAN_ID;
162  };
163 
165  public SystemRptIntMsg
166  {
167  public:
168  static const int64_t CAN_ID;
169  };
170 
172  public SystemRptBoolMsg
173  {
174  public:
175  static const int64_t CAN_ID;
176  };
177 
179  public SystemRptIntMsg
180  {
181  public:
182  static const int64_t CAN_ID;
183  };
184 
185  class HornRptMsg :
186  public SystemRptBoolMsg
187  {
188  public:
189  static const int64_t CAN_ID;
190  };
191 
193  public SystemRptIntMsg
194  {
195  public:
196  static const int64_t CAN_ID;
197  };
198 
200  public SystemRptBoolMsg
201  {
202  public:
203  static const int64_t CAN_ID;
204  };
205 
206  class ShiftRptMsg :
207  public SystemRptIntMsg
208  {
209  public:
210  static const int64_t CAN_ID;
211  };
212 
213  class SteerRptMsg :
214  public SystemRptFloatMsg
215  {
216  public:
217  static const int64_t CAN_ID;
218  };
219 
221  public SystemRptIntMsg
222  {
223  public:
224  static const int64_t CAN_ID;
225  };
226 
227  class WiperRptMsg :
228  public SystemRptIntMsg
229  {
230  public:
231  static const int64_t CAN_ID;
232  };
233 
234  // System Aux Reports
236  public Pacmod3TxMsg
237  {
238  public:
239  static const int64_t CAN_ID;
240 
247 
248  void parse(uint8_t *in);
249  };
250 
252  public Pacmod3TxMsg
253  {
254  public:
255  static const int64_t CAN_ID;
256 
267 
268  void parse(uint8_t *in);
269  };
270 
272  public Pacmod3TxMsg
273  {
274  public:
275  static const int64_t CAN_ID;
276 
285 
286  void parse(uint8_t *in);
287  };
288 
290  public Pacmod3TxMsg
291  {
292  public:
293  static const int64_t CAN_ID;
294 
303 
304  void parse(uint8_t *in);
305  };
306 
308  public Pacmod3TxMsg
309  {
310  public:
311  static const int64_t CAN_ID;
312 
314  float raw_torque;
321 
322  void parse(uint8_t *in);
323  };
324 
326  public Pacmod3TxMsg
327  {
328  public:
329  static const int64_t CAN_ID;
330 
335 
336  void parse(uint8_t *in);
337  };
338 
340  public Pacmod3TxMsg
341  {
342  public:
343  static const int64_t CAN_ID;
344 
357 
358  void parse(uint8_t *in);
359  };
360 
361  // Other Reports
363  public Pacmod3TxMsg
364  {
365  public:
366  static const int64_t CAN_ID;
367 
372 
373  void parse(uint8_t *in);
374  };
375 
377  public Pacmod3TxMsg
378  {
379  public:
380  static const int64_t CAN_ID;
381 
390 
391  void parse(uint8_t *in);
392  };
393 
395  public Pacmod3TxMsg
396  {
397  public:
398  static const int64_t CAN_ID;
399 
412 
413  void parse(uint8_t *in);
414  };
415 
416  class MotorRpt1Msg :
417  public Pacmod3TxMsg
418  {
419  public:
420  double current;
421  double position;
422 
423  void parse(uint8_t *in);
424  };
425 
426  class MotorRpt2Msg :
427  public Pacmod3TxMsg
428  {
429  public:
430  double encoder_temp;
431  double motor_temp;
432  double velocity;
433 
434  void parse(uint8_t *in);
435  };
436 
437  class MotorRpt3Msg :
438  public Pacmod3TxMsg
439  {
440  public:
442  double torque_input;
443 
444  void parse(uint8_t *in);
445  };
446 
448  public MotorRpt1Msg
449  {
450  public:
451  static const int64_t CAN_ID;
452  };
453 
455  public MotorRpt2Msg
456  {
457  public:
458  static const int64_t CAN_ID;
459  };
460 
462  public MotorRpt3Msg
463  {
464  public:
465  static const int64_t CAN_ID;
466  };
467 
469  public Pacmod3TxMsg
470  {
471  public:
472  static const int64_t CAN_ID;
473 
474  uint32_t year;
475  uint8_t month;
476  uint8_t day;
477  uint8_t hour;
478  uint8_t minute;
479  uint8_t second;
480 
481  void parse(uint8_t *in);
482  };
483 
484  class DoorRptMsg :
485  public Pacmod3TxMsg
486  {
487  public:
488  static const int64_t CAN_ID;
489 
498  bool hood_open;
504 
505  void parse(uint8_t *in);
506  };
507 
509  public Pacmod3TxMsg
510  {
511  public:
512  static const int64_t CAN_ID;
513 
520  double heading;
521 
522  void parse(uint8_t *in);
523  };
524 
526  public Pacmod3TxMsg
527  {
528  public:
529  static const int64_t CAN_ID;
530 
531  double dt;
532  double Kp;
533  double Ki;
534  double Kd;
535 
536  void parse(uint8_t *in);
537  };
538 
540  public Pacmod3TxMsg
541  {
542  public:
543  static const int64_t CAN_ID;
544 
545  double P_term;
546  double I_term;
547  double D_term;
548  double all_terms;
549 
550  void parse(uint8_t *in);
551  };
552 
554  public Pacmod3TxMsg
555  {
556  public:
557  static const int64_t CAN_ID;
558 
559  double new_torque;
562  double error;
563 
564  void parse(uint8_t *in);
565  };
566 
568  public Pacmod3TxMsg
569  {
570  public:
571  static const int64_t CAN_ID;
572 
575 
576  void parse(uint8_t *in);
577  };
578 
580  public MotorRpt1Msg
581  {
582  public:
583  static const int64_t CAN_ID;
584  };
585 
587  public MotorRpt2Msg
588  {
589  public:
590  static const int64_t CAN_ID;
591  };
592 
594  public MotorRpt3Msg
595  {
596  public:
597  static const int64_t CAN_ID;
598  };
599 
601  public Pacmod3TxMsg
602  {
603  public:
604  static const int64_t CAN_ID;
605 
608  uint8_t vehicle_speed_raw[2];
609 
610  void parse(uint8_t *in);
611  };
612 
613  class VinRptMsg :
614  public Pacmod3TxMsg
615  {
616  public:
617  static const int64_t CAN_ID;
618 
619  std::string mfg_code;
620  std::string mfg;
622  uint32_t model_year;
623  uint32_t serial;
624 
625  void parse(uint8_t *in);
626  };
627 
629  public Pacmod3TxMsg
630  {
631  public:
632  static const int64_t CAN_ID;
633 
634  double yaw_rate;
635 
636  void parse(uint8_t *in);
637  };
638 
640  public Pacmod3TxMsg
641  {
642  public:
643  static const int64_t CAN_ID;
644 
649 
650  void parse(uint8_t *in);
651  };
652 
654  public Pacmod3TxMsg
655  {
656  public:
657  static const int64_t CAN_ID;
660 
661  void parse(uint8_t *in);
662  };
663 
665  public Pacmod3TxMsg
666  {
667  public:
668  static const int64_t CAN_ID;
669 
670  uint8_t shift_pos_1;
671  uint8_t shift_pos_2;
672 
673  void parse(uint8_t *in);
674  };
675 
677  public Pacmod3TxMsg
678  {
679  public:
680  static const int64_t CAN_ID;
681 
682  uint8_t g_forces;
683  double brake_torque;
684 
685  void parse(uint8_t *in);
686  };
687 
688  // RX Messages
690  {
691  public:
692  std::vector<uint8_t> data;
693  };
694 
696  public Pacmod3RxMsg
697  {
698  public:
699  void encode(bool enable,
700  bool ignore_overrides,
701  bool clear_override,
702  bool cmd);
703  };
704 
706  public Pacmod3RxMsg
707  {
708  public:
709  void encode(bool enable,
710  bool ignore_overrides,
711  bool clear_override,
712  float cmd);
713  };
714 
715  class SystemCmdInt :
716  public Pacmod3RxMsg
717  {
718  public:
719  void encode(bool enable,
720  bool ignore_overrides,
721  bool clear_override,
722  uint8_t cmd);
723  };
724 
725  // System Commands
726  class AccelCmdMsg :
727  public SystemCmdFloat
728  {
729  public:
730  static const int64_t CAN_ID;
731  };
732 
733  class BrakeCmdMsg :
734  public SystemCmdFloat
735  {
736  public:
737  static const int64_t CAN_ID;
738  };
739 
741  public SystemCmdInt
742  {
743  public:
744  static const int64_t CAN_ID;
745  };
746 
748  public SystemCmdInt
749  {
750  public:
751  static const int64_t CAN_ID;
752  };
753 
755  public SystemCmdInt
756  {
757  public:
758  static const int64_t CAN_ID;
759  };
760 
762  public SystemCmdBool
763  {
764  public:
765  static const int64_t CAN_ID;
766  };
767 
769  public SystemCmdInt
770  {
771  public:
772  static const int64_t CAN_ID;
773  };
774 
775  class HornCmdMsg :
776  public SystemCmdBool
777  {
778  public:
779  static const int64_t CAN_ID;
780  };
781 
783  public SystemCmdInt
784  {
785  public:
786  static const int64_t CAN_ID;
787  };
788 
790  public SystemCmdBool
791  {
792  public:
793  static const int64_t CAN_ID;
794  };
795 
796  class ShiftCmdMsg :
797  public SystemCmdInt
798  {
799  public:
800  static const int64_t CAN_ID;
801  };
802 
803  class SteerCmdMsg :
804  public SystemCmdFloat
805  {
806  public:
807  static const int64_t CAN_ID;
808 
809  void encode(bool enabled,
810  bool ignore_overrides,
811  bool clear_override,
812  float steer_pos,
813  float steer_spd);
814  };
815 
817  public SystemCmdInt
818  {
819  public:
820  static const int64_t CAN_ID;
821  };
822 
823  class WiperCmdMsg :
824  public SystemCmdInt
825  {
826  public:
827  static const int64_t CAN_ID;
828  };
829 }
830 }
831 }
832 
833 #endif
static std::shared_ptr< Pacmod3TxMsg > make_message(const int64_t &can_id)
static const int64_t CAN_ID
Definition: pacmod3_core.h:779
virtual void parse(uint8_t *in)=0
static const int64_t CAN_ID
Definition: pacmod3_core.h:488
static const int64_t CAN_ID
Definition: pacmod3_core.h:617
static const int64_t CAN_ID
Definition: pacmod3_core.h:189
std::vector< uint8_t > data
Definition: pacmod3_core.h:692


pacmod3
Author(s): Joe Driscoll , Josh Whitley
autogenerated on Mon Jun 10 2019 14:09:46