00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __N_AXES_CONTROLLER_POS_H__
00022 #define __N_AXES_CONTROLLER_POS_H__
00023
00024 #include <rtt/RTT.hpp>
00025
00026 #include <rtt/TaskContext.hpp>
00027 #include <rtt/Properties.hpp>
00028 #include <rtt/TimeService.hpp>
00029 #include <rtt/Ports.hpp>
00030 #include <rtt/Command.hpp>
00031
00032 #include <ocl/OCL.hpp>
00033
00034 namespace OCL
00035 {
00046 class nAxesControllerPos : public RTT::TaskContext
00047 {
00048 public:
00055 nAxesControllerPos(std::string name);
00056
00057 virtual ~nAxesControllerPos();
00068 virtual bool configureHook();
00076 virtual bool startHook();
00081 virtual void updateHook();
00082 virtual void stopHook();
00083
00084 private:
00085 bool startMeasuringOffsets(double treshold_moving, int num_samples);
00086 bool finishedMeasuringOffsets() const;
00087
00088 unsigned int num_axes;
00089
00090 std::vector<double> p_meas,p_desi,v_out,offset_measurement,gain;
00091 protected:
00103 RTT::Command<bool(double,int)> measureOffset;
00105 RTT::ReadDataPort< std::vector<double> > p_meas_port;
00107 RTT::ReadDataPort< std::vector<double> > p_desi_port;
00109 RTT::WriteDataPort< std::vector<double> > v_out_port;
00112 RTT::Attribute<std::vector<double> > offset_attr;
00113
00114 private:
00115 int num_samples, num_samples_taken;
00116 double time_sleep;
00117 RTT::TimeService::ticks time_begin;
00118 bool is_measuring;
00119 protected:
00121 RTT::Property< std::vector<double> > gain_prop;
00123 RTT::Property< unsigned int > num_axes_prop;
00124
00125 };
00126 }
00127 #endif // __N_AXES_CONTROLLER_POS_H__