A Component which allows you to control Axis objects. More...
#include <AxesComponent.hpp>
Classes | |
struct | AxisInfo |
Public Types | |
typedef std::vector< double > | ChannelType |
Public Member Functions | |
AxesComponent (int max_axes=1, const std::string &name="AxesComponent") | |
Create a Component with maximum max_axes virtual channels in the "InputValues" DataPort and max_axes virtual channels in the "OutputValues" DataPort. | |
virtual bool | startup () |
Startup checks the axes/port/channel configuration and warns the user if it detects possible incorrect port connections. | |
virtual void | update () |
Reads all the sensors of each added axis and drives each enabled axis. | |
virtual void | shutdown () |
Shutdown will stop all enabled axes. | |
bool | addAxis (const std::string &name, AxisInterface *axis_i) |
Add an AxisInterface object with a name. | |
bool | addAxisOnChannel (const std::string &axis_name, const std::string &sensor_name, int virtual_channel) |
Add an Axis object on a Channel. | |
void | removeAxisFromChannel (const std::string &axis_name) |
Remove an axis from a virtual channel. | |
bool | removeAxis (const std::string &name) |
Remove a previously added Axis. | |
AxesComponent Methods. | |
Runtime inspection for the AxesComponent. | |
bool | enableAxis (const std::string &name) |
Enable an Axis. | |
bool | disableAxis (const std::string &name) |
Disable an Axis. | |
bool | stopAxis (const std::string &name) |
Stop an Axis. | |
bool | switchOn (const std::string &name) |
Switch on a Digital Output. | |
bool | switchOff (const std::string &name) |
Switch off a Digital Output. | |
bool | isEnabled (const std::string &name) const |
Inspect if an axis is enabled (equivalent to !isLocked()). | |
bool | isDriven (const std::string &name) const |
Inspect if an axis is 'driven' (in movement). | |
bool | isStopped (const std::string &name) const |
Inspect if an axis is 'stopped' (electronical stand still). | |
bool | isLocked (const std::string &name) const |
Inspect if an axis is 'locked' (mechanical stand still). | |
double | position (const std::string &name) const |
Inspect the position of an Axis. | |
bool | isOn (const std::string &name) const |
Inspect the status of a Digital Input or Digital Output. | |
double | readSensor (const std::string &name) const |
Inspect a Sensor value of the Axis. | |
int | getAxes () const |
Get the number of axes. | |
AxesComponent Commands. | |
Runtime commands for the AxesComponent. | |
bool | calibrateSensor (const std::string &axis, const std::string &name) |
Calibrate a Sensor of the Axis. | |
bool | resetSensor (const std::string &axis, const std::string &name) |
Reset (uncalibrate) a Sensor of the Axis. | |
bool | isCalibrated (const std::string &axis, const std::string &name) const |
Checks if a Sensor is calibrated ( Completion Condition ). | |
Protected Types | |
typedef std::map< std::string, std::pair< SensorInterface < double > *, WriteDataPort < double > * > > | SensorMap |
typedef std::map< std::string, AxisInfo > | AxisMap |
Protected Member Functions | |
AxisInfo * | mhasAxis (const std::string &axis_name) |
void | to_axis (const AxisInfo &dd) |
Protected Attributes | |
Property< int > | max_channels |
ChannelType | chan_meas |
WriteDataPort< ChannelType > | chan_sensor |
ChannelType | chan_out |
ReadDataPort< ChannelType > | chan_drive |
std::map< std::string, const DigitalInput * > | d_in |
std::map< std::string, DigitalOutput * > | d_out |
AxisMap | axes |
Attribute< ChannelType > | testData |
unsigned int | usingChannels |
A Component which allows you to control Axis objects.
There is no 'motion control' involved, merely making the Axis objects available throught a Component interface. See the nAxes* components for motion control.
Each added Axis introduces ports and Digital Inputs/Outputs which you can use to read the status.
Definition at line 60 of file AxesComponent.hpp.
bool addAxis | ( | const std::string & | name, | |
AxisInterface * | axis_i | |||
) |
Add an AxisInterface object with a name.
You need to add an axis first before it can be put on a virtual channel.
Definition at line 156 of file AxesComponent.cpp.
bool addAxisOnChannel | ( | const std::string & | axis_name, | |
const std::string & | sensor_name, | |||
int | virtual_channel | |||
) |
Add an Axis object on a Channel.
The drive value for the axis is fetched from the 'OutputValues' data port, the sensed valued for the axis is written to the 'InputValues' data port.
axis_name | The name of the previously added Axis | |
sensor_name | The name of a Sensor of the Axis | |
virtual_channel | The channel number where the Sensor must be added. |
Definition at line 190 of file AxesComponent.cpp.
void removeAxisFromChannel | ( | const std::string & | axis_name | ) |
Remove an axis from a virtual channel.
axis_name | The name of the axis to be removed |
Definition at line 224 of file AxesComponent.cpp.