14 #include "../../include/kobuki_driver/command.hpp" 60 current_data.
gp_out = (current_data.
gp_out & 0xfcff) | value;
65 current_data.
gp_out = (current_data.
gp_out & 0xf3ff) | value;
68 outgoing.
data = current_data;
86 uint16_t values = 0x0000;
87 uint16_t clear_mask = 0xfff0;
88 for (
unsigned int i = 0; i < 4; ++i ) {
89 if ( digital_output.
mask[i] ) {
90 if ( digital_output.
values[i] ) {
94 clear_mask |= ( 1 << i );
97 current_data.
gp_out = (current_data.
gp_out & clear_mask) | values;
99 outgoing.
data = current_data;
117 uint16_t values = 0x0000;
118 uint16_t clear_mask = 0xff0f;
119 for (
unsigned int i = 0; i < 4; ++i ) {
120 if ( digital_output.
mask[i] ) {
121 if ( digital_output.
values[i] ) {
122 values |= ( 1 << (i+4) );
125 clear_mask |= ( 1 << (i+4) );
128 current_data.
gp_out = (current_data.
gp_out & clear_mask) | values;
130 outgoing.
data = current_data;
161 outgoing.
data.
speed = velocity_commands[0];
177 const unsigned int &i_gain,
const unsigned int &d_gain)
213 unsigned char cmd =
static_cast<unsigned char>(
data.
command);
static Command SetControllerGain(const unsigned char &type, const unsigned int &p_gain, const unsigned int &i_gain, const unsigned int &d_gain)
static const unsigned char header1
unsigned char segment_name
const unsigned char length
static Command SetLedArray(const enum LedNumber &number, const enum LedColour &colour, Command::Data ¤t_data)
void push_back(const Type &datum)
static Command SetDigitalOutput(const DigitalOutput &digital_output, Command::Data ¤t_data)
void velocityCommands(const double &vx, const double &wz)
static Command SetVelocityControl(DiffDrive &diff_drive)
Data structure containing data for commands.
void resetBuffer(Buffer &buffer)
static Command GetVersionInfo()
bool serialise(ecl::PushAndPop< unsigned char > &byteStream)
void buildBytes(const T &V, ecl::PushAndPop< unsigned char > &buffer)
static Command PlaySoundSequence(const enum SoundSequences &number, Command::Data ¤t_data)
static Command GetControllerGain()
static const unsigned char header0
static Command SetExternalPower(const DigitalOutput &digital_output, Command::Data ¤t_data)