Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

AiboJoint Class Reference

#include <aibojoint.h>

Inheritance diagram for AiboJoint:

Inheritance graph
[legend]
Collaboration diagram for AiboJoint:

Collaboration graph
[legend]

Public Member Functions

 AiboJoint ()
virtual ~AiboJoint ()
int GetNumJoints () const
Methods for joint primitives
virtual void OpenPrimitives ()=0
OPrimitiveID GetJointID (int j) const
Methods for commannd vector manipulation and generation
RCRegion * FindFreeRegion () const
int FindFreeRegionIndex () const
RCRegion * GetRegion (int index=0)
virtual void NewCommandVectorData ()=0
void SetCommandVector (int index, OCommandVectorData *vec)
Methods for setting joint angles
void SetJointOPENR (slongword angle, OPrimitiveID joint, int jointIndex, int cmdVecIndex)
void SetJointOPENR (double angle, OPrimitiveID joint, int jointIndex, int cmdVecIndex)
void SetJoint (double start, double angle, OPrimitiveID joint, int jointIndex, int cmdVecIndex)
void SetJoint (double start, double angle, OPrimitiveID joint, int jointIndex, int numFrames, int cmdVecIndex)
void SetJoint (double angle, OPrimitiveID joint, int jointIndex, int cmdVecIndex)
void SetJoint (double angle, OPrimitiveID joint, int jointIndex, int numFrames, int cmdVecIndex)
void SetJoint (slongword angle, OPrimitiveID joint, int jointIndex, int cmdVecIndex)
void SetJoint (slongword angle, OPrimitiveID joint, int jointIndex, int numFrames, int cmdVecIndex)
void SetJointRelOPENR (slongword angle, OPrimitiveID joint, int jointIndex, int cmdVecIndex)
void SetJointRelOPENR (double angle, OPrimitiveID joint, int jointIndex, int cmdVecIndex)
void SetJointRel (double start, double angle, OPrimitiveID joint, int jointIndex, int cmdVecIndex)
void SetJointRel (double start, double angle, OPrimitiveID joint, int jointIndex, int numFrames, int cmdVecIndex)
void SetJointRel (double angle, OPrimitiveID joint, int jointIndex, int cmdVecIndex)
void SetJointRel (double angle, OPrimitiveID joint, int jointIndex, int numFrames, int cmdVecIndex)
void SetJointRel (slongword angle, OPrimitiveID joint, int jointIndex, int cmdVecIndex)
void SetJointRel (slongword angle, OPrimitiveID joint, int jointIndex, int numFrames, int cmdVecIndex)
void RefreshCommandVector (int cmdVecIndex)
void RefreshCommandVectors ()
void RefreshJointValue (int index)
void RefreshJointValues ()
Methods for getting joint angles
double GetJointValue (int index) const
double GetOPENRJointValue (OPrimitiveID joint) const
double GetOPENRJointValue (int joint) const
virtual double GetMaxJointValue (int index, JOINT_UNIT unit=ANGLE_RAD) const =0
virtual double GetMinJointValue (int index, JOINT_UNIT unit=ANGLE_RAD) const =0
virtual double GetMaxJointVelocity (int index, JOINT_UNIT unit=ANGLE_RAD) const =0
Methods for stetting joint gain
virtual void SetJointGain ()=0
void EnableJointGain ()
void EnableJointGain (OPrimitiveID id)
void DisableJointGain ()
void DisableJointGain (OPrimitiveID id)
Methods for state of joints
JOINT_STATE GetState () const
void SetState (JOINT_STATE st)

Data Fields

RCRegion * Region [MaxJointRegions]

Static Public Attributes

static const int MaxJointRegions = 2

Protected Attributes

JOINT_STATE State
int NumJoints
double * JointValues
OPrimitiveID * JointID
double FrameFactor [ocommandMAX_FRAMES]

Static Protected Attributes

