Kuka361nAxesVelocityController Class Reference

This class implements a TaskContext to use with the Kuka361 robot in the RoboticLab, PMA, dept. More...

#include <EthercatDemonAxesVelocityController.hpp>

List of all members.

Public Member Functions

 Kuka361nAxesVelocityController (std::string name, std::string propertyfilename="cpf/Kuka361nAxesVelocityController.cpf")
 The contructor of the class.
virtual bool startup ()
 This function contains the application's startup code.
virtual void update ()
 This function is periodically called.
virtual void shutdown ()
 This function is called when the task is stopped.
unsigned int GetNumAxes ()
 Get the number of axes of this robot.
 Kuka361nAxesVelocityController (std::string name)
 The contructor of the class.
virtual bool configureHook ()
virtual bool startHook ()
virtual void updateHook ()
virtual void stopHook ()
virtual void cleanupHook ()
KDL::Chain getKinematics ()

Protected Attributes

Method< bool(int)> _startAxis
 Method to start an axis .
Method< bool(void)> _startAllAxes
 Method to start all axes .
Method< bool(int)> _stopAxis
 Method to stop an axis .
Method< bool(void)> _stopAllAxes
 Method to stop all axes.
Method< bool(int)> _unlockAxis
 Method to unlock an axis .
Method< bool(void)> _unlockAllAxes
 Method to unlock all axes.
Method< bool(int)> _lockAxis
 Method to lock an axis.
Method< bool(void)> _lockAllAxes
 Method to lock all axes .
Command< bool(void)> _prepareForUse
 Method to prepare robot for use.
Command< bool(void)> _prepareForShutdown
 Command to Shutdown the hardware controller of the robot.
Method< bool(int, double)> _addDriveOffset
 Method to add a drive offset to an axis.
std::vector< RTT::ReadDataPort
< double > * > 
_driveValue
 vector of ReadDataPorts which contain the output velocities of the axes.
std::vector< RTT::DataPort
< double > * > 
_positionValue
 vector of WriteDataPorts which contain the values of the position sensors.
RTT::Property< std::vector
< double > > 
_driveLimits
 The absolute value of the velocity will be limited to this property.
RTT::Property< std::vector
< double > > 
_lowerPositionLimits
 Lower limit for the positions.
RTT::Property< std::vector
< double > > 
_upperPositionLimits
 upper limit for the positions.
RTT::Property< std::vector
< double > > 
_initialPosition
 Start position in rad for simulation.
RTT::Property< std::vector
< double > > 
_driveOffset
 Offset to the drive value volt = (setpoint + offset)/scale.
RTT::Property< bool > _simulation
 True if simulationAxes should be used in stead of hardware axes.
RTT::Constant< unsigned int > _num_axes
 Constant: number of axes.
RTT::Event< void(std::string) > _driveOutOfRange
 parameters to this event are the axis and the velocity that is out of range.
RTT::Event< void(std::string) > _positionOutOfRange
 parameters to this event are the axis and the position that is out of range.
Method< bool(void)> startAllAxes_mtd
 Method to start all axes .
Method< bool(void)> stopAllAxes_mtd
 Method to stop all axes .
Method< bool(void)> unlockAllAxes_mtd
 Method to unlock all axes .
Method< bool(void)> lockAllAxes_mtd
 Method to lock all axes.
Command< bool(void)> prepareForUse_cmd
 Method to prepare robot for use.
Command< bool(void)> prepareForShutdown_cmd
 Command to Shutdown the hardware controller of the robot.
Method< bool(std::vector
< double >)> 
addDriveOffset_mtd
 Method to add drive offsets to the axes.
DataPort< std::vector< double > > driveValues_port
 DataPort which contain the output velocities of the axes.
DataPort< std::vector< double > > positionValues_port
 DataPort which contain the values of the position sensors.
Property< std::vector< double > > driveLimits_prop
 The absolute value of the velocity will be limited to this property.
Property< std::vector< double > > lowerPositionLimits_prop
 Lower limit for the positions.
Property< std::vector< double > > upperPositionLimits_prop
 upper limit for the positions.
Property< std::vector< double > > initialPosition_prop
 Start position in rad for simulation.
Property< std::vector< double > > driveOffset_prop
 Offset to the drive value volt = (setpoint + offset)/scale.
Property< bool > simulation_prop
 True if simulationAxes should be used in stead of hardware axes.
bool simulation
Property< bool > geometric_prop
 True if geometric axes values should be used in stead of actuator values.
