pfuclt_publisher.h
Go to the documentation of this file.
1 #ifndef PFUCLT_PUBLISHER_H
2 #define PFUCLT_PUBLISHER_H
3 
5 #include <read_omni_dataset/RobotState.h>
6 #include <read_omni_dataset/LRMGTData.h>
7 #include <read_omni_dataset/Estimate.h>
8 
9 #include <vector>
10 #include <ros/ros.h>
11 #include <tf2_geometry_msgs/tf2_geometry_msgs.h>
12 #include <tf2/LinearMath/Quaternion.h>
13 #include <tf2/transform_datatypes.h>
14 #include <tf2_ros/transform_broadcaster.h>
15 #include <geometry_msgs/PoseArray.h>
16 #include <geometry_msgs/PoseStamped.h>
17 #include <sensor_msgs/PointCloud.h>
18 #include <visualization_msgs/Marker.h>
19 #include <geometry_msgs/TransformStamped.h>
20 
21 namespace pfuclt_omni_dataset {
22 
27 class PFPublisher : public ParticleFilter {
28 public:
29  struct PublishData {
30  float robotHeight;
31 
37  PublishData(float robotHeight) : robotHeight(robotHeight) {}
38  } pubData;
39 
45  void resize_particles(const uint n) {
46  // Call base class method
48 
49  ROS_INFO("Resizing particle message");
50 
51  // Resize particle message
52  msg_particles_.particles.resize(n);
53  for (uint p = 0; p < n; ++p) {
54  msg_particles_.particles[p].particle.resize(nSubParticleSets_);
55  }
56  }
57 
58 private:
59  ros::Subscriber GT_sub_;
62  std::vector<ros::Publisher> particleStdPublishers_;
63  std::vector<ros::Publisher> robotGTPublishers_;
64  std::vector<ros::Publisher> robotEstimatePublishers_;
66 
67  read_omni_dataset::LRMGTData msg_GT_;
68  pfuclt_omni_dataset::particles msg_particles_;
69  read_omni_dataset::Estimate msg_estimate_;
70 
71  std::vector<tf2_ros::TransformBroadcaster> robotBroadcasters;
72 
73  void publishParticles();
74 
75  void publishRobotStates();
76 
77  void publishTargetState();
78 
79  void publishEstimate();
80 
81  void publishGTData();
82 
84 
85 public:
92  PFPublisher(struct PFinitData &data,
93  struct PublishData publishData);
94 
101 
105  void gtDataCallback(const read_omni_dataset::LRMGTData::ConstPtr &);
106 
111  void nextIteration();
112 };
113 }
114 
115 #endif //PFUCLT_PUBLISHER_H
ParticleFilter * getPFReference()
getPFReference - retrieve a reference to the base class&#39;s members
std::vector< ros::Publisher > robotEstimatePublishers_
read_omni_dataset::LRMGTData msg_GT_
struct pfuclt_omni_dataset::PFPublisher::PublishData pubData
The PFPublisher class - implements publishing for the ParticleFilter class using ROS.
std::vector< ros::Publisher > particleStdPublishers_
void gtDataCallback(const read_omni_dataset::LRMGTData::ConstPtr &)
gtDataCallback - callback of ground truth data
read_omni_dataset::Estimate msg_estimate_
std::vector< tf2_ros::TransformBroadcaster > robotBroadcasters
void nextIteration()
nextIteration - extends the base class method to add the ROS publishing
std::vector< ros::Publisher > robotGTPublishers_
The PFinitData struct - provides encapsulation to the initial data necessary to construct a ParticleF...
PublishData(float robotHeight)
PublishData - contains information necessary for the PFPublisher class.
pfuclt_omni_dataset::particles msg_particles_
PFPublisher(struct PFinitData &data, struct PublishData publishData)
PFPublisher - constructor.
virtual void resize_particles(const uint n)
resize_particles - change to a different number of particles
void resize_particles(const uint n)
resize_particles - change to a different number of particles and resize the publishing message ...


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