PathFollower.h
Go to the documentation of this file.
00001 // -*- C++ -*-
00010 #ifndef PATHFOLLOWER_H
00011 #define PATHFOLLOWER_H
00012 
00013 #include <rtm/Manager.h>
00014 #include <rtm/DataFlowComponentBase.h>
00015 #include <rtm/CorbaPort.h>
00016 #include <rtm/DataInPort.h>
00017 #include <rtm/DataOutPort.h>
00018 #include <rtm/idl/BasicDataTypeSkel.h>
00019 #include "intellirobotStub.h"
00020 
00021 // </rtc-template>
00022 
00023 using namespace RTC;
00024 
00025 class PathFollower
00026   : public RTC::DataFlowComponentBase
00027 {
00028  public:
00029   PathFollower(RTC::Manager* manager);
00030   ~PathFollower();
00031 
00032   // The initialize action (on CREATED->ALIVE transition)
00033   // formaer rtc_init_entry()
00034  virtual RTC::ReturnCode_t onInitialize();
00035    virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
00036    virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
00037 
00038  protected:
00039   // Configuration variable declaration
00040   // <rtc-template block="config_declare">
00041   double m_max_v;
00042   double m_max_w;
00043   double m_max_acc_v;
00044   double m_max_acc_w;
00045   double m_line_C1;
00046   double m_line_K1;
00047   double m_line_K2;
00048   double m_line_K3;
00049   double m_line_Dist;
00050   double m_control_cycle;
00051   
00052   // </rtc-template>
00053 
00054   // DataInPort declaration
00055   // <rtc-template block="inport_declare">
00056   IIS::TimedPose2D m_position;
00057   InPort<IIS::TimedPose2D> m_positionIn;
00058   Path m_target_path;
00059   InPort<Path> m_target_pathIn;
00060 
00061   // </rtc-template>
00062 
00063   // DataOutPort declaration
00064   // <rtc-template block="outport_declare">
00065   IIS::TimedVelocity2D m_velocity;
00066   OutPort<IIS::TimedVelocity2D> m_velocityOut;
00067   
00068  private:
00069   int dummy;
00070   double now_x;
00071   double now_y;
00072   double now_theta;
00073   double target_v;
00074   double target_w;
00075 
00076   int run_mode;
00077 
00078   double path_x;
00079   double path_y;
00080   double path_theta;
00081   double path_v;
00082   double path_w;
00083   double path_d;
00084 
00085   int do_control;
00086 
00087 
00088 /*±ß¸ÌÄɽ¾*/
00089 double circle_follow(double x,double y, double theta,
00090                      double cx, double cy, double cradius,
00091                      double v_max);
00092 
00093 /*ľÀþÄɽ¾*/
00094 double line_follow(double x,double y,double theta,
00095                    double cx, double cy, double ctheta,
00096                    double v_max);
00097 
00098 /*µ°À×Äɽ¾¥ì¥®¥å¥ì¡¼¥¿*/
00099   double regurator(double d, double q, double r,  double v_max);
00100 
00101 /*²óž*/
00102   double spin(double theta, double target_theta, double w_max);
00103 /*ÅÀ¤Þ¤Ç¤Îµ÷Î¥*/
00104   double dist_pos(double x,double y, double tx, double ty);
00105 
00106 
00107 /*ľÀþ¤ÎüÅÀ¤Þ¤Ç°ÜÆ°¤·»ß¤Þ¤ë*/
00108   int to_point(double x, double y,double theta,
00109                double tx, double ty, double ttheta,double max_vel);
00110 
00111   int robot_speed_smooth(double v, double w);
00112   void path_following(double x, double y, double theta);
00113   void initPathFollower(void);
00114   void finalizePathFollower(void);
00115 
00116 
00117 };
00118 
00119 
00120 extern "C"
00121 {
00122   void PathFollowerInit(RTC::Manager* manager);
00123 };
00124 
00125 #endif // PATHFOLLOWER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


RS003
Author(s):
autogenerated on Tue Jul 23 2013 11:51:29