Libbarrett  1.2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Attributes | Static Protected Attributes
barrett::Puck Class Reference

List of all members.

Classes

struct  StandardParser

Public Types

enum  RoleOption {
  RO_MagEncOnSerial = 0x0100, RO_MagEncOnHall = 0x0200, RO_MagEncOnEnc = 0x400, RO_Strain = 0x0800,
  RO_Tact = 0x1000, RO_IMU = 0x2000, RO_OpticalEncOnEnc = 0x4000
}
enum  PuckType {
  PT_Monitor, PT_Safety, PT_Motor, PT_ForceTorque,
  PT_Unknown
}

Public Member Functions

 Puck (const bus::CommunicationsBus &bus, int id)
void wake ()
int getProperty (enum Property prop, bool realtime=false) const
template<typename Parser >
void getProperty (enum Property prop, typename Parser::result_type *result, bool realtime=false) const
void setProperty (enum Property prop, int value, bool blocking=false) const
void saveProperty (enum Property prop) const
void saveAllProperties () const
void resetProperty (enum Property prop) const
bool respondsToProperty (enum Property prop) const
int getPropertyId (enum Property prop) const throw (std::runtime_error)
int getPropertyIdNoThrow (enum Property prop) const
void updateRole ()
void updateStatus ()
const bus::CommunicationsBusgetBus () const
int getId () const
int getVers () const
int getRole () const
bool hasOption (enum RoleOption ro) const
enum PuckType getType () const
enum PuckType getEffectiveType () const

Static Public Member Functions

static const char * getPuckTypeStr (enum PuckType pt)
static const char * getPropertyStr (enum Property prop)
static enum Property getPropertyEnum (const char *str) throw (std::invalid_argument)
static enum Property getPropertyEnumNoThrow (const char *str)
static void wake (std::vector< Puck * > pucks)
static int getProperty (const bus::CommunicationsBus &bus, int id, int propId, bool realtime=false)
template<typename Parser >
static void getProperty (const bus::CommunicationsBus &bus, int id, int propId, typename Parser::result_type *result, bool realtime=false)
static int tryGetProperty (const bus::CommunicationsBus &bus, int id, int propId, int *result, double timeout_s=0.001)
template<typename Parser >
static int tryGetProperty (const bus::CommunicationsBus &bus, int id, int propId, typename Parser::result_type *result, double timeout_s=0.001)
static void setProperty (const bus::CommunicationsBus &bus, int id, int propId, int value, bool blocking=false)
static int sendGetPropertyRequest (const bus::CommunicationsBus &bus, int id, int propId)
static int receiveGetPropertyReply (const bus::CommunicationsBus &bus, int id, int propId, int *result, bool blocking, bool realtime)
template<typename Parser >
static int receiveGetPropertyReply (const bus::CommunicationsBus &bus, int id, int propId, typename Parser::result_type *result, bool blocking, bool realtime)
static bool respondsToProperty (enum Property prop, enum PuckType pt, int fwVers)
static int getPropertyId (enum Property prop, enum PuckType pt, int fwVers) throw (std::runtime_error)
static int getPropertyIdNoThrow (enum Property prop, enum PuckType pt, int fwVers)
static int nodeId2BusId (int id)
static int busId2NodeId (int busId)
static int encodeBusId (int fromId, int toId)
static void decodeBusId (int busId, int *fromId, int *toId)

Static Public Attributes

static const int DEFAULT_IPNM = 2700
static const int MIN_ID = 1
static const int MAX_ID = 31
static const int HOST_ID = 0
static const int NODE_ID_WIDTH = 5
static const int NODE_ID_MASK = 0x1f
static const int GROUP_MASK = 0x400
static const int FROM_MASK = 0x3e0
static const int TO_MASK = 0x41f
static const int SET_MASK = 0x80
static const int PROPERTY_MASK = 0x7f
static const double WAKE_UP_TIME = 1.0
static const double TURN_OFF_TIME = 0.01

Protected Types

enum  { STATUS_RESET, STATUS_ERR, STATUS_READY }
enum  {
  ROLE_TATER, ROLE_GIMBALS, ROLE_SAFETY, ROLE_WRAPTOR,
  ROLE_TRIGGER, ROLE_BHAND, ROLE_FORCE
}

Protected Attributes

const bus::CommunicationsBusbus
int id
int vers
int role
enum PuckType type effectiveType

Static Protected Attributes

static const int ROLE_MASK = 0x1f

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines