Alex exoskeleton
ALEX SoftwareDocumentation
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ActuatedJoint Class Referenceabstract

Abstract class representing an actuated joint in a Robot Class (extending joint). Requires a Drive object through which commands are sent. More...

#include <ActuatedJoint.h>

Inheritance diagram for ActuatedJoint:
Inheritance graph
Collaboration diagram for ActuatedJoint:
Collaboration graph

Public Member Functions

 ActuatedJoint (int jointID, double jointMin, double jointMax, Drive *drive)
 Construct a new Actuated Joint object. More...
 
virtual ControlMode setMode (ControlMode driveMode_, motorProfile profile)
 Set the mode of the device (nominally, position, velocity or torque control) More...
 
virtual setMovementReturnCode_t setPosition (double desQ)
 Set the Position object. More...
 
virtual setMovementReturnCode_t setVelocity (double velocity)
 Sets a velocity set point (in joint units) More...
 
virtual setMovementReturnCode_t setTorque (double torque)
 Set the torque set point. More...
 
virtual void readyToSwitchOn ()
 Set the joint ready to switch On. More...
 
bool enable ()
 Enable the joint. More...
 
- Public Member Functions inherited from Joint
 Joint (int jointID, double jointMin, double jointMax)
 Construct a new Joint object. More...
 
 Joint (int jointID, double jointMin, double jointMax, double q0)
 Construct a new Joint object with initial value for the joint. More...
 
 ~Joint ()
 Destroy the Joint object. More...
 
int getId ()
 Get the Id object. More...
 
double getQ ()
 Returns the internal value of the joint (e.g. Angle, length, depending on joint type) More...
 
void getStatus ()
 prints out the status of the joints current position in degrees More...
 
virtual bool updateValue ()=0
 Updates the value of the joint. This will read the value from hardware, and update the software's current representation of the value. More...
 
virtual bool initNetwork ()=0
 Pure virtual function for initialising the underlying CANopen Network to send and recieve PDO messages for this joint. More...
 

Protected Member Functions

virtual int toDriveUnits (double jointValue)=0
 Converts from the joint value to the equivalent value for the drive. More...
 
virtual double fromDriveUnits (int driveValue)=0
 Converts from the drive value to the equivalent value for the joint. More...
 

Protected Attributes

Drivedrive
 Contains a Drive object, which is a CANOpen device which is used to control the physical hardware. More...
 
ControlMode driveMode = UNCONFIGURED
 The current mode of the drive. More...
 
- Protected Attributes inherited from Joint
const int id
 
double q
 
const double qMin
 
const double qMax
 

Detailed Description

Abstract class representing an actuated joint in a Robot Class (extending joint). Requires a Drive object through which commands are sent.

Definition at line 32 of file ActuatedJoint.h.

Constructor & Destructor Documentation

ActuatedJoint::ActuatedJoint ( int  jointID,
double  jointMin,
double  jointMax,
Drive drive 
)

Construct a new Actuated Joint object.

Parameters
jointIDUnique ID representing the joint (not checked in this class)
jointMinMinimum allowable value for the joint
jointMaxMaximum allowable value for the joint

The ActuatedJoint class is a abstract class which represents a joint in a Robot objec. This class implements the Joint class, and specifically represents a joint which is actuated. This therefore requires a Drive object which will be used to interact with the physical hardware.

Version 0.1 Date: 09/04/2020

Definition at line 16 of file ActuatedJoint.cpp.

Member Function Documentation

bool ActuatedJoint::enable ( )

Enable the joint.

Returns
true if succesful
false if drive is currently not in the correct state to enable

Definition at line 61 of file ActuatedJoint.cpp.

virtual double ActuatedJoint::fromDriveUnits ( int  driveValue)
protectedpure virtual

Converts from the drive value to the equivalent value for the joint.

Notes:

  • The drive value is always an integer (due to the CANOpen specification) and the joint value is always a double (data type of q)
  • This may be a linear relationship (e.g. degrees to encoder counts) or a more complicated one (e.g. linear actuator position to degrees) depending on the structure of the device and system.
Parameters
driveValueThe drive value to be converted
Returns
The equivalent joint value for the given drive value

Implemented in DummyActJoint.

void ActuatedJoint::readyToSwitchOn ( )
virtual

Set the joint ready to switch On.

Definition at line 57 of file ActuatedJoint.cpp.

ControlMode ActuatedJoint::setMode ( ControlMode  driveMode_,
motorProfile  profile 
)
virtual

Set the mode of the device (nominally, position, velocity or torque control)

Parameters
driveModeThe mode to be used if possible
motorProfilevariables for desired mode, e.g. postion: v,a and deceleration.
Returns
ControlMode Configured Drive Mode, -1 if unsuccessful

Definition at line 20 of file ActuatedJoint.cpp.

setMovementReturnCode_t ActuatedJoint::setPosition ( double  desQ)
virtual

Set the Position object.

Parameters
desQThe desired set position
Returns
setMovementReturnCode_t The result of the setting

Reimplemented in DummyActJoint.

Definition at line 31 of file ActuatedJoint.cpp.

setMovementReturnCode_t ActuatedJoint::setTorque ( double  torque)
virtual

Set the torque set point.

Parameters
torqueThe desired set position
Returns
setMovementReturnCode_t The result of the setting

Definition at line 52 of file ActuatedJoint.cpp.

setMovementReturnCode_t ActuatedJoint::setVelocity ( double  velocity)
virtual

Sets a velocity set point (in joint units)

Parameters
velocityThe desired set position
Returns
setMovementReturnCode_t The result of the setting

Definition at line 42 of file ActuatedJoint.cpp.

virtual int ActuatedJoint::toDriveUnits ( double  jointValue)
protectedpure virtual

Converts from the joint value to the equivalent value for the drive.

Notes:

  • The drive value is always an integer (due to the CANOpen specification) and the joint value is always a double (data type of q)
  • This may be a linear relationship (e.g. degrees to encoder counts) or a more complicated one (e.g. linear actuator position to degrees) depending on the structure of the device and system.
Parameters
jointValueThe joint value to be converted
Returns
int The equivalent drive value for the given joint value

Implemented in DummyActJoint.

Member Data Documentation

Drive* ActuatedJoint::drive
protected

Contains a Drive object, which is a CANOpen device which is used to control the physical hardware.

Definition at line 39 of file ActuatedJoint.h.

ControlMode ActuatedJoint::driveMode = UNCONFIGURED
protected

The current mode of the drive.

Definition at line 45 of file ActuatedJoint.h.


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