Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Attributes | List of all members
xbot::Command Class Reference

#include <command.hpp>

Inheritance diagram for xbot::Command:
Inheritance graph
[legend]

Classes

struct  Data
 Data structure containing data for commands. More...
 

Public Types

typedef ecl::PushAndPop< unsigned char > Buffer
 
typedef ecl::Stencil< BufferBufferStencil
 
enum  Name {
  Power = 1, BaseControl = 2, YawPlatform =3, PitchPlatform = 4,
  Sound = 5, StateLed = 6, Lift = 7
}
 

Public Member Functions

bool deserialise (ecl::PushAndPop< unsigned char > &byteStream)
 
void resetBuffer (Buffer &buffer)
 
bool serialise (ecl::PushAndPop< unsigned char > &byteStream)
 
virtual ~Command ()
 
- Public Member Functions inherited from packet_handler::payloadBase
 payloadBase (const bool is_dynamic_=false, const unsigned char length_=0)
 
virtual ~payloadBase ()
 

Static Public Member Functions

static Command SetLedControl (const unsigned char &led)
 
static Command SetLiftControl (const unsigned char &lift_height)
 
static Command SetPitchPlatformControl (const int &pitch_platform_degree)
 
static Command SetPowerControl (const bool &power_state)
 
static Command SetSoundControl (const bool &sound_state)
 
static Command SetVelocityControl (DiffDrive &diff_drive)
 
static Command SetVelocityControl (const float &speed, const float &radius)
 
static Command SetYawPlatformControl (const int &yaw_platform_degree)
 

Public Attributes

Data data
 
- Public Attributes inherited from packet_handler::payloadBase
const bool is_dynamic
 
const unsigned char length
 
bool yes
 

Static Private Attributes

static const unsigned char header0 = 0xaa
 
static const unsigned char header1 = 0x55
 

Additional Inherited Members

- Protected Member Functions inherited from packet_handler::payloadBase
template<typename T >
void buildBytes (const T &V, ecl::PushAndPop< unsigned char > &buffer)
 
template<>
void buildBytes (const float &V, ecl::PushAndPop< unsigned char > &buffer)
 
template<typename T >
void buildVariable (T &V, ecl::PushAndPop< unsigned char > &buffer)
 
template<>
void buildVariable (float &V, ecl::PushAndPop< unsigned char > &buffer)
 

Detailed Description

Definition at line 33 of file command.hpp.

Member Typedef Documentation

typedef ecl::PushAndPop<unsigned char> xbot::Command::Buffer

Definition at line 36 of file command.hpp.

Definition at line 37 of file command.hpp.

Member Enumeration Documentation

These values are used to detect the type of sub-payload that is ensuing.

Enumerator
Power 
BaseControl 
YawPlatform 
PitchPlatform 
Sound 
StateLed 
Lift 

Definition at line 42 of file command.hpp.

Constructor & Destructor Documentation

virtual xbot::Command::~Command ( )
inlinevirtual

Definition at line 98 of file command.hpp.

Member Function Documentation

bool xbot::Command::deserialise ( ecl::PushAndPop< unsigned char > &  byteStream)
inlinevirtual

Unused

Implements packet_handler::payloadBase.

Definition at line 118 of file command.hpp.

void xbot::Command::resetBuffer ( Buffer buffer)

Clears the command buffer and resets the header.

Definition at line 118 of file command.cpp.

bool xbot::Command::serialise ( ecl::PushAndPop< unsigned char > &  byteStream)
virtual

Implements packet_handler::payloadBase.

Definition at line 126 of file command.cpp.

Command xbot::Command::SetLedControl ( const unsigned char &  led)
static

Definition at line 94 of file command.cpp.

Command xbot::Command::SetLiftControl ( const unsigned char &  lift_height)
static

Definition at line 57 of file command.cpp.

Command xbot::Command::SetPitchPlatformControl ( const int &  pitch_platform_degree)
static

Definition at line 76 of file command.cpp.

Command xbot::Command::SetPowerControl ( const bool &  power_state)
static

Definition at line 104 of file command.cpp.

Command xbot::Command::SetSoundControl ( const bool &  sound_state)
static

Definition at line 85 of file command.cpp.

Command xbot::Command::SetVelocityControl ( DiffDrive diff_drive)
static

Definition at line 38 of file command.cpp.

Command xbot::Command::SetVelocityControl ( const float &  speed,
const float &  radius 
)
static

Definition at line 48 of file command.cpp.

Command xbot::Command::SetYawPlatformControl ( const int &  yaw_platform_degree)
static

Definition at line 67 of file command.cpp.

Member Data Documentation

Data xbot::Command::data

Definition at line 114 of file command.hpp.

const unsigned char xbot::Command::header0 = 0xaa
staticprivate

Definition at line 121 of file command.hpp.

const unsigned char xbot::Command::header1 = 0x55
staticprivate

Definition at line 122 of file command.hpp.


The documentation for this class was generated from the following files:


xbot_driver
Author(s): Roc, wangpeng@droid.ac.cn
autogenerated on Sat Oct 10 2020 03:27:38