static const word PSHIFT = 0x000e
static const word ISHIFT = 0x0002
static const word DSHIFT = 0x000f

Detailed Description

Class for manitpulation of the Aibo joints

This class gives you access to the AIBO Joints.

Warning:
You should call RefreshCommandVectors() at least once before you start any motion. because this function updates the internal data structures. It is recommended that RefreshCommandVectors() is called after a motion is completed due to the error between computed and real value.
Remarks:
When I started programming the AiboLib OPENR was in an early state and the OPENR::GetJointValue(...) function seemed to be very slow. So I decided to make up my own data structure an protocol the jont values by myself. For this reason there are the ONEN-R and non OPEN-R functions. My the problem with the slowness does not exist anymore...


Constructor & Destructor Documentation

AiboJoint::AiboJoint  ) 
 

Default constructor

AiboJoint::~AiboJoint  )  [virtual]
 

Default destructor


Member Function Documentation

virtual void AiboJoint::OpenPrimitives  )  [pure virtual]
 

Initializes the JointID's

Implemented in AiboHead, and AiboLeg.

OPrimitiveID AiboJoint::GetJointID int  j  )  const [inline]
 

RCRegion * AiboJoint::FindFreeRegion  )  const
 

Finds a free memory region (RCRegion) in which the next command data can be set

Returns:
Free RCRegion

int AiboJoint::FindFreeRegionIndex  )  const
 

Finds a free memory region (RCRegion) in which the next command data can be set

Returns:
Index of free RCRegion

RCRegion * AiboJoint::GetRegion int  index = 0  )  [inline]
 

returns the command vector corresponding to the index

virtual void AiboJoint::NewCommandVectorData  )  [pure virtual]
 

Creates a new RCRegion with a new CommandVectorData

Implemented in AiboHead, and AiboLeg.

void AiboJoint::SetCommandVector int  index,
OCommandVectorData *  vec
 

Method allows user to insert an own command vector in memory region

Parameters:
index Index of Region in which the command vector is set
vec Command vector to be set

void AiboJoint::SetJointOPENR slongword  angle,
OPrimitiveID  joint,
int  jointIndex,
int  cmdVecIndex
[inline]
 

Sets the joint value in the given command vector to a given value

Parameters:
angle The angle for the joint. UNIT: micro rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
cmdVecIndex The index of the command vector in which the data should be set
Warning:
Slow function because actual joint value is obtained by OPENR::GetJointValue(...)!! Better if you use
See also:
void SetJoint(double start, double angle, OPrimitiveID joint, int jointIndex, int cmdVecIndex)

void AiboJoint::SetJointOPENR double  angle,
OPrimitiveID  joint,
int  jointIndex,
int  cmdVecIndex
 

Sets the joint value in the given command vector to a given value and know your angles by yourself!

Parameters:
angle The angle for the joint. UNIT: micro rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
cmdVecIndex The index of the command vector in which the data should be set
Warning:
Slow function because actual joint value is obtained by OPENR::GetJointValue(...)!! Better if you use
See also:
void SetJoint(double start, double angle, OPrimitiveID joint, int jointIndex, int cmdVecIndex)

Here is the call graph for this function:

void AiboJoint::SetJoint double  start,
double  angle,
OPrimitiveID  joint,
int  jointIndex,
int  cmdVecIndex
 

Sets the joint value in the given command vector to a given value

Parameters:
start Start angle (actual Value)
angle The angle for the joint. UNIT: rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
cmdVecIndex The index of the command vector in which the data should be set
Warning:
you will have to call RefreshCommandVectors() once before this function will be fuly operational

Here is the call graph for this function:

void AiboJoint::SetJoint double  start,
double  angle,
OPrimitiveID  joint,
int  jointIndex,
int  numFrames,
int  cmdVecIndex
 

Sets the joint value in the given command vector to a given value

