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_VEL_H__
00022 #define __N_AXES_CONTROLLER_VEL_H__
00023
00024 #include <rtt/RTT.hpp>
00025 #include <rtt/TaskContext.hpp>
00026 #include <rtt/Properties.hpp>
00027 #include <rtt/TimeService.hpp>
00028 #include <rtt/Ports.hpp>
00029
00030 #include <ocl/OCL.hpp>
00031
00032 namespace OCL
00033 {
00046 class nAxesControllerVel : public RTT::TaskContext
00047 {
00048 public:
00055 nAxesControllerVel(std::string name);
00056 virtual ~nAxesControllerVel();
00067 virtual bool configureHook();
00075 virtual bool startHook();
00080 virtual void updateHook();
00081 virtual void stopHook();
00082
00083 private:
00084 void resetAll();
00085 void resetAxis(int axis);
00086
00087 unsigned int num_axes;
00088
00089 std::vector<double> p_m, p_d, v_d, v_out, gain;
00090 protected:
00092 RTT::Method<void(void)> reset_all_mtd;
00098 RTT::Method<void(int)> resetAxis_mtd;
00099
00101 RTT::ReadDataPort< std::vector<double> > p_m_port;
00103 RTT::ReadDataPort< std::vector<double> > v_d_port;
00105 RTT::WriteDataPort< std::vector<double> > v_out_port;
00107 RTT::Property< std::vector<double> > gain_prop;
00109 RTT::Property<unsigned int> num_axes_prop;
00110
00111 private:
00112 std::vector<bool> is_initialized;
00113 std::vector<RTT::TimeService::ticks> time_begin;
00114
00115
00116 };
00117 }
00118
00119 #endif // __N_AXES_CONTROLLER_VEL_H__