Joint Level Control
message_builder.h
1 #ifndef MESSAGEBUILDER_H_
2 #define MESSAGEBUILDER_H_
3 
4 
5 #include <stdlib.h>
6 #include <string.h>
7 
8 #include "joint_level_control/motor/can_frame.h"
9 #include "joint_level_control/motor/hacker_const.h"
10 
15  protected:
16  uint8_t data[8];
17  uint8_t can_address;
18  public:
23  MessageBuilder(uint8_t address);
29  can_frame* getMessage();
30 };
34 class ScanMessage : public MessageBuilder {
35  public:
36  ScanMessage();
37 };
41 class PingMessage : public MessageBuilder {
42  public:
47  PingMessage(uint8_t address);
48 };
53  public:
58  CurrentControl(uint8_t address);
63  void setCurrent(int32_t current);
64 };
65 
66 #endif
This subclass generates Current-Control Messages which allow to control the motor via a current limit...
Definition: message_builder.h:52
CurrentControl(uint8_t address)
Definition: current_control.cpp:4
void setCurrent(int32_t current)
Definition: current_control.cpp:9
This class and its subclasses handle the creation of the CAN-Frames needed to control the Hacker Herk...
Definition: message_builder.h:14
can_frame * getMessage()
gets the generated SocketCAN-Frame for utilisation by the callee.
Definition: message_builder.cpp:17
This subclass generates a Ping-Message so that one can verify if a controller with an known address i...
Definition: message_builder.h:41
PingMessage(uint8_t address)
Definition: ping_message.cpp:4
This subclass generates a Scan-Message so that new Controllers on the CAN-Bus can be found.
Definition: message_builder.h:34