Parameters:
start Start angle (actual Value)
angle The angle for the joint. UNIT: rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
numFrames Number of frames in wich the position should be reached (one frame = 8ms)
cmdVecIndex The index of the command vector in which the data should be set
Warning:
: std numFrames is 16, if you use less communication may fail

you will have to call RefreshCommandVectors() once before this function will be fuly operational

Here is the call graph for this function:

void AiboJoint::SetJoint double  angle,
OPrimitiveID  joint,
int  jointIndex,
int  cmdVecIndex
[inline]
 

Sets the joint value in the given command vector to a given value

Parameters:
angle The angle for the joint. UNIT: rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
cmdVecIndex The index of the command vector in which the data should be set
Warning:
you will have to call RefreshCommandVectors() once before this function will be fuly operational

Here is the call graph for this function:

void AiboJoint::SetJoint double  angle,
OPrimitiveID  joint,
int  jointIndex,
int  numFrames,
int  cmdVecIndex
[inline]
 

Sets the joint value in the given command vector to a given value

Parameters:
angle The angle for the joint. UNIT: rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
numFrames Number of frames in wich the position should be reached (one frame + 8ms)
cmdVecIndex The index of the command vector in which the data should be set
Warning:
std numFrames is 16, if you use less communication may fail

you will have to call RefreshCommandVectors() once before this function will be fuly operational

Here is the call graph for this function:

void AiboJoint::SetJoint slongword  angle,
OPrimitiveID  joint,
int  jointIndex,
int  cmdVecIndex
[inline]
 

Sets the joint value in the given command vector to a given value

Parameters:
angle The angle for the joint. UNIT: micro rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
cmdVecIndex The index of the command vector in which the data should be set
Warning:
std numFrames is 16, if you use less communication may fail

you will have to call RefreshCommandVectors() once before this function will be fuly operational

Here is the call graph for this function:

void AiboJoint::SetJoint slongword  angle,
OPrimitiveID  joint,
int  jointIndex,
int  numFrames,
int  cmdVecIndex
[inline]
 

Sets the joint value in the given command vector to a given value

Parameters:
angle The angle for the joint. UNIT: rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
numFrames Number of frames in wich the position should be reached (one frame = 8ms)
cmdVecIndex The index of the command vector in which the data should be set
Warning:
std numFrames is 16, if you use less communication may fail

you will have to call RefreshCommandVectors() once before this function will be fuly operational

Here is the call graph for this function:

void AiboJoint::SetJointRelOPENR slongword  angle,
OPrimitiveID  joint,
int  jointIndex,
int  cmdVecIndex
[inline]
 

Sets the joint value relative to the actual value in the given command vector to a given value

Parameters:
angle The relative angle for the joint. UNIT: micro rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
cmdVecIndex The index of the command vector in which the data should be set

void AiboJoint::SetJointRelOPENR double  angle,
OPrimitiveID  joint,
int  jointIndex,
int  cmdVecIndex
 

Sets the joint value relative to the actual value in the given command vector to a given value and know the angles by yourself!

Parameters:
angle The relative angle for the joint. UNIT: micro rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
cmdVecIndex The index of the command vector in which the data should be set
Warning:
slow function because actual joint value is obtained by OPENR::GetJointValue(...)!! Better if you use
See also:
void SetJointRel(double start, double angle, OPrimitiveID joint, int jointIndex, int cmdVecIndex)

Here is the call graph for this function:

void AiboJoint::SetJointRel double  start,
double  angle,
OPrimitiveID  joint,
int  jointIndex,
int  cmdVecIndex
 

Sets the joint value relative to the actual value in the given command vector to a given value

Parameters:
start Start angle (actual Value)
angle The relative angle for the joint. UNIT: micro rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
cmdVecIndex The index of the command vector in which the data should be set
Warning:
you will have to call RefreshCommandVectors() once before this function will be fuly operational

Here is the call graph for this function:

