ism_helper.hpp
Go to the documentation of this file.
1 
18 #ifndef _ISM_HELPER_HPP_
19 #define _ISM_HELPER_HPP_
20 
21 //Pkg includes
22 #include <ros/ros.h>
23 #include <tf/transform_listener.h>
24 
25 #include <asr_msgs/AsrObject.h>
26 #include <asr_object_database/ObjectMetaData.h>
27 
28 //Local includes
29 #include <ISM/recognizer/Recognizer.hpp>
30 
37 namespace IH {
38 
45  ISM::PosePtr rosPoseToISMPose(const geometry_msgs::Pose p);
46 
54  {
55  public:
56 
64  ObjectConverter(const std::string& pBaseFrame, const bool pIgnoreTypes, const bool pIgnoreIds, const int pEnableRotationMode, const std::string pRotationFrame, const std::string pRotationObjType, const std::string pRotationObjId);
65  ObjectConverter(const std::string& pBaseFrame, const bool pIgnoreTypes, const bool pIgnoreIds, const int pEnableRotationMode, const std::string pRotationFrame, const std::string pRotationObjType, const std::string pRotationObjId, const bool pUseConfidenceFromMsg);
66 
67  virtual ~ObjectConverter() {};
68 
75  ISM::ObjectPtr pbdObjectToISMObject(const asr_msgs::AsrObject& o);
83  void normalizeRotationInvariantObjects(ISM::ObjectSetPtr objectSet);
84 
85  private:
86  //Some consts for orientation normalization.
88  const int ROTATION_MODE_FRAME = 1;
89  const int ROTATION_MODE_OBJECT = 2;
90 
93 
95  const std::string mBaseFrame;
96 
98  const bool mIgnoreTypes;
100  const bool mIgnoreIds;
101 
104 
106  const std::string mRotationFrame;
108  const std::string mRotationObjType;
110  const std::string mRotationObjId;
112  ISM::ObjectPtr mRotationRefObject;
113 
116 
118  std::vector<asr_msgs::AsrObject> transformBuffer;
119 
121 
123 
130  Eigen::AngleAxisd calculateTransform(const Eigen::Vector3d& objectAxis, const Eigen::Vector3d& referenceAxis, const Eigen::Vector3d& unitAxis);
131  };
132 
134 
135 }
136 
137 #endif /* _ISM_HELPER_HPP_ */
tf::TransformListener mTfListener
Needed for transform to base_frame coordinate system.
Definition: ism_helper.hpp:92
ISM::PosePtr rosPoseToISMPose(const geometry_msgs::Pose p)
Definition: ism_helper.cpp:53
ISM::ObjectPtr mRotationRefObject
Current object pose, to which rotation invariant objects are normalized.
Definition: ism_helper.hpp:112
virtual ~ObjectConverter()
Definition: ism_helper.hpp:67
const bool mIgnoreTypes
Whether to take over object types from AsrObjects.
Definition: ism_helper.hpp:98
boost::shared_ptr< ObjectConverter > ObjectConverterPtr
Definition: ism_helper.hpp:133
const std::string mRotationObjType
If normalizing to object: Which type of object to normalize to.
Definition: ism_helper.hpp:108
const bool mUseConfidenceFromMsg
Whether to take over recognition confidences (into ism rating) from AsrObjects.
Definition: ism_helper.hpp:115
const int mEnableRotationMode
Normalize orientations of rotation invariant objects to either a coordinate frame or an not-rotation ...
Definition: ism_helper.hpp:103
Eigen::AngleAxisd calculateTransform(const Eigen::Vector3d &objectAxis, const Eigen::Vector3d &referenceAxis, const Eigen::Vector3d &unitAxis)
calculateTransform Caculate the transformation between two vectors.
Definition: ism_helper.cpp:136
void normalizeRotationInvariantObjects(ISM::ObjectSetPtr objectSet)
normalizeOrientation Normalizes the orientation of rotation invariance objects accroding to: ...
Definition: ism_helper.cpp:84
ISM::ObjectPtr pbdObjectToISMObject(const asr_msgs::AsrObject &o)
Definition: ism_helper.cpp:59
ros::ServiceClient objectMetaDataClient
Definition: ism_helper.hpp:122
ObjectConverter(const std::string &pBaseFrame, const bool pIgnoreTypes, const bool pIgnoreIds, const int pEnableRotationMode, const std::string pRotationFrame, const std::string pRotationObjType, const std::string pRotationObjId)
Definition: ism_helper.cpp:32
const std::string mRotationFrame
If normalizing to frame: Which frame to normalize to.
Definition: ism_helper.hpp:106
std::vector< asr_msgs::AsrObject > transformBuffer
Needed to store poses which have not yet been transformed.
Definition: ism_helper.hpp:118
const std::string mBaseFrame
Frame to which incoming object messages are transformed.
Definition: ism_helper.hpp:95
ros::NodeHandle nodehandle
Definition: ism_helper.hpp:120
const int ROTATION_MODE_FRAME
Definition: ism_helper.hpp:88
const bool mIgnoreIds
Whether to take over object ids from AsrObjects.
Definition: ism_helper.hpp:100
const std::string mRotationObjId
If normalizing to object: Which id of object to normalize to.
Definition: ism_helper.hpp:110
const int ROTATION_MODE_OBJECT
Definition: ism_helper.hpp:89
const int ROTATION_MODE_DEACTIVATED
Definition: ism_helper.hpp:87


asr_ism
Author(s): Borella Jocelyn, Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Thu Jan 9 2020 07:20:58