Property< std::vector
< std::string > > 
EmergencyEvents_prop
 List of Events that should result in an emergencystop.
Constant< unsigned int > num_axes_attr
 Constant Attribute: number of axes.
Attribute< KDL::Chain > chain_attr
 KDL-chain for the Kuka361.
KDL::Chain kinematics
Event< void(std::string) > driveOutOfRange_evt
 parameters to this event are the axis and the velocity that is out of range.
Event< void(std::string) > positionOutOfRange_evt
 parameters to this event are the axis and the position that is out of range.

Detailed Description

This class implements a TaskContext to use with the Kuka361 robot in the RoboticLab, PMA, dept.

Mechanical Engineering, KULEUVEN. Since the hardware part is very specific for our setup, other people can only use the simulation version. But it can be a good starting point to create your own Robot Software Interface.

Definition at line 44 of file EthercatDemonAxesVelocityController.hpp.


Constructor & Destructor Documentation

Kuka361nAxesVelocityController ( std::string  name,
std::string  propertyfilename = "cpf/Kuka361nAxesVelocityController.cpf" 
)
Kuka361nAxesVelocityController ( std::string  name  ) 

Member Function Documentation

bool startup (  )  [virtual]

This function contains the application's startup code.

Return false to abort startup.

Definition at line 239 of file EthercatDemonAxesVelocityController.cpp.


Member Data Documentation

Method<bool(int,double)> _addDriveOffset [protected]

Method to add a drive offset to an axis.

Adds an offset to the _driveValue of axis and updates the _driveOffset value.

Parameters:
axis nr of Axis
offset offset value in fysical units

Definition at line 167 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

RTT::Property<std::vector <double> > _driveLimits [protected]

The absolute value of the velocity will be limited to this property.

Used to fire an event if necessary and to saturate the velocities. It is a good idea to set this property to a low value when using experimental code.

Definition at line 189 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

RTT::Event< void(std::string) > _driveOutOfRange [protected]

parameters to this event are the axis and the velocity that is out of range.

Each axis that is out of range throws a seperate event. The component will continue with the previous value.

Definition at line 229 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

RTT::Property<std::vector <double> > _initialPosition [protected]

Start position in rad for simulation.

If the encoders are relative ( like for this component ) also the starting value for the relative encoders.

Definition at line 205 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Method<bool(void)> _lockAllAxes [protected]

Method to lock all axes .

identical to unlockAxis(int axis) on all axes;

Definition at line 137 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Method<bool(int)> _lockAxis [protected]

Method to lock an axis.

Releases the brake of the axis. Only possible in the LOCKED state.

Parameters:
axis nr of axis to unlock
Returns:
false if in wrong state or already locked.

Definition at line 130 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

RTT::Property<std::vector <double> > _lowerPositionLimits [protected]

Lower limit for the positions.

Used to fire an event if necessary.

Definition at line 194 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController(), and Kuka361nAxesVelocityController::update().

RTT::Event< void(std::string) > _positionOutOfRange [protected]

parameters to this event are the axis and the position that is out of range.

Each axis that is out of range throws a seperate event. The component will continue. The hardware limit switches can be reached when this event is not handled.

Definition at line 237 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController(), and Kuka361nAxesVelocityController::update().

std::vector<RTT::DataPort<double>*> _positionValue [protected]

vector of WriteDataPorts which contain the values of the position sensors.

It is used by other components who need this value for control ;)

Definition at line 182 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController(), and Kuka361nAxesVelocityController::update().

Command<bool(void)> _prepareForUse [protected]

Method to prepare robot for use.

It is needed to activate the hardware controller of the robot.

Returns:
Will only be true if the hardware controller is ready and the emergency stops are released.

Definition at line 149 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Method<bool(void)> _startAllAxes [protected]

Method to start all axes .

Identical to calling startAxis(int axis) on all axes.

Returns:
true if all Axes could be started.

Definition at line 80 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Method<bool(int)> _startAxis [protected]

Method to start an axis .

Sets the axis in the DRIVEN state. Only possible if the axis is int the STOPPED state. If succesfull the drive value of the axis is setted to zero and will be updated periodically from the ReadDataPort _driveValue

Parameters:
axis nr of the axis to start
Returns:
Can only succeed if the axis was in the DRIVEN state

Definition at line 71 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Method<bool(void)> _stopAllAxes [protected]

Method to stop all axes.

Identical to calling stopAxis(int axis) on all axes.

Definition at line 100 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Method<bool(int)> _stopAxis [protected]

Method to stop an axis .