void AiboJoint::SetJointRel double  start,
double  angle,
OPrimitiveID  joint,
int  jointIndex,
int  numFrames,
int  cmdVecIndex
 

Sets the joint value relative to the actual value in the given command vector to a given value.

Parameters:
start Start angle (actual Value).
angle The relative angle for the joint. UNIT: micro rad
joint The primitive id of the joint.
jointIndex The index of the joint in the command vector.
numFrames Number of frames in wich the position should be reached (one frame + 8ms).
cmdVecIndex The index of the command vector in which the data should be set
Warning:
std frames is 16 if you use less communication may fail.

Not more than 16 frames allowed!!

Here is the call graph for this function:

void AiboJoint::SetJointRel double  angle,
OPrimitiveID  joint,
int  jointIndex,
int  cmdVecIndex
[inline]
 

Sets the joint value relative to the actual value in the given command vector to a given value

Parameters:
angle The relative angle for the joint. UNIT: micro rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
cmdVecIndex The index of the command vector in which the data should be set
Warning:
you will have to call RefreshCommandVectors() once before this function will be fuly operational

Here is the call graph for this function:

void AiboJoint::SetJointRel double  angle,
OPrimitiveID  joint,
int  jointIndex,
int  numFrames,
int  cmdVecIndex
[inline]
 

Sets the joint value relative to the actual value in the given command vector to a given value

Parameters:
angle The relative angle for the joint. UNIT: micro rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
numFrames Number of frames in wich the position should be reached (one frame + 8ms)
Warning:
std frames is 16 if you use less communication may fail
Parameters:
cmdVecIndex The index of the command vector in which the data should be set
Warning:
you will have to call RefreshCommandVectors() once before this function will be fuly operational

Here is the call graph for this function:

void AiboJoint::SetJointRel slongword  angle,
OPrimitiveID  joint,
int  jointIndex,
int  cmdVecIndex
[inline]
 

Sets the joint value relative to the actual value in the given command vector to a given value

Parameters:
angle The relative angle for the joint. UNIT: micro rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
cmdVecIndex The index of the command vector in which the data should be set
Warning:
you will have to call RefreshCommandVectors() once before this function will be fuly operational

Here is the call graph for this function:

void AiboJoint::SetJointRel slongword  angle,
OPrimitiveID  joint,
int  jointIndex,
int  numFrames,
int  cmdVecIndex
[inline]
 

Sets the joint value relative to the actual value in the given command vector to a given value

Parameters:
angle The relative angle for the joint. UNIT: micro rad
joint The primitive id of the joint
jointIndex The index of the joint in the command vector
numFrames Number of frames in wich the position should be reached (one frame + 8ms)
cmdVecIndex The index of the command vector in which the data should be set
Warning:
std frames is 16 if you use less communication may fail.

Not more than 16 frames allowed!!

you will have to call RefreshCommandVectors() once before this function will be fuly operational

Here is the call graph for this function:

void AiboJoint::RefreshCommandVector int  cmdVecIndex  ) 
 

Sets all values of each joint in a command vector to the actual joint values

Parameters:
cmdVecIndex The Index of the command vector

Here is the call graph for this function:

void AiboJoint::RefreshCommandVectors  )  [inline]
 

Sets all values of each joint in all command vectors to the actual joint values

Here is the call graph for this function:

void AiboJoint::RefreshJointValue int  index  ) 
 

Refreshes the protocoled joint value

See also:
JointValues
Parameters:
index Index of the joint to refresh

void AiboJoint::RefreshJointValues  )  [inline]
 

Refreshes all of the protocoled joint values

See also:
JointValues

Here is the call graph for this function:

double AiboJoint::GetJointValue int  index  )  const [inline]
 

Returns the protocoled joint value (where you think you are)

Parameters:
index Index of which you want to get the actual value
Returns:
Joint Value in radians

double AiboJoint::GetOPENRJointValue OPrimitiveID  joint  )  const
 

Returns the real joint value

