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

A clas for a WAM device. More...

#include <osaWAM.h>

Inheritance diagram for osaWAM:
mtsWAM

Public Types

enum  Errno { ESUCCESS, EFAILURE }
 
enum  Configuration { WAM_4DOF, WAM_7DOF }
 
enum  Mode { MODE_IDLE, MODE_ACTIVATED }
 

Public Member Functions

 osaWAM (osaCANBus *canbus, osaWAM::Configuration configuration=WAM_7DOF)
 Default constructor. More...
 
 ~osaWAM ()
 Default destructor. More...
 
osaWAM::Errno Initialize ()
 Initialize the arm. More...
 
osaWAM::Configuration GetConfiguration () const
 Return the configuration of the WAM (4/7DOF) More...
 
osaWAM::Errno GetPositions (vctDynamicVector< double > &positions)
 Get joints positions. More...
 
osaWAM::Errno SetPositions (const vctDynamicVector< double > &positions)
 Send joints positions. More...
 
osaWAM::Errno SetTorques (const vctDynamicVector< double > &torques)
 Set joints torques. More...
 
osaWAM::Errno SetVelocityWarning (Barrett::Value velocitywarning)
 Set velocity warning. More...
 
osaWAM::Errno SetVelocityFault (Barrett::Value velocityfault)
 Set velocity fault. More...
 
osaWAM::Errno SetTorqueWarning (Barrett::Value torquewarning)
 Set torque warning. More...
 
osaWAM::Errno SetTorqueFault (Barrett::Value torquefault)
 Set torque fault. More...
 
osaWAM::Errno SetMode (Barrett::Value mode)
 Set the modes of the pucks. More...
 
osaWAM::Errno GetMode (osaWAM::Mode &mode)
 

Detailed Description

A clas for a WAM device.

Whole Arm Manipulator (WAM) is a 4-7DOF robot manufactured by Barrett Tech. From a device perspective the WAM can be interfaced from either an ethernet device (wired or wireless) or a CAN device. On the WAM, the ethernet device is connected to a PC104. Thus, when using ethernet you can communicate with the onboard computer through a shell or client/server. The downside of this is that the PC104 does all the (CAN) communication with the motors and much of the computation as well. The PC104 can be bypassed and the motor can be controlled by an external PC (see the documentation on how to configure the switches). For this, the external PC must have a CAN device and the communication with the hardware must be established and maintained. The osaWAM class implements a WAM that can be controlled from an external PC. Thus it manages the CAN bus, the pucks present on the CAN bus and the WAM's safety module. Operations are pretty basic: set motors torques, set motor positions and get motor positions.

Member Enumeration Documentation

Enumerator
WAM_4DOF 
WAM_7DOF 
Enumerator
ESUCCESS 
EFAILURE 
Enumerator
MODE_IDLE 
MODE_ACTIVATED 

Constructor & Destructor Documentation

osaWAM::osaWAM ( osaCANBus canbus,
osaWAM::Configuration  configuration = WAM_7DOF 
)

Default constructor.

Initiallize the WAM. This configures the pucks, groups and the safety module. You can use osaWAM with any CAN device, has long as it is derived from the devCAN base class.

Parameters
canbusThe CAN device used by the WAM. This device must be derived from the devCAN classe.
See Also
osaCANBus
osaWAM::~osaWAM ( )

Default destructor.

Member Function Documentation

osaWAM::Configuration osaWAM::GetConfiguration ( void  ) const
inline

Return the configuration of the WAM (4/7DOF)

osaWAM::Errno osaWAM::GetMode ( osaWAM::Mode mode)
osaWAM::Errno osaWAM::GetPositions ( vctDynamicVector< double > &  positions)

Get joints positions.

This broadcast a position query to the pucks and process all their replies. First, the replies (in encoder ticks) are converted to motors positions and then to joint angles.

Parameters
positions[out]The resulting motor positions in radians
Returns
ESUCCESS if no error occurred. EFAILURE otherwise.
osaWAM::Errno osaWAM::Initialize ( )

Initialize the arm.

Configure the groups and the pucks

osaWAM::Errno osaWAM::SetMode ( Barrett::Value  mode)

Set the modes of the pucks.

osaWAM::Errno osaWAM::SetPositions ( const vctDynamicVector< double > &  positions)

Send joints positions.

The WAM has relative encoders, which means that you must "zero" the encoders each time the WAM is powered. For this you manually move the WAM to a know configuration and then call SendPosition. First, the safety module is turned off to avoid triggering a velocity fault. Then, the joints positions are converted to encoder counts and each position is overwritten by "setting" the position on each puck. Finally, the safety module is turned back on. Note that this does not "move" the robot, it only tells each puck the absolute position of its encoder.

Parameters
positions[in]The motor positions in radians
Returns
ESUCCESS if no error occurred. EFAILURE otherwise.
osaWAM::Errno osaWAM::SetTorqueFault ( Barrett::Value  torquefault)

Set torque fault.

The safety module intercepts joints currents that are sent to the pucks. If any of these torques is greater than the torque fault limit, the safety module will shutdown the arm and display a warning on the 7-segment of the display pendant (the number of the joint with too much torque) and the "Fault Torque" LED will be on. Keep in mind that this torque limit is "one size fits all". That is the torque warning limit of motor 1 will apply to motor 7 and vice versa.

osaWAM::Errno osaWAM::SetTorques ( const vctDynamicVector< double > &  torques)

Set joints torques.

Set the torques of each joint. First this converts the joints torques to motors torques. Then it packs the torques in two CAN frames. The first frame is addressed the upper arm group and the second frame is addressed to the forearm group (if present).

Parameters
torques[in]The motor torques
Returns
ESUCCESS if no error occurred. EFAILURE otherwise
osaWAM::Errno osaWAM::SetTorqueWarning ( Barrett::Value  torquewarning)

Set torque warning.

The safety module intercepts joints currents that are sent to the pucks. If any of these torques is greater than the torque warning limit, the safety module will display a warning on the 7-segment of the display pendant (the number of the joint with too much torque) and the "Warning Torque" LED will be on. The warning won't affect anything other than warn you to ease down the torque before a torque fault shuts down the arm. Keep in mind that this torque limit is "one size fits all". That is the torque warning limit of motor 1 will apply to motor 7 and vice versa.

osaWAM::Errno osaWAM::SetVelocityFault ( Barrett::Value  velocityfault)

Set velocity fault.

The safety module intercepts joints positions and compute joints velocities from them. After "zeroing" the joints (setting their initial values), the safety module compute the Cartesian velocity of the elbos and the Cartesian velocity of the 4DOF end-effector. If any of these velocities is greater than the velocity fault threshold, the safety module will shutdown the arm and display the fault on the 7-segment of the display pendant ("E" for elbow and "A" for arm) and the "Velocity Fault" LED will be on.

osaWAM::Errno osaWAM::SetVelocityWarning ( Barrett::Value  velocitywarning)

Set velocity warning.

The safety module intercepts joints positions and compute joints velocities from them. After "zeroing" the joints (setting their initial values), the safety module compute the Cartesian velocity of the elbow and the Cartesian velocity of the 4DOF end-effector. If any of these velocities is greater than the velocity warning limit, the safety module will display a warning on the 7-segment of the display pendant ("E" for elbow and "A" for arm) and the "Warning Velocity" LED will be on. The warning won't affect anything other than warn you to slow down before a velocity fault shuts down the arm.


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