00001 #ifndef GRIPPER
00002 #define GRIPPER
00003
00004 #include <rtt/TaskContext.hpp>
00005 #include <rtt/TimeService.hpp>
00006
00007 #include <rtt/dev/AnalogOutput.hpp>
00008 #include <rtt/dev/DigitalOutput.hpp>
00009
00010 #include "dev/IncrementalEncoderSensor.hpp"
00011 #include "dev/AnalogDrive.hpp"
00012 #include "dev/Axis.hpp"
00013
00014 #include "dev/ComediDevice.hpp"
00015 #include "dev/ComediSubDeviceDOut.hpp"
00016 #include "dev/ComediSubDeviceAOut.hpp"
00017
00018 using namespace RTT;
00019
00020 namespace OCL{
00021
00022 class Gripper
00023 : public TaskContext
00024 {
00025 public:
00026 Gripper(const std::string& name);
00027 ~Gripper();
00028
00029 private:
00030 bool opening,closing,opened,closed;
00031
00032 double pos, prev_pos;
00033 #if (defined OROPKG_OS_LXRT)
00034 AnalogOutInterface* ni6713_aout;
00035 DigitalOutInterface* ni6527_dout;
00036 EncoderInterface* encoder_if;
00037
00038 DigitalOutput* enable;
00039 AnalogOutput* voltage;
00040 AnalogDrive* gripper_driver;
00041
00042 IncrementalEncoderSensor* encoder;
00043 Axis* gripper_axis;
00044 #endif
00045 Property<double> voltage_value, eps, min_time;
00046 Property<bool> actuated_grip;
00047
00048 RTT::TimeService::ticks time_begin;
00049 RTT::TimeService::Seconds time_passed;
00050
00051 bool openGripper();
00052 bool gripperOpened() const;
00053
00054 bool closeGripper();
00055 bool gripperClosed() const;
00056
00061 bool configureHook();
00062
00067 bool startHook();
00068
00072 void updateHook();
00073
00077 void stopHook();
00078
00082 void cleanupHook();
00083 };
00084
00085 }
00086 #endif