OMIPTypeDefs.h
Go to the documentation of this file.
1 /*
2  * TypeDefs.h
3  *
4  * Author: roberto
5  *
6  * This is a modified implementation of the method for online estimation of kinematic structures described in our paper
7  * "Online Interactive Perception of Articulated Objects with Multi-Level Recursive Estimation Based on Task-Specific Priors"
8  * (Martín-Martín and Brock, 2014).
9  * This implementation can be used to reproduce the results of the paper and to be applied to new research.
10  * The implementation allows also to be extended to perceive different information/models or to use additional sources of information.
11  * A detail explanation of the method and the system can be found in our paper.
12  *
13  * If you are using this implementation in your research, please consider citing our work:
14  *
15 @inproceedings{martinmartin_ip_iros_2014,
16 Title = {Online Interactive Perception of Articulated Objects with Multi-Level Recursive Estimation Based on Task-Specific Priors},
17 Author = {Roberto {Mart\'in-Mart\'in} and Oliver Brock},
18 Booktitle = {Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems},
19 Pages = {2494-2501},
20 Year = {2014},
21 Location = {Chicago, Illinois, USA},
22 Note = {http://www.robotics.tu-berlin.de/fileadmin/fg170/Publikationen_pdf/martinmartin_ip_iros_2014.pdf},
23 Url = {http://www.robotics.tu-berlin.de/fileadmin/fg170/Publikationen_pdf/martinmartin_ip_iros_2014.pdf},
24 Projectname = {Interactive Perception}
25 }
26  * If you have questions or suggestions, contact us:
27  * roberto.martinmartin@tu-berlin.de
28  *
29  * Enjoy!
30  */
31 
32 #ifndef OMIPTYPEDEFS_H_
33 #define OMIPTYPEDEFS_H_
34 
35 // ROS, PCL, Opencv
36 #include <visualization_msgs/MarkerArray.h>
37 #include <pcl/point_types.h>
38 #include <pcl/point_cloud.h>
39 #include <cv_bridge/cv_bridge.h>
40 #include <sensor_msgs/PointCloud2.h>
41 
42 // OMIP
43 #include <omip_msgs/RigidBodyPosesAndVelsMsg.h>
44 #include <omip_msgs/RigidBodyPoseAndVelMsg.h>
45 #include <omip_msgs/JointMsg.h>
46 #include <omip_msgs/KinematicStructureMsg.h>
47 
48 #define OMIP_ADD_POINT4D \
49  union { \
50  float data[4]; \
51  struct { \
52  float x; \
53  float y; \
54  float z; \
55  }; \
56  } EIGEN_ALIGN16; \
57  inline Eigen::Map<Eigen::Vector3f> getVector3fMap () { return (Eigen::Vector3f::Map (data)); } \
58  inline const Eigen::Map<const Eigen::Vector3f> getVector3fMap () const { return (Eigen::Vector3f::Map (data)); } \
59  inline Eigen::Map<Eigen::Vector4f, Eigen::Aligned> getVector4fMap () { return (Eigen::Vector4f::MapAligned (data)); } \
60  inline const Eigen::Map<const Eigen::Vector4f, Eigen::Aligned> getVector4fMap () const { return (Eigen::Vector4f::MapAligned (data)); } \
61  inline Eigen::Map<Eigen::Array3f> getArray3fMap () { return (Eigen::Array3f::Map (data)); } \
62  inline const Eigen::Map<const Eigen::Array3f> getArray3fMap () const { return (Eigen::Array3f::Map (data)); } \
63  inline Eigen::Map<Eigen::Array4f, Eigen::Aligned> getArray4fMap () { return (Eigen::Array4f::MapAligned (data)); } \
64  inline const Eigen::Map<const Eigen::Array4f, Eigen::Aligned> getArray4fMap () const { return (Eigen::Array4f::MapAligned (data)); }
65 
66 namespace omip
67 {
68 
69 //Forward declaration
70 class JointFilter;
71 
72 //Forward declaration
73 class JointCombinedFilter;
74 
75 typedef pcl::PointXYZ PointPCL;
76 typedef pcl::PointXYZL FeaturePCL;
77 
78 struct EIGEN_ALIGN16 _FeaturePCLwc
79 {
80  OMIP_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
81  uint32_t label;
82  float covariance[9];
83  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
84 };
85 
86 struct FeaturePCLwc : public _FeaturePCLwc
87 {
88  inline FeaturePCLwc ()
89  {
90  x = y = z = 0.0f;
91  data[3] = 1.0f;
92  label = 0;
93  covariance[0] = 1.0f;
94  covariance[1] = 0.0f;
95  covariance[2] = 0.0f;
96  covariance[3] = 0.0f;
97  covariance[4] = 1.0f;
98  covariance[5] = 0.0f;
99  covariance[6] = 0.0f;
100  covariance[7] = 0.0f;
101  covariance[8] = 1.0f;
102  }
103 };
104 
105 typedef pcl::PointCloud<PointPCL> PointCloudPCLNoColor;
106 typedef pcl::PointCloud<pcl::PointXYZRGB> PointCloudPCL;
107 typedef pcl::PointCloud<FeaturePCL> FeatureCloudPCL;
108 typedef pcl::PointCloud<FeaturePCLwc> FeatureCloudPCLwc;
109 
110 typedef long int RB_id_t;
111 typedef long int Joint_id_t;
112 
113 typedef pcl::PointCloud<PointPCL> RigidBodyShape;
114 
115 typedef std::map<std::pair<int, int>, boost::shared_ptr<JointCombinedFilter> > KinematicModel;
116 
117 // Feature Tracker NODE MEASUREMENT type. We don't use this type because we need to synchronize several
118 // inputs as measurement for the feature tracker node (at least depth and rgb images) and this cannot be handled
119 // correctly with one single type definition
120 typedef void ft_measurement_ros_t;
121 
122 // Feature Tracker FILTER MEASUREMENT type. The first pointer points to the RGB image. The second pointer points to the depth image
123 typedef std::pair<cv_bridge::CvImagePtr, cv_bridge::CvImagePtr> ft_measurement_t;
124 
125 // Feature Tracker NODE STATE type
126 typedef sensor_msgs::PointCloud2 ft_state_ros_t;
127 
128 // Feature Tracker FILTER STATE type
129 typedef FeatureCloudPCLwc::Ptr ft_state_t;
130 
131 // Rigid Body Tracker NODE MEASUREMENT type (= ft_state_ros_t).
132 typedef sensor_msgs::PointCloud2 rbt_measurement_ros_t;
133 
134 // Rigid Body Tracker FILTER MEASUREMENT type.
135 typedef FeatureCloudPCLwc::Ptr rbt_measurement_t;
136 
137 // Rigid Body Tracker NODE STATE type
138 typedef omip_msgs::RigidBodyPosesAndVelsMsg rbt_state_ros_t;
139 
140 // Rigid Body Tracker FILTER STATE type
141 typedef omip_msgs::RigidBodyPosesAndVelsMsg rbt_state_t;
142 
143 // Kinematic Model Tracker NODE MEASUREMENT type.
144 typedef omip_msgs::RigidBodyPosesAndVelsMsg ks_measurement_ros_t;
145 
146 // Kinematic Model Tracker FILTER MEASUREMENT type.
147 typedef omip_msgs::RigidBodyPosesAndVelsMsg ks_measurement_t;
148 
149 // Kinematic Model tracker NODE STATE type
150 typedef omip_msgs::KinematicStructureMsg::Ptr ks_state_ros_t;
151 
152 // Kinematic Model Tracker FILTER STATE type
153 typedef KinematicModel ks_state_t;
154 
155 // Measurement type for the combined joint filter and all joint filters
156 typedef std::pair<omip_msgs::RigidBodyPoseAndVelMsg, omip_msgs::RigidBodyPoseAndVelMsg> joint_measurement_t;
157 
159 {
165 };
166 
168 {
171 };
172 
173 }
174 
175 POINT_CLOUD_REGISTER_POINT_STRUCT(omip::FeaturePCLwc,
176  (float, x, x)
177  (float, y, y)
178  (float, z, z)
179  (uint32_t, label, label)
180  (float[9], covariance, covariance))
181 
182 
183 #endif /* OMIPTYPEDEFS_H_ */
omip_msgs::KinematicStructureMsg::Ptr ks_state_ros_t
Definition: OMIPTypeDefs.h:150
pcl::PointCloud< pcl::PointXYZRGB > PointCloudPCL
Definition: OMIPTypeDefs.h:106
std::pair< omip_msgs::RigidBodyPoseAndVelMsg, omip_msgs::RigidBodyPoseAndVelMsg > joint_measurement_t
Definition: OMIPTypeDefs.h:156
std::pair< cv_bridge::CvImagePtr, cv_bridge::CvImagePtr > ft_measurement_t
Definition: OMIPTypeDefs.h:123
omip_msgs::RigidBodyPosesAndVelsMsg ks_measurement_ros_t
Definition: OMIPTypeDefs.h:144
omip_msgs::RigidBodyPosesAndVelsMsg ks_measurement_t
Definition: OMIPTypeDefs.h:147
#define OMIP_ADD_POINT4D
Definition: OMIPTypeDefs.h:48
OMIP_ADD_POINT4D uint32_t label
Definition: OMIPTypeDefs.h:81
FeatureCloudPCLwc::Ptr ft_state_t
Definition: OMIPTypeDefs.h:129
omip_msgs::RigidBodyPosesAndVelsMsg rbt_state_ros_t
Definition: OMIPTypeDefs.h:138
omip_msgs::RigidBodyPosesAndVelsMsg rbt_state_t
Definition: OMIPTypeDefs.h:141
long int RB_id_t
Definition: OMIPTypeDefs.h:110
TFSIMD_FORCE_INLINE const tfScalar & y() const
std::map< std::pair< int, int >, boost::shared_ptr< JointCombinedFilter > > KinematicModel
Definition: OMIPTypeDefs.h:115
sensor_msgs::PointCloud2 rbt_measurement_ros_t
Definition: OMIPTypeDefs.h:132
sensor_msgs::PointCloud2 ft_state_ros_t
Definition: OMIPTypeDefs.h:126
void ft_measurement_ros_t
Definition: OMIPTypeDefs.h:120
pcl::PointCloud< PointPCL > PointCloudPCLNoColor
Definition: OMIPTypeDefs.h:105
TFSIMD_FORCE_INLINE const tfScalar & x() const
pcl::PointCloud< PointPCL > RigidBodyShape
Definition: OMIPTypeDefs.h:113
TFSIMD_FORCE_INLINE const tfScalar & z() const
long int Joint_id_t
Definition: OMIPTypeDefs.h:111
pcl::PointXYZL FeaturePCL
Definition: OMIPTypeDefs.h:76
Definition: Feature.h:40
pcl::PointCloud< FeaturePCL > FeatureCloudPCL
Definition: OMIPTypeDefs.h:107
pcl::PointCloud< FeaturePCLwc > FeatureCloudPCLwc
Definition: OMIPTypeDefs.h:108
pcl::PointXYZ PointPCL
Definition: OMIPTypeDefs.h:73
static_environment_tracker_t
Definition: OMIPTypeDefs.h:167
FeatureCloudPCLwc::Ptr rbt_measurement_t
Definition: OMIPTypeDefs.h:135
shape_model_selector_t
Definition: OMIPTypeDefs.h:158
KinematicModel ks_state_t
Definition: OMIPTypeDefs.h:153


omip_common
Author(s): Roberto Martín-Martín
autogenerated on Mon Jun 10 2019 14:06:05