00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef XYPLATFORM_AXIS_HARDWARE_HPP
00030 #define XYPLATFORM_AXIS_HARDWARE_HPP
00031
00032 #include <rtt/dev/AnalogOutput.hpp>
00033 #include <rtt/dev/DigitalOutput.hpp>
00034
00035 #include <rtt/dev/AxisInterface.hpp>
00036
00037
00038 #include "dev/AnalogDrive.hpp"
00039 #include "dev/Axis.hpp"
00040 #include "dev/IncrementalEncoderSensor.hpp"
00041
00042 #include <rtt/TaskContext.hpp>
00043 #include "xyPlatformConstants.hpp"
00044
00045 #define XYPLATFORM_SWITCH_ON_TIME 20
00046
00047 namespace OCL
00048 {
00049
00050 class xyPlatformAxisHardware
00051 {
00052 public:
00053 xyPlatformAxisHardware(Event<void(void)>& maximumDrive, std::string configfile );
00054 ~xyPlatformAxisHardware();
00055
00056 bool prepareForUse();
00057 bool prepareForShutdown();
00058 std::vector<ORO_DeviceInterface::AxisInterface*> xyPlatformAxisHardware::getAxes();
00059 void unlock(int axis);
00060 void lock(int axis);
00061 void stop(int axis);
00062 double getDriveValue(int axis);
00063 void addOffset(const std::vector<double>& offset);
00064 bool getReference(int axis);
00065 void writePosition(int axis, double q);
00066
00067 RTT::TaskContext* getTaskContext();
00068
00069
00070 private:
00071 std::vector<Axis*> _axes;
00072 std::vector<RTT::AxisInterface*> _axesInterface;
00073
00074 RTT::EncoderInterface* _encoderInterface[XY_NUM_AXIS];
00075 AnalogOutput* _vref[XY_NUM_AXIS];
00076 IncrementalEncoderSensor* _encoder[XY_NUM_AXIS];
00077 DigitalOutput* _enable[XY_NUM_AXIS];
00078 AnalogDrive* _drive[XY_NUM_AXIS];
00079 DigitalOutput* _brake[XY_NUM_AXIS];
00080
00081
00082 RTT::TaskContext _my_task_context;
00083
00084 std::string _configfile;
00085 bool _initialized;
00086
00087 };
00088
00089
00090 }
00091
00092 #endif // XYPLATFORMCREATOR_HPP