cisst-saw
|
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... | |
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.
enum osaGroup::Errno |
Error codes used by osaGroup.
Enumerator | |
---|---|
ESUCCESS | |
EFAILURE |
enum osaGroup::ID |
The ID used to identify each group.
enum osaGroup::Status |
Define the status of a group.
Barrett defines the following mode in which a puck can be
Enumerator | |
---|---|
RESET | |
READY |
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.
groupid | The ID of the puck |
can | The CAN device used to communicate with the pucks |
void osaGroup::AddPuckToGroup | ( | osaPuck::ID | pid | ) |
Add the puck ID to the group.
|
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)
|
inline |
|
static |
Return the destination ID of the CAN id.
|
static |
Return the destination ID of the CAN id.
|
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 |
Return true if the CAN frame id's destination is a group (any group)
|
inline |
|
inline |
|
static |
Return the origin ID of the CAN id.
|
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 | ) |