Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

StewartPlatformBehavior Class Reference

#include <StewartPlatformBehavior.h>

Inheritance diagram for StewartPlatformBehavior:

Inheritance graph
[legend]
List of all members.

Detailed Description

moves the legs in synchrony to emulate the capabilities of a stewart platform

Definition at line 15 of file StewartPlatformBehavior.h.

Public Member Functions

 StewartPlatformBehavior ()
 constructor
virtual ~StewartPlatformBehavior ()
 destructor
virtual void DoStart ()
 By default, merely adds to the reference counter (through AddReference()); Note you should still call this from your overriding methods.
virtual void DoStop ()
 By default, subtracts from the reference counter (RemoveReference()), and thus may deletex if zero; Don't forget to still call this when you override this; Warning: call this at the end of your DoStop(), not beginning (it might delete this ).
virtual void processEvent (const EventBase &)
 By defining here, allows you to get away with not supplying a processEvent() function for the EventListener interface. By default, does nothing.
virtual std::string getDescription () const
 Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).
virtual void setParam (const std::string &cmd, float value)
 processes a string received from wireless

Static Public Member Functions

static int callback (char *buf, int bytes)
 called by wireless when there's new data
static std::string getClassDescription ()
 Gives a short description of what this class of behaviors does... you should override this (but don't have to).

Static Public Attributes

static StewartPlatformBehaviortheOne = NULL
 Points to the one StewartPlatformBehavior object that the input command stream is talking to.

Protected Member Functions

void closeComm ()
 closes communications socket

Static Protected Member Functions

static void * getSAXHandler ()
 fills out (and returns) a xmlSAXHandler structure to control parsing of the communication stream
static bool isConnected ()
 returns true if theOne is connected
SAX functions
handles parsing of communications stream

static void sax_start_element (StewartPlatformBehavior *inst, const char *name, const char **attrs)
static void sax_end_element (StewartPlatformBehavior *inst, const char *name)
static void sax_end_doc (StewartPlatformBehavior *inst)
static void sax_warning (StewartPlatformBehavior *inst, const char *msg,...)
static void sax_error (StewartPlatformBehavior *inst, const char *msg,...)
static void sax_fatal_error (StewartPlatformBehavior *inst, const char *msg,...)

Protected Attributes

Socketcmdsock
 The input command stream socket.
int sock
 the socket number so we can test if cmdsock is still valid
void * ctxt
 contains parsing context regarding communication socket
bool docClosed
 set to true by sax routines if the socket should be closed
MotionManager::MC_ID pose_id
 The estop to control.

Private Member Functions

 StewartPlatformBehavior (const StewartPlatformBehavior &)
 don't call
StewartPlatformBehavior operator= (const StewartPlatformBehavior &)
 don't call


Constructor & Destructor Documentation

StewartPlatformBehavior::StewartPlatformBehavior  )  [inline]
 

constructor

Definition at line 24 of file StewartPlatformBehavior.h.

virtual StewartPlatformBehavior::~StewartPlatformBehavior  )  [inline, virtual]
 

destructor

Definition at line 32 of file StewartPlatformBehavior.h.

StewartPlatformBehavior::StewartPlatformBehavior const StewartPlatformBehavior  )  [private]
 

don't call


Member Function Documentation

int StewartPlatformBehavior::callback char *  buf,
int  bytes
[static]
 

called by wireless when there's new data

Definition at line 67 of file StewartPlatformBehavior.cc.

Referenced by DoStart().

void StewartPlatformBehavior::closeComm  )  [protected]
 

closes communications socket

Definition at line 182 of file StewartPlatformBehavior.cc.

Referenced by callback(), and DoStop().

void StewartPlatformBehavior::DoStart  )  [virtual]
 

By default, merely adds to the reference counter (through AddReference()); Note you should still call this from your overriding methods.

Reimplemented from BehaviorBase.

Definition at line 12 of file StewartPlatformBehavior.cc.

void StewartPlatformBehavior::DoStop  )  [virtual]
 

By default, subtracts from the reference counter (RemoveReference()), and thus may deletex if zero; Don't forget to still call this when you override this; Warning: call this at the end of your DoStop(), not beginning (it might delete this ).

Reimplemented from BehaviorBase.

Definition at line 23 of file StewartPlatformBehavior.cc.

static std::string StewartPlatformBehavior::getClassDescription  )  [inline, static]
 

Gives a short description of what this class of behaviors does... you should override this (but don't have to).

If you do override this, also consider overriding getDescription() to return it

Reimplemented from BehaviorBase.

Definition at line 42 of file StewartPlatformBehavior.h.

Referenced by getDescription().

virtual std::string StewartPlatformBehavior::getDescription  )  const [inline, virtual]
 

Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).

