cisst-saw
|
A clas for a BH8_280 device. More...
#include <osaBH8_280.h>
Public Types | |
enum | Errno { ESUCCESS, EFAILURE } |
Public Member Functions | |
osaBH8_280 (osaCANBus *canbus) | |
Default constructor. More... | |
~osaBH8_280 () | |
Default destructor. More... | |
osaBH8_280::Errno | Initialize () |
Initialize the arm. More... | |
osaBH8_280::Errno | GetPositions (vctDynamicVector< double > &positions) |
Return the configuration of the BH8_280 (4/7DOF) More... | |
osaBH8_280::Errno | SetPositions (const vctDynamicVector< double > &positions) |
Send joints positions. More... | |
osaBH8_280::Errno | SetMode (Barrett::Value mode) |
Set joints torques. More... | |
void | Hi () |
A clas for a BH8_280 device.
Whole Arm Manipulator (BH8_280) is a 4-7DOF robot manufactured by Barrett Tech. From a device perspective the BH8_280 can be interfaced from either an ethernet device (wired or wireless) or a CAN device. On the BH8_280, 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 osaBH8_280 class implements a BH8_280 that can be controlled from an external PC. Thus it manages the CAN bus, the pucks present on the CAN bus and the BH8_280's safety module. Operations are pretty basic: set motors torques, set motor positions and get motor positions.
enum osaBH8_280::Errno |
osaBH8_280::osaBH8_280 | ( | osaCANBus * | canbus | ) |
Default constructor.
Initiallize the BH8_280. This configures the pucks, groups and the safety module. You can use osaBH8_280 with any CAN device, has long as it is derived from the devCAN base class.
canbus | The CAN device used by the BH8_280. This device must be derived from the devCAN classe. |
osaBH8_280::~osaBH8_280 | ( | ) |
Default destructor.
osaBH8_280::Errno osaBH8_280::GetPositions | ( | vctDynamicVector< double > & | positions | ) |
Return the configuration of the BH8_280 (4/7DOF)
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.
positions[out] | The resulting motor positions in radians |
void osaBH8_280::Hi | ( | ) |
osaBH8_280::Errno osaBH8_280::Initialize | ( | ) |
Initialize the arm.
Configure the groups and the pucks
osaBH8_280::Errno osaBH8_280::SetMode | ( | Barrett::Value | mode | ) |
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).
torques[in] | The motor torques |
osaBH8_280::Errno osaBH8_280::SetPositions | ( | const vctDynamicVector< double > & | positions | ) |
Send joints positions.
The BH8_280 has relative encoders, which means that you must "zero" the encoders each time the BH8_280 is powered. For this you manually move the BH8_280 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.
positions[in] | The motor positions in radians |