asrPosePredictionEngine.h
Go to the documentation of this file.
1 
18 #pragma once
19 
20 #include <boost/shared_ptr.hpp>
21 #include <rapidxml.hpp>
22 #include <fstream>
23 #include <cstddef>
24 
25 #include "OcmSceneGraphNode.h"
26 #include "GMM.h"
27 #include <string>
28 #include <helper/ObjectTransformation.h>
29 #include <asr_msgs/AsrObject.h>
30 #include <asr_msgs/AsrAttributedPoint.h>
31 
32 namespace ASR
33 {
34 
35 
36 using namespace rapidxml;
37 using namespace std;
38 
39 
47 {
48 private:
49 
50  // path to xml file
51  std::string path;
52  // name of the reference object
53  std::string reference_object;
54  // the name of the current scene
55  std::string scene_name;
56 
57  // the node of the reference object
58  ASR::asrSceneGraphNodePtr root;
59 
62  int number_of_votes; // overall available votes
63  int votes_per_node; // votes that are available to one unobserved node
64  //std::string pPbdObjectTopic; // The ROS topic of obsererved Objects to listen to.
65  //ros::Subscriber mObjectListener; // A callback handler listening to objects found by an object detection system.
66  std::string baseFrameId; // The frame to which the geometry:msgs are transformed into
67 
68  // A transformer for objects into the target coordinate frame.
69  ProbabilisticSceneRecognition::ObjectTransformation mObjectTransform;
70 
71 
74  std::string publish_hypothesis_topic; // the topic to which the hypotheses are published
75  ros::Publisher hypothesis_publisher; // the publisher that publishs the generated hypothesis
76  std::vector<boost::shared_ptr<asr_msgs::AsrObject>> evidence_buffer; // A buffer that stores all observed objects that occured since the last hypotheses update
77 
78 public:
79 
88  asrPosePredictionEngine(std::string pathToXML,
89  std::string sceneName,
90  std::vector<boost::shared_ptr<asr_msgs::AsrObject>> objects,
91  int votes,
92  std::string base_frame);
93 
94 
105  asrPosePredictionEngine(std::string pathToXML,
106  std::string sceneName,
107  std::string reference_object_name,
108  Eigen::Vector3f reference_object_position,
109  Eigen::Vector4f reference_object_orientation,
110  int votes,
111  std::string base_frame);
112 
113 
118  unsigned int getNumberOfMissingObjects() {return this->number_objects_in_scene - this->number_obsereved_objects;}
119 
120 
125  ASR::asrSceneGraphNodePtr getSceneGraphRoot() {return root;}
126 
127 
134  void publishHypothesisMessages(std::vector<ASR::AttributedPoint> hypothesis_list);
135 
136 
142  void collectPoseHypothesesRecursive(std::vector<ASR::AttributedPoint> &out_hypotheses,
143  std::vector<ASR::AttributedPoint> &out_found_objects);
144 
145 
151  void calcHypotheses();
152 
153 private:
154 
159  unsigned int distributeVotes();
160 
169  bool observeObject(std::string object_name, Eigen::Vector3f position, Eigen::Vector4f orientation);
170 
175  void onObjectMsg(const boost::shared_ptr<asr_msgs::AsrObject>& pObject);
176 
177 
185  bool transformObject(boost::shared_ptr<asr_msgs::AsrObject> in_out_object, std::string targetFrame);
186 
187 
191  void init(std::string sceneName,
192  std::string reference_object_name,
193  Eigen::Vector3f reference_object_position,
194  Eigen::Vector4f reference_object_orientation,
195  std::string base_frame);
196 
197 
201  void traverseSceneShapeRecursive(std::string parent_name, xml_node<> * parent_node, ASR::asrSceneGraphNodePtr root);
202 
203 
210  void initVectorFromCSVString(std::vector<float> &x, std::string csv);
211 
212 
218  MatrixXf initMatrixXf(std::vector<float> values, unsigned int rows, unsigned int cols);
219 };
220 
222 
223 }
224 
225 
226 
227 
228 
229 
230 
231 
232 
233 
234 
std::vector< double > values
ASR::asrSceneGraphNodePtr root
ASR::asrSceneGraphNodePtr getSceneGraphRoot()
ProbabilisticSceneRecognition::ObjectTransformation mObjectTransform
std::vector< boost::shared_ptr< asr_msgs::AsrObject > > evidence_buffer
TFSIMD_FORCE_INLINE const tfScalar & x() const
boost::shared_ptr< asrPosePredictionEngine > asrPosePredictionEnginePtr


asr_recognizer_prediction_psm
Author(s): Braun Kai, Meißner Pascal
autogenerated on Wed Feb 19 2020 03:31:28