Alex exoskeleton
ALEX SoftwareDocumentation
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DummyActJoint Class Reference

Example implementation of the ActuatedJoints class. More...

#include <DummyActJoint.h>

Inheritance diagram for DummyActJoint:
Inheritance graph
Collaboration diagram for DummyActJoint:
Collaboration graph

Public Member Functions

 DummyActJoint (int jointID, double jointMin, double jointMax, Drive *drive)
 
bool updateValue ()
 Updates the value of the joint. This will read the value from hardware, and update the software's current representation of the value. More...
 
setMovementReturnCode_t setPosition (double desQ)
 Set the Position object. More...
 
bool initNetwork ()
 Pure virtual function for initialising the underlying CANopen Network to send and recieve PDO messages for this joint. More...
 
double getQ ()
 
- Public Member Functions inherited from ActuatedJoint
 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 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...
 

Private Member Functions

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

Private Attributes

double lastQCommand = 0
 

Additional Inherited Members

- Protected Attributes inherited from ActuatedJoint
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

Example implementation of the ActuatedJoints class.

Important to note the simple implementation between the driveValue and jointValue

Definition at line 22 of file DummyActJoint.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file DummyActJoint.cpp.

Member Function Documentation

double DummyActJoint::fromDriveUnits ( int  driveValue)
privatevirtual

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

Implements ActuatedJoint.

Definition at line 27 of file DummyActJoint.h.

double DummyActJoint::getQ ( )

Definition at line 41 of file DummyActJoint.cpp.

bool DummyActJoint::initNetwork ( )
virtual

Pure virtual function for initialising the underlying CANopen Network to send and recieve PDO messages for this joint.

Returns
true if successful
false if unsuccessful

Implements Joint.

Definition at line 33 of file DummyActJoint.cpp.

setMovementReturnCode_t DummyActJoint::setPosition ( double  desQ)
virtual

Set the Position object.

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

Reimplemented from ActuatedJoint.

Definition at line 28 of file DummyActJoint.cpp.

int DummyActJoint::toDriveUnits ( double  jointValue)
privatevirtual

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

Implements ActuatedJoint.

Definition at line 28 of file DummyActJoint.h.

bool DummyActJoint::updateValue ( )
virtual

Updates the value of the joint. This will read the value from hardware, and update the software's current representation of the value.

Returns
true if successful
false if unsuccessful

Implements Joint.

Definition at line 22 of file DummyActJoint.cpp.

Member Data Documentation

double DummyActJoint::lastQCommand = 0
private

Definition at line 24 of file DummyActJoint.h.


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