Parameters:
joint Joint of which you want to get the actual value
Returns:
Joint Value in radians

double AiboJoint::GetOPENRJointValue int  joint  )  const
 

Returns the real joint value

Parameters:
joint Joint of which you want to get the actual value
Returns:
Joint Value in radians

virtual double AiboJoint::GetMaxJointValue int  index,
JOINT_UNIT  unit = ANGLE_RAD
const [pure virtual]
 

Returns the max joint value for joint with the given index

Parameters:
index Joint index
unit Unit for the angle. Radians or degree?
Returns:
Max possible joint value.

Implemented in AiboHead, and AiboLeg.

virtual double AiboJoint::GetMinJointValue int  index,
JOINT_UNIT  unit = ANGLE_RAD
const [pure virtual]
 

Returns the mix joint value for joint with the given index

Parameters:
index Joint index
unit Unit for the angle. Radians or degree?
Returns:
MIN possible joint value.

Implemented in AiboHead, and AiboLeg.

virtual double AiboJoint::GetMaxJointVelocity int  index,
JOINT_UNIT  unit = ANGLE_RAD
const [pure virtual]
 

Returns the max joint velocity for joint with the given index

Parameters:
index Joint index
unit Unit for the angle. Radians/frame or degree/frame?
Returns:
Max joint velocity.

Implemented in AiboHead, and AiboLeg.

virtual void AiboJoint::SetJointGain  )  [pure virtual]
 

Sets the joint gain for all joints and enables it

Implemented in AiboHead, and AiboLeg.

void AiboJoint::EnableJointGain  )  [inline]
 

Enables the joint gain for all joints(already included in SetJoint Gain() )

void AiboJoint::EnableJointGain OPrimitiveID  id  )  [inline]
 

Enables the joint gain (already included in SetJoint Gain() )

Parameters:
id Primitive id for joint

void AiboJoint::DisableJointGain  )  [inline]
 

Disables the joint gain for all joints

void AiboJoint::DisableJointGain OPrimitiveID  id  )  [inline]
 

Disables the joint gain

Parameters:
id Primitive id for joint

JOINT_STATE AiboJoint::GetState  )  const [inline]
 

Returns the state of the joints

Returns:
JOINT_STATE of command vector

void AiboJoint::SetState JOINT_STATE  st  )  [inline]
 

Sets the Joint State to a given state

Parameters:
st Joint state

int AiboJoint::GetNumJoints  )  const [inline]
 

Returns the numer of joint of an ERS-220

Returns:
Number of joints


Field Documentation

const int AiboJoint::MaxJointRegions = 2 [static]
 

Number of maximum allowed RCRegions for joint control

RCRegion* AiboJoint::Region[MaxJointRegions]
 

Array of RCRegion s for joint control

JOINT_STATE AiboJoint::State [protected]
 

State of joints

int AiboJoint::NumJoints [protected]
 

Number of Joints

double* AiboJoint::JointValues [protected]
 

Array for joint angle protocol (where you think you are)

OPrimitiveID* AiboJoint::JointID [protected]
 

Array for storing primitive ID's

const word AiboJoint::PSHIFT = 0x000e [static, protected]
 

P-Shift value (PID-Controller) for AIBO joints

const word AiboJoint::ISHIFT = 0x0002 [static, protected]
 

I-Shift value (PID-Controller) for AIBO joints

const word AiboJoint::DSHIFT = 0x000f [static, protected]
 

D-Shift value (PID-Controller) for AIBO joints

double AiboJoint::FrameFactor[ocommandMAX_FRAMES] [protected]
 

Array for FrameFactor. Normally a motion is performed over 16 frames. This factor multiplied with die difference of current and desired value so that the gain from one frame to an other is constant. It is used in nearly every SetJoint...(...) metho.


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

tams Tim Baier AiboLib v0.2.4
Generated Thu Jan 19 11:55:35 2006 by doxygen 1.4.3