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

OSCAR::LimitsData Class Reference
[FileData]

Reads Limits data from a data file or programmatically create them. LimitsType template argument should either be "Position", "Velocity", "Acceleration", "Current", or "Torque". More...

#include <LimitsData.h>

Inheritance diagram for OSCAR::LimitsData:

Inheritance graph
[legend]
List of all members.

Public Types

enum  LimitsType {
  Position, Velocity, Acceleration, Current,
  Torque
}

Public Methods

 LimitsData (const String &inputFileName, OSCARError &err=DUMMY_ERROR(noError), const String &rootElementName=String("Limits"), const String name=String(""))
 LimitsData (const char *xmlDataString, OSCARError &err=DUMMY_ERROR(noError), const String &rootElementName=String("Limits"), const String name=String(""))
 LimitsData (const DOMElement *limitsElement, OSCARError &err=DUMMY_ERROR(noError), const String &rootElementName=String("Limits"), const String name=String(""))
 LimitsData (const LimitsData &rhs)
virtual ~LimitsData ()
LimitsData & operator= (const LimitsData &rhs)
const LimitsGetLimits (LimitsType limitsType) const
bool SetLimits (const Limits &limits, LimitsType limitsType)
AngleUnits GetAngleUnits () const
void SetAngleUnits (AngleUnits angUnits)
bool Output (std::ostream &out, bool nameSpaceHeader=false) const

Protected Methods

virtual bool parseParameters (const DOMElement *rootNode)
bool LimitsData::parseLimits (DOMElement *limitsTypeNode, std::vector< Limit > &limitsData)

Protected Attributes

AngleUnits angleUnits
Limitspos
Limitsvel
Limitsacc
Limitscurr
Limitstorque

Detailed Description

Author:
Chetan Kapoor

Schema supports position, velocity, current, acceleration, and torque limits


Member Enumeration Documentation

enum OSCAR::LimitsData::LimitsType
 

Enumeration values:
Position 
Velocity 
Acceleration 
Current 
Torque 


Constructor & Destructor Documentation

OSCAR::LimitsData::LimitsData const String   inputFileName,
OSCARError   err = DUMMY_ERROR(noError),
const String   rootElementName = String("Limits"),
const String    name = String("")
 

Constructor.

This is the constructor for an object of type LimitsData. Use this to construct an LimitsData object by supplying a datafile that contains the limits (pos, vel, acc, curr, torque) of the joints of robot. Possible errors that may occur include a fileOpenError or dhParamsIllformed exception. A call to LoadData() should follow a succesful constructor call.

Parameters:
filename This is a file that contains the limits data specified in XML format that conforms to schemas specified on the OSCAR web page. XML data below gives an example for a 7 DOF robot position and velocity limits <rrgOSCAR:Limits xmlns:rrgOSCAR="http://www.robotics.utexas.edu" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-177 177 -94 94 -174 174 -137 137 -255 255 -165 165 -255 255

-1.4 1.4 -1.4 1.4 -2.8 2.8 -2.8 2.8 -6.2832 6.2832 -6.2832 6.2832 -6.2832 6.2832

-100 100 -100 100 -200 200 -200 200 -628.32 628.32 -628.32 628.32 -628.32 628.32 </rrgOSCAR:Limits>

Parameters:
err A reference to an object of type OSCARError. The default OSCARError object holds values that imply a "No Error" state. This is an error code that is returned.
name An String that specifies the Name of the object being created.
Exceptions:
xmlError xmlError Call GetError() for more information

OSCAR::LimitsData::LimitsData const char *    xmlDataString,
OSCARError   err = DUMMY_ERROR(noError),
const String   rootElementName = String("Limits"),
const String    name = String("")
 

Constructor.

This is the constructor for an object of type LimitsData. Use this to construct an LimitsData object from a character string that contains XML data. A call to LoadData() should follow a succesful constructor call.

Parameters:
xmlDataString A null terminated string of char that contains XML data specific to joint limits. Each XML file should specify the data with the target namespace rrgOSCAR with namespace www.robotics.utexas.edu and conforming to the schemas defined for OSCAR. See www.robotics.utexas.edu for valid schemas.
err This is an error code that is returned.
name An String that specifies the Name of the object being created.
Exceptions:
xmlError xmlError Call GetError() for more information

