cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
osaGroup Class Reference

A logical group of pucks. More...

#include <osaGroup.h>

Public Types

enum  ID {
  BROADCAST = 0x00, UPPERARM = 0x01, FOREARM = 0x02, POSITION = 0x03,
  UPPERARM_POSITION = 0x04, FOREARM_POSITION = 0x05, PROPERTY = 0x06, HAND = 0x07,
  HAND_POSITION = 0x08, LASTGROUP = 0x09
}
 The ID used to identify each group. More...
 
enum  Status { RESET =0, READY =2 }
 Define the status of a group. More...
 
enum  Errno { ESUCCESS, EFAILURE }
 Error codes used by osaGroup. More...
 

Public Member Functions

 osaGroup (osaGroup::ID id, osaCANBus *canbus, bool createfilter=true)
 Create a group with an ID and a CAN device. More...
 
osaGroup::ID GetID () const
 Return the group ID. More...
 
void AddPuckToGroup (osaPuck::ID pid)
 Add the puck ID to the group. More...
 
bool Clear () const
 
osaPuck First () const
 Return the puck ID of the first member. More...
 
osaPuck Last () const
 
bool IsEmpty () const
 
osaGroup::Errno Initialize ()
 
osaGroup::Errno Reset ()
 
osaGroup::Errno Ready ()
 
osaGroup::Errno GetStatus (std::vector< Barrett::Value > &status)
 
osaGroup::Errno GetPositions (vctDynamicVector< double > &q)
 
osaGroup::Errno SetTorques (const vctFixedSizeVector< double, 4 > &tau)
 
osaGroup::Errno SetMode (Barrett::Value mode)
 

Static Public Member Functions

static osaCANBusFrame::ID CANID (osaGroup::ID groupid)
 Convert a group ID to a CAN id. More...
 
static osaGroup::ID OriginID (osaCANBusFrame::ID canid)
 Return the origin ID of the CAN id. More...
 
static osaGroup::ID OriginID (const osaCANBusFrame &canframe)
 Return the origin ID of the CAN frame. More...
 
static osaGroup::ID DestinationID (osaCANBusFrame::ID canid)
 Return the destination ID of the CAN id. More...
 
static osaGroup::ID DestinationID (const osaCANBusFrame &canframe)
 Return the destination ID of the CAN id. More...
 
static bool IsDestinationAGroup (const osaCANBusFrame canframe)
 Return true if the CAN frame id's destination is a group (any group) More...
 

Detailed Description

A logical group of pucks.

Groups are used to communicate with pucks simultaneously. This has the benifit of saving bandwidth. For example, all the pucks belong to the BROADCAST group. Thus, when a CAN frame is destined to the BROADCAST group all the pucks will process the frame.

Member Enumeration Documentation

Error codes used by osaGroup.

Enumerator
ESUCCESS 
EFAILURE 

The ID used to identify each group.

Enumerator
BROADCAST 

The broadcast group.

The broadcast group contains all the pucks in a WAM (with the exception of the safety module)

UPPERARM 

The upper arm group.

The upper arm group represents the 4 pucks of the upper arm (shoulder+elbow)

FOREARM 

The forearm group.

The forearm group represents the 3 pucks of the upper arm (wrist)

POSITION 

The motor position group.

All pucks belong to the position group. Send a message to this group to query all the motor positions. Each puck will reply to a message to this group with its motor position

UPPERARM_POSITION 

Upper arm property group.

FOREARM_POSITION 

Forearm property group.

PROPERTY 

Feedback property group.

HAND 
HAND_POSITION 
LASTGROUP 

Define the status of a group.

Barrett defines the following mode in which a puck can be

Enumerator
RESET 
READY 

Constructor & Destructor Documentation

osaGroup::osaGroup ( osaGroup::ID  id,
osaCANBus canbus,
bool  createfilter = true 
)

Create a group with an ID and a CAN device.

Initialize the group to the given ID and give the CAN device connected to the pucks.

Parameters
groupidThe ID of the puck
canThe CAN device used to communicate with the pucks

Member Function Documentation

void osaGroup::AddPuckToGroup ( osaPuck::ID  pid)

Add the puck ID to the group.

static osaCANBusFrame::ID osaGroup::CANID ( osaGroup::ID  groupid)
static

Convert a group ID to a CAN id.

Convert the ID of a group to a CAN ID used in a CAN frame. This assumes that the origin of the CAN ID will be the host (00000)

bool osaGroup::Clear ( ) const
inline
static osaGroup::ID osaGroup::DestinationID ( osaCANBusFrame::ID  canid)
static

Return the destination ID of the CAN id.

static osaGroup::ID osaGroup::DestinationID ( const osaCANBusFrame canframe)
static

Return the destination ID of the CAN id.

osaPuck osaGroup::First ( ) const
inline

Return the puck ID of the first member.

osaGroup::ID osaGroup::GetID ( ) const

Return the group ID.

osaGroup::Errno osaGroup::GetPositions ( vctDynamicVector< double > &  q)
osaGroup::Errno osaGroup::GetStatus ( std::vector< Barrett::Value > &  status)
osaGroup::Errno osaGroup::Initialize ( )
static bool osaGroup::IsDestinationAGroup ( const osaCANBusFrame  canframe)
static

Return true if the CAN frame id's destination is a group (any group)

bool osaGroup::IsEmpty ( void  ) const
inline
osaPuck osaGroup::Last ( ) const
inline
static osaGroup::ID osaGroup::OriginID ( osaCANBusFrame::ID  canid)
static

Return the origin ID of the CAN id.

static osaGroup::ID osaGroup::OriginID ( const osaCANBusFrame canframe)
static

Return the origin ID of the CAN frame.

osaGroup::Errno osaGroup::Ready ( )
osaGroup::Errno osaGroup::Reset ( )
osaGroup::Errno osaGroup::SetMode ( Barrett::Value  mode)
osaGroup::Errno osaGroup::SetTorques ( const vctFixedSizeVector< double, 4 > &  tau)

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