00001 00023 #ifndef APP1_H_ 00024 #define APP1_H_ 00025 00026 #include "std_msgs/String.h" 00027 #include "nav_msgs/Odometry.h" 00028 #include "geometry_msgs/Twist.h" 00029 00030 #include "micros_swarm/micros_swarm.h" 00031 00032 namespace app1{ 00033 00034 struct XY; 00035 00036 class App1 : public micros_swarm::Application 00037 { 00038 public: 00039 ros::Timer timer; 00040 ros::Publisher pub; 00041 ros::Subscriber sub; 00042 00043 //app parameters 00044 int delta; 00045 int epsilon; 00046 00047 App1(); 00048 ~App1(); 00049 virtual void init(); 00050 virtual void start(); 00051 virtual void stop(); 00052 00053 //app functions 00054 float force_mag(float dist); 00055 XY force_sum(micros_swarm::NeighborBase n, XY &s); 00056 XY direction(); 00057 void motion(); 00058 void publish_cmd(const ros::TimerEvent&); 00059 void baseCallback(const nav_msgs::Odometry& lmsg); 00060 }; 00061 }; 00062 00063 #endif