Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OSCAR::PowerCubeBase Class Reference
[Device]

This is an abstract class for Amtec's PowerCube Interface (both hardware and simulation modules inherit from this class.) having following functionality -Initialization -Homing -Resetting -functionality related to gripper -retrieving and setting different attributes (like current limits). More...

#include <PowerCubeBase.h>

Inheritance diagram for OSCAR::PowerCubeBase:

Inheritance graph
[legend]
List of all members.

Public Methods

 PowerCubeBase (const unsigned int _dof, const bool _hasGripper, const String &name=String(), OSCARError &_err=DUMMY_ERROR(noError))
virtual ~PowerCubeBase ()
bool GetInitString (String &_initString)
virtual bool GetNumModules (unsigned int &count)=0
virtual bool HasGripper ()
virtual bool Home (unsigned int modNo)
virtual bool HomeQuiet (unsigned int modNo)
bool Home (BoolArray bHomeArray)
bool Home ()
virtual bool Halt ()=0
virtual bool Reset (unsigned int modNo)
bool Reset (const BoolArray &bResetArray)
bool Reset ()
virtual bool OpenGripper (double openPos)
virtual bool GetCurrent (VectorF &currentArray)
virtual bool GetCurrentLimits (VectorF &currentLimits)
virtual bool SetCurrentLimits (const VectorF &currentLimits)
bool GetMotionTime (double &_time)
bool SetMotionTime (double _dTimeStep)
bool GetExcessError (ControlType _type, VectorF &_excessError)
bool SetExcessError (ControlType _type, const VectorF &_excessError)
virtual bool GetStatusFlag (unsigned int modNo, unsigned long flag, bool &isSet)
bool CheckExcessError (ControlType _type, const VectorF &values, BoolArray &isExcess)

Protected Methods

bool checkPositionExcessError (const VectorF &pos, BoolArray &isExcess)
bool checkVelocityExcessError (const VectorF &vel, BoolArray &isExcess)
bool checkPositionExcessError (int modNo, const float pos, bool &isExcess)
bool checkVelocityExcessError (int modNo, const float vel, bool &isExcess)
virtual bool getPosition (VectorF &jointValues)=0
virtual bool setPosition (const VectorF &jointValues)=0
virtual bool getVelocity (VectorF &jointVelocities)=0
virtual bool setVelocity (const VectorF &jointVelocities)=0
virtual bool setVelocityLimits (const VectorF &_minJointVel, const VectorF &_maxJointVel)

Protected Attributes

double dTimeStep
int iDevice
unsigned int iNumModules
bool bHasGripper
String initString
int iIDMap [MAX_MODULES]
bool isPosExcessErrorSet
bool isVelExcessErrorSet
bool isMotionTimeSet
VectorF fPosExcessError
VectorF fVelExcessError

Detailed Description

Author:
Initial Implementation: Ed Jung


Constructor & Destructor Documentation

OSCAR::PowerCubeBase::PowerCubeBase const unsigned int    _dof,
const bool    _hasGripper,
const String   name = String(),
OSCARError   _err = DUMMY_ERROR(noError)
 

Constructor for the PowerCubeBase class. This class is an abstract class:.

Parameters:
const unsigned int _dof = Corresponds to the number of modules connected to the CAN bus const bool _hasGripper = true if a gripper is attached = false otherwise const String& name = This is an object name to facilitate easy reference to the PowerCubeInterface object within the application OSCARError& err = An OSCAR error object that is used to handle errors generated.
Exceptions:
\sa ~PowerCubeBase()

virtual OSCAR::PowerCubeBase::~PowerCubeBase   [virtual]
 

Destructor for the PowerCubeBase class. It is an abstract class:.