OSCAR::LimitsData::LimitsData const DOMElement *    limitsElement,
OSCARError   err = DUMMY_ERROR(noError),
const String   rootElementName = String("Limits"),
const String    name = String("")
 

Constructor that allows xml data to be loaded from pre validated DOMElement. A call to LoadData() should follow a succesful constructor call.

This is the constructor for an object of type XMLData. Use this to construct an XMLData object by supplying a valid DOMElement that contains validated and well formed data representing joint limits.

Parameters:
limitsElement A parent node that contains the data that will be parsed. It is assumed that the the target namespace is rrgOSCAR with namespace www.robotics.utexas.edu and data conforms to the schemas defined for OSCAR. See www.robotics.utexas.edu for valid schemas.
err A reference to an object of type OSCARError. The default OSCARError object holds values that imply a "No Error" state. This is an error code that is returned.
name An String that specifies the Name of the object being created.
Exceptions:
xmlError xmlError Call GetError() for more information
See also:
XMLData(const String& inputFileName, OSCARError &err = DUMMY_ERROR(noError), const String name = String(" "))

LoadData()

OSCAR::LimitsData::LimitsData const LimitsData &    rhs
 

Copy Constructor.

This is the Copy Constructor for an object of type LimitsData. Use this to construct an LimitsData object from an existing LimitsData object.

Parameters:
rhs An LimitsData object that will be used to initialize this new object.

virtual OSCAR::LimitsData::~LimitsData   [virtual]
 

Destructor.

This is the Destructor for an object of type LimitsData.


Member Function Documentation

AngleUnits OSCAR::LimitsData::GetAngleUnits   const
 

const Limits* OSCAR::LimitsData::GetLimits LimitsType    limitsType const
 

Returns the limits. Calls to this method should be made after LoadData() has been called.

Parameters:
limitsType Type of the limits desired.
Returns:
A pointer to a Limits object holding limits data. If no imits are specified a 0 is returned
See also:
SetLimits()

bool OSCAR::LimitsData::LimitsData::parseLimits DOMElement *    limitsTypeNode,
std::vector< Limit > &    limitsData
[protected]
 

LimitsData& OSCAR::LimitsData::operator= const LimitsData &    rhs
 

Assignment Operator.

This is the Assignment Operator for an object of type LimitsData.

Parameters:
rhs A LimitsData object that goes on the right hand side of the = operator
Returns:
A reference to the object on the left hand side of the = operator

bool OSCAR::LimitsData::Output std::ostream &    out,
bool    nameSpaceHeader = false
const [virtual]
 

Outputs stored data in XML format. The root element for LimitsData is .

Parameters:
out A valid outputs stream to which data is outputed
nameSpaceHeader If true, the name space is appended to the root element. Normally, this should be true if you are outputting this data as a stand alone document. If you are outputting as a subset of higher level xml data, it should be false. The root node of the overall document should however output the namespace header. Default value is false.
Returns:
A true or a false. If false, call GetError() for detailed error information

Implements OSCAR::XMLData.

virtual bool OSCAR::LimitsData::parseParameters const DOMElement *    rootNode [protected, virtual]
 

Load limits data parameters from a file.

This method is used to load limits parameters from a file. A DOMNode pointer to the root of the XML data tree that needs to be parsed

Returns:
true or false. If false, call GetError for detailed information

Reimplemented from OSCAR::XMLData.

void OSCAR::LimitsData::SetAngleUnits AngleUnits    angUnits
 

bool OSCAR::LimitsData::SetLimits const Limits   limits,
LimitsType    limitsType
 

Set the limits by specifying a Limits object and the type of the limits.

Parameters:
limits A Limits object specifying the limits. This will overwrite the stored limits
limitsType Type of the limits to set.
Returns:
true or false. Call GetError() for detailed error information
See also:
GetLimits()


Member Data Documentation

Limits * OSCAR::LimitsData::acc [protected]
 

AngleUnits OSCAR::LimitsData::angleUnits [protected]
 

Limits * OSCAR::LimitsData::curr [protected]
 

Limits* OSCAR::LimitsData::pos [protected]
 

Limits * OSCAR::LimitsData::torque [protected]
 

Limits * OSCAR::LimitsData::vel [protected]
 


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