Sets the drive value to zero and changes to the STOP state. Only possible if axis is in the DRIVEN state. In the stop state, the axis does not listen and write to its ReadDataPort _driveValue.

Parameters:
axis nr of the axis to stop
Returns:
false if in wrong state or already stopped.

Definition at line 94 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Method<bool(void)> _unlockAllAxes [protected]

Method to unlock all axes.

identical to calling lockAxis(int axis) on all axes

Definition at line 118 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Method<bool(int)> _unlockAxis [protected]

Method to unlock an axis .

Activates the brake of the axis. Only possible in the STOPPED state.

Parameters:
axis nr of the axis to lock
Returns:
false if in wrong state or already locked.

Definition at line 111 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

RTT::Property<std::vector <double> > _upperPositionLimits [protected]

upper limit for the positions.

Used to fire an event if necessary.

Definition at line 199 of file EthercatDemonAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController(), and Kuka361nAxesVelocityController::update().

Method<bool(std::vector<double>)> addDriveOffset_mtd [protected]

Method to add drive offsets to the axes.

Adds an offset to the drivevalues of the axes and updates the driveOffset values.

Parameters:
offset offset value in geometrics units [rad/s]

Definition at line 131 of file Kuka361nAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Property<std::vector <double> > driveLimits_prop [protected]

The absolute value of the velocity will be limited to this property.

Used to fire an event if necessary and to saturate the velocities. It is a good idea to set this property to a low value when using experimental code.

Definition at line 153 of file Kuka361nAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Event< void(std::string) > driveOutOfRange_evt [protected]

parameters to this event are the axis and the velocity that is out of range.

Each axis that is out of range throws a seperate event. The component will continue with the previous value.

Definition at line 210 of file Kuka361nAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Property<std::vector <double> > initialPosition_prop [protected]

Start position in rad for simulation.

If the encoders are relative ( like for this component ) also the starting value for the relative encoders.

Definition at line 169 of file Kuka361nAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Method<bool(void)> lockAllAxes_mtd [protected]

Method to lock all axes.

Releases the brake of the axis. Only possible in the LOCKED state.

Returns:
false if in wrong state or already locked.

Definition at line 102 of file Kuka361nAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Property<std::vector <double> > lowerPositionLimits_prop [protected]

Lower limit for the positions.

Used to fire an event if necessary.

Definition at line 158 of file Kuka361nAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Event< void(std::string) > positionOutOfRange_evt [protected]

parameters to this event are the axis and the position that is out of range.

Each axis that is out of range throws a seperate event. The component will continue. The hardware limit switches can be reached when this event is not handled.

Definition at line 218 of file Kuka361nAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

DataPort<std::vector<double> > positionValues_port [protected]

DataPort which contain the values of the position sensors.

It is used by other components who need this value for control ;)

Definition at line 146 of file Kuka361nAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Command<bool(void)> prepareForUse_cmd [protected]

Method to prepare robot for use.

It is needed to activate the hardware controller of the robot.

Returns:
Will only be true if the hardware controller is ready and the emergency stops are released.

Definition at line 114 of file Kuka361nAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Method<bool(void)> startAllAxes_mtd [protected]

Method to start all axes .

Sets the axis in the DRIVEN state. Only possible if the axis is int the STOPPED state. If succesfull the drive value of the axis is setted to zero and will be updated periodically

Returns:
Can only succeed if all axis are in the DRIVEN state

Definition at line 71 of file Kuka361nAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Method<bool(void)> stopAllAxes_mtd [protected]

Method to stop all axes .

Sets the drive value to zero and changes to the STOP state. Only possible if axis is in the DRIVEN state. In the stop state, the axis does not listen and write to its ReadDataPort _driveValue.

Returns:
false if in wrong state or already stopped.

Definition at line 83 of file Kuka361nAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Method<bool(void)> unlockAllAxes_mtd [protected]

Method to unlock all axes .

Activates the brake of the axis. Only possible in the STOPPED state.

Returns:
false if in wrong state or already locked.

Definition at line 92 of file Kuka361nAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().

Property<std::vector <double> > upperPositionLimits_prop [protected]

upper limit for the positions.

Used to fire an event if necessary.

Definition at line 163 of file Kuka361nAxesVelocityController.hpp.

Referenced by Kuka361nAxesVelocityController::Kuka361nAxesVelocityController().


The documentation for this class was generated from the following files:
Generated on Thu Dec 23 15:05:28 2010 for OrocosComponentLibrary by  doxygen 1.6.3