See also:
PowerCubeBase(


Member Function Documentation

bool OSCAR::PowerCubeBase::CheckExcessError ControlType    _type,
const VectorF   values,
BoolArray   isExcess
 

bool OSCAR::PowerCubeBase::checkPositionExcessError int    modNo,
const float    pos,
bool &    isExcess
[protected]
 

bool OSCAR::PowerCubeBase::checkPositionExcessError const VectorF   pos,
BoolArray   isExcess
[protected]
 

bool OSCAR::PowerCubeBase::checkVelocityExcessError int    modNo,
const float    vel,
bool &    isExcess
[protected]
 

bool OSCAR::PowerCubeBase::checkVelocityExcessError const VectorF   vel,
BoolArray   isExcess
[protected]
 

virtual bool OSCAR::PowerCubeBase::GetCurrent VectorF   currentArray [virtual]
 

Gets current of modules -This method must be overriden. The method only performs input data checking, so in the derived class method, the base class method must be called first.

Parameters:
VectorF& currentArray = Float array of size equal to the number of modules
Returns:
bool = true if the command is sent successfully

Reimplemented in OSCAR::PCRoboworksInterface, and OSCAR::PowerCubeInterface.

virtual bool OSCAR::PowerCubeBase::GetCurrentLimits VectorF   currentLimits [virtual]
 

Gets max allowable current -This method must be overriden. The method only performs input data checking, so in the derived class method, the base class method must be called first.

Parameters:
VectorF& currentLimit = Float array of size equal to the number of modules
Returns:
bool = true if the command is sent successfully

Reimplemented in OSCAR::PowerCubeInterface.

bool OSCAR::PowerCubeBase::GetExcessError ControlType    _type,
VectorF   _excessError
 

Gets the protected member excess error.

Returns:
: void
Parameters:
ControlType _type = type of error (Position, Velocity, Current) VectorF& _excessError = array to store the excess error for each module
See also:
SetExcessError()

bool OSCAR::PowerCubeBase::GetInitString String   _initString
 

Gets initialization string for robot.

Parameters:
String _initString = Specifies the CAN bus device used, the port number , and the baud rate in kbps. Example "ESD:0,250", which means that the CAN bus device used is ESD CAN device, 0 is the port number on the host computer, and 250 kbps is the baudrate
Returns:
bool = true if command successful

bool OSCAR::PowerCubeBase::GetMotionTime double &    _time
 

gets the timestep -This method must be overriden. The method only performs input data checking, so in the derived class method, the base class method must be called first.

Parameters:
double& _time = the timestep
Returns:
bool = true if the command is successful

virtual bool OSCAR::PowerCubeBase::GetNumModules unsigned int &    count [pure virtual]
 

pure virtual: Gets the number of modules attached to the robot.

Parameters:
unsigned int& count = number of modules
Returns:
bool = true if the number of modules is successfully read, false if not

Implemented in OSCAR::PCRoboworksInterface, and OSCAR::PowerCubeInterface.

virtual bool OSCAR::PowerCubeBase::getPosition VectorF   jointValues [protected, pure virtual]
 

Reimplemented from OSCAR::RobotServoInterface.

Implemented in OSCAR::PCRoboworksInterface, and OSCAR::PowerCubeInterface.

virtual bool OSCAR::PowerCubeBase::GetStatusFlag unsigned int    modNo,
unsigned long    flag,
bool &    isSet
[virtual]
 

Brief Checks whether or not a status flag is set for a module -This method must be overriden.

The method only performs input data checking, so in the derived class method, the base class method must be called first.

Returns:
bool returns error codes from the m5 api provided by Amtec.
Parameters:
input: modNo = the module number of the module flag = the status flag to check. These are described in the Amtec documentation. isSet = returns true if the flag is set, false if not.

Reimplemented in OSCAR::PCRoboworksInterface, and OSCAR::PowerCubeInterface.

virtual bool OSCAR::PowerCubeBase::getVelocity VectorF   jointVelocities [protected, pure virtual]
 

Reimplemented from OSCAR::RobotServoInterface.

Implemented in OSCAR::PCRoboworksInterface, and OSCAR::PowerCubeInterface.

virtual bool OSCAR::PowerCubeBase::Halt   [pure virtual]
 

pure virtual: Stops all modules immediately.Modules cannot be moved until they are reset.

Returns:
bool = true if no error

Implemented in OSCAR::PCRoboworksInterface, and OSCAR::PowerCubeInterface.

virtual bool OSCAR::PowerCubeBase::HasGripper   [virtual]
 

Tells whether or not a powercube gripper is attached.

Returns:
bool = true if powercube gripper is attached, false if not

bool OSCAR::PowerCubeBase::Home  
 

-Sends all modules to the home position. -Functionality implemented in derived class.

Returns:
bool = true if no error

bool OSCAR::PowerCubeBase::Home BoolArray    bHomeArray
 

-Sends modules to the home position. -Functionality implemented in derived class. -example: For a 3DOF robot BoolArray bInitArray(3, {true, false, true}); robot.Home(bInitArray); This call would send modules 1 and 3 home.

Parameters:
BoolArray bHomeArray = Boolean array of modules to initialize
Returns:
bool = true if modules are homed successfully

virtual bool OSCAR::PowerCubeBase::Home unsigned int    modNo [virtual]
 

-Sends a single module to the zero position. -Functionality implemented in derived class. example: For a 3DOF robot, robot.Home(2); This command would home module 3 -This method must be overriden. The method only performs input data checking, so in the derived class method, the base class method must be called first.

Parameters:
unsigned int modNo = Module number. Indexing starts at 0, so the first module would be 0, the second module would be 1, etc...
Returns:
bool = true if module homed successfully

Reimplemented in OSCAR::PCRoboworksInterface, and OSCAR::PowerCubeInterface.

virtual bool OSCAR::PowerCubeBase::HomeQuiet unsigned int    modNo [virtual]
 

-Sends a single module to the zero position, without interactive confirmation -Functionality implemented in derived class. example: For a 3DOF robot, robot.Home(2); This command would home module 3 -This method must be overriden. The method only performs range check on supplied model number. There is no interactive confirmation. So in the derived class method, the base class method must be called first.

Parameters:
unsigned int modNo = Module number. Indexing starts at 0, so the first module would be 0, the second module would be 1, etc...
Returns:
bool = true if module homed successfully

Reimplemented in OSCAR::PCRoboworksInterface, and OSCAR::PowerCubeInterface.

virtual bool OSCAR::PowerCubeBase::OpenGripper double    openPos [virtual]
 

open the gripper if present -This method must be overriden. The method only performs input data checking, so in the derived class method, the base class method must be called first.

Parameters:
double openPos = position to send gripper to
Returns:
bool = true if the command is sent successfully

Reimplemented in OSCAR::PCRoboworksInterface, and OSCAR::PowerCubeInterface.

bool OSCAR::PowerCubeBase::Reset  
 

Resets all modules to recover from an error or halt condition. -After an error or halt command which causes the module to stop running this command must be sent to reset all the modules from the error condition. This command cannot be used to recover from certain error conditions. See Amtec docs.

Returns:
bool = true if the reset command is sent successfully

bool OSCAR::PowerCubeBase::Reset const BoolArray   bResetArray
 

Resets modules to recover from an error or halt condition. -example: for a 3DOF robot; BoolArray bResetArray(3, {true, false, true}); robot.reset(bResetArray); -After an error or halt command which causes the module to stop running this command must be sent to reset all the modules from the error condition. This command cannot be used to recover from certain error conditions. See Amtec docs.

Parameters:
BoolArray& bResetArray = Boolean array of modules to reset
Returns:
bool

virtual bool OSCAR::PowerCubeBase::Reset unsigned int    modNo [virtual]
 

Resets modules to recover from an error or halt condition. -example: robot.reset(2); This call would reset module 3. -After an error or halt command which causes the module to stop running this command must be sent to reset all the modules from the error condition. This command cannot be used to recover from certain error conditions. See Amtec docs. -This method must be overriden. The method only performs input data checking, so in the derived class method, the base class method must be called first.

Parameters:
unsigned int modNo = the module number to be reseted handle.
Returns:
bool

Reimplemented in OSCAR::PCRoboworksInterface.

virtual bool OSCAR::PowerCubeBase::SetCurrentLimits const VectorF   currentLimits [virtual]
 

sets max allowable current -This method must be overriden. The method only performs input data checking, so in the derived class method, the base class method must be called first.

Parameters:
VectorF& currentLimit = Float array of size equal to the number of modules
Returns:
bool = true if the command is sent successfully

Reimplemented in OSCAR::PowerCubeInterface.

bool OSCAR::PowerCubeBase::SetExcessError ControlType    _type,
const VectorF   _excessError
 

Sets the protected member excess error. -This method is used to trap sudden moves in software -If the difference between any two successive servo commands exceeds the excess error, an error will be set and the command will not execute -This method must be called before executing any motion commands. The default value for a new instance is 0, so no movements will be executed.

Returns:
void
Parameters:
ControlType _type -- {Position, Velocity, Torque}. Sets whether the excess error is for Position, Velocity, or Torque. Torque is not suppoprte const VectorF& _excessError -- array to store the excess error for each module
See also:
GetExcessError()

bool OSCAR::PowerCubeBase::SetMotionTime double    _dTimeStep
 

Sets protected data member dTimeStep.

Returns:
bool= true if timestep is valid, false otherwise
Parameters:
double _dTimeStep = time step for position moves in milliseconds

virtual bool OSCAR::PowerCubeBase::setPosition const VectorF   jointValues [protected, pure virtual]
 

Reimplemented from OSCAR::RobotServoInterface.

Implemented in OSCAR::PCRoboworksInterface, and OSCAR::PowerCubeInterface.

virtual bool OSCAR::PowerCubeBase::setVelocity const VectorF   jointVelocities [protected, pure virtual]
 

Reimplemented from OSCAR::RobotServoInterface.

Implemented in OSCAR::PCRoboworksInterface, and OSCAR::PowerCubeInterface.

virtual bool OSCAR::PowerCubeBase::setVelocityLimits const VectorF   _minJointVel,
const VectorF   _maxJointVel
[protected, virtual]
 

Reimplemented from OSCAR::RobotServoInterface.

Reimplemented in OSCAR::PCRoboworksInterface, and OSCAR::PowerCubeInterface.


Member Data Documentation

bool OSCAR::PowerCubeBase::bHasGripper [protected]
 

double OSCAR::PowerCubeBase::dTimeStep [protected]
 

VectorF OSCAR::PowerCubeBase::fPosExcessError [protected]
 

VectorF OSCAR::PowerCubeBase::fVelExcessError [protected]
 

int OSCAR::PowerCubeBase::iDevice [protected]
 

int OSCAR::PowerCubeBase::iIDMap[MAX_MODULES] [protected]
 

String OSCAR::PowerCubeBase::initString [protected]
 

unsigned int OSCAR::PowerCubeBase::iNumModules [protected]
 

bool OSCAR::PowerCubeBase::isMotionTimeSet [protected]
 

bool OSCAR::PowerCubeBase::isPosExcessErrorSet [protected]
 

bool OSCAR::PowerCubeBase::isVelExcessErrorSet [protected]
 


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations