pfuclt_omni_dataset.h
Go to the documentation of this file.
1 // STL libraries
2 #include <vector>
3 #include <algorithm>
4 #include <cstdio>
5 #include <fstream>
6 #include <string>
7 
8 // ROS message definitions
9 #include <ros/ros.h>
10 #include <nav_msgs/Odometry.h>
11 #include <read_omni_dataset/BallData.h>
12 #include <read_omni_dataset/LRMLandmarksData.h>
13 
14 // Eigen libraries
15 #include <eigen3/Eigen/Core>
16 #include <eigen3/Eigen/Geometry>
17 
18 // Boost libraries
19 #include <boost/bind.hpp>
20 #include <boost/ref.hpp>
21 #include <boost/shared_ptr.hpp>
22 
23 // Auxiliary libraries
27 
28 namespace pfuclt_omni_dataset
29 {
30 
31 #define STATES_PER_ROBOT 3
32 #define HEURISTICS_THRESH_DEFAULT \
33  { \
34  2.5, 2.5, 2.5, 2.5, FLT_MAX, FLT_MAX, 3.5, 3.5, FLT_MAX, FLT_MAX \
35  }
36 
37 // Forward declaration of classes
38 class Robot;
39 
40 // useful typedefs
41 typedef boost::shared_ptr<Robot> Robot_ptr;
42 
49 {
50 
51 private:
52  ros::NodeHandle& nh_;
53  std::vector<Robot_ptr> robots_;
54 
60  bool areAllRobotsActive();
61 
62 public:
63  boost::shared_ptr<ParticleFilter> pf;
64 
65  RobotFactory(ros::NodeHandle& nh);
66 
72 
79 };
80 
86 class Robot
87 {
88 protected:
91  bool started_;
92  ros::Time timeStarted_;
93  ros::Subscriber sOdom_, sBall_, sLandmark_;
95  Eigen::Isometry2d initPose_; // x y theta;
96 
100  void startNow();
101 
102 public:
111  Robot(ros::NodeHandle& nh, RobotFactory* parent,
112  ParticleFilter* pf, uint robotNumber);
113 
118  void odometryCallback(const nav_msgs::Odometry::ConstPtr&);
119 
124  void targetCallback(const read_omni_dataset::BallData::ConstPtr&);
125 
130  void
131  landmarkDataCallback(const read_omni_dataset::LRMLandmarksData::ConstPtr&);
132 
137  bool hasStarted() { return started_; }
138 };
139 
140 // end of namespace pfuclt_omni_dataset
141 }
void tryInitializeParticles()
tryInitializeParticles - checks if every robot is started, and if so, will initiate the particle filt...
boost::shared_ptr< Robot > Robot_ptr
void initializeFixedLandmarks()
initializeFixedLandmarks - will get a filename from the parameter server, and use its information to ...
The RobotFactory class - Creates and keeps information on the robot running the algorithm and its tea...
bool areAllRobotsActive()
areAllTeammatesActive - uses each robot&#39;s public methods to check if they have started yet ...
boost::shared_ptr< ParticleFilter > pf
The Robot class - Has the common variables and methods of all robots, and is the base class of any sp...
std::vector< Robot_ptr > robots_


pfuclt_omni_dataset
Author(s):
autogenerated on Tue Jul 4 2017 19:38:38