By default simply returns getName(), because any calls from a BehaviorBase function to getClassDescription() are going to call BehaviorBase::getClassDescription(), not ~YourSubClass~getClassDescription(), because static functions can't be virtual in C++ (doh!)

This means that getDescription called on a pointer to a BehaviorBase of unknown subtype would always return an empty string, which is pretty useless. So instead we return the name in this situation. If you want getDescription to return getClassDescription, you'll have to override it in your subclass to do so.

Reimplemented from BehaviorBase.

Definition at line 47 of file StewartPlatformBehavior.h.

void * StewartPlatformBehavior::getSAXHandler  )  [static, protected]
 

fills out (and returns) a xmlSAXHandler structure to control parsing of the communication stream

Definition at line 50 of file StewartPlatformBehavior.cc.

Referenced by callback().

bool StewartPlatformBehavior::isConnected  )  [static, protected]
 

returns true if theOne is connected

Definition at line 165 of file StewartPlatformBehavior.cc.

StewartPlatformBehavior StewartPlatformBehavior::operator= const StewartPlatformBehavior  )  [private]
 

don't call

void StewartPlatformBehavior::processEvent const EventBase  )  [virtual]
 

By defining here, allows you to get away with not supplying a processEvent() function for the EventListener interface. By default, does nothing.

Reimplemented from BehaviorBase.

Definition at line 47 of file StewartPlatformBehavior.cc.

void StewartPlatformBehavior::sax_end_doc StewartPlatformBehavior inst  )  [static, protected]
 

Definition at line 137 of file StewartPlatformBehavior.cc.

Referenced by getSAXHandler().

void StewartPlatformBehavior::sax_end_element StewartPlatformBehavior inst,
const char *  name
[static, protected]
 

Definition at line 130 of file StewartPlatformBehavior.cc.

Referenced by getSAXHandler().

void StewartPlatformBehavior::sax_error StewartPlatformBehavior inst,
const char *  msg,
  ...
[static, protected]
 

Definition at line 149 of file StewartPlatformBehavior.cc.

Referenced by getSAXHandler().

void StewartPlatformBehavior::sax_fatal_error StewartPlatformBehavior inst,
const char *  msg,
  ...
[static, protected]
 

Definition at line 157 of file StewartPlatformBehavior.cc.

Referenced by getSAXHandler().

void StewartPlatformBehavior::sax_start_element StewartPlatformBehavior inst,
const char *  name,
const char **  attrs
[static, protected]
 

Definition at line 103 of file StewartPlatformBehavior.cc.

Referenced by getSAXHandler().

void StewartPlatformBehavior::sax_warning StewartPlatformBehavior inst,
const char *  msg,
  ...
[static, protected]
 

Definition at line 141 of file StewartPlatformBehavior.cc.

Referenced by getSAXHandler().

void StewartPlatformBehavior::setParam const std::string &  cmd,
float  value
[virtual]
 

processes a string received from wireless

Definition at line 34 of file StewartPlatformBehavior.cc.

Referenced by sax_start_element().


Member Data Documentation

Socket* StewartPlatformBehavior::cmdsock [protected]
 

The input command stream socket.

Definition at line 53 of file StewartPlatformBehavior.h.

Referenced by closeComm(), DoStart(), DoStop(), isConnected(), and sax_start_element().

void* StewartPlatformBehavior::ctxt [protected]
 

contains parsing context regarding communication socket

Definition at line 57 of file StewartPlatformBehavior.h.

Referenced by callback(), closeComm(), and isConnected().

bool StewartPlatformBehavior::docClosed [protected]
 

set to true by sax routines if the socket should be closed

Definition at line 59 of file StewartPlatformBehavior.h.

Referenced by callback(), sax_end_doc(), and sax_end_element().

MotionManager::MC_ID StewartPlatformBehavior::pose_id [protected]
 

The estop to control.

Definition at line 62 of file StewartPlatformBehavior.h.

int StewartPlatformBehavior::sock [protected]
 

the socket number so we can test if cmdsock is still valid

Definition at line 54 of file StewartPlatformBehavior.h.

Referenced by DoStart(), and isConnected().

StewartPlatformBehavior * StewartPlatformBehavior::theOne = NULL [static]
 

Points to the one StewartPlatformBehavior object that the input command stream is talking to.

Definition at line 19 of file StewartPlatformBehavior.h.

Referenced by callback(), isConnected(), StewartPlatformBehavior(), and ~StewartPlatformBehavior().


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

Tekkotsu v2.4.1
Generated Tue Aug 16 16:35:10 2005 by Doxygen 1.4.4