OMIPTypeDefs.h
Go to the documentation of this file.
00001 /*
00002  * TypeDefs.h
00003  *
00004  *      Author: roberto
00005  *
00006  * This is a modified implementation of the method for online estimation of kinematic structures described in our paper
00007  * "Online Interactive Perception of Articulated Objects with Multi-Level Recursive Estimation Based on Task-Specific Priors"
00008  * (Martín-Martín and Brock, 2014).
00009  * This implementation can be used to reproduce the results of the paper and to be applied to new research.
00010  * The implementation allows also to be extended to perceive different information/models or to use additional sources of information.
00011  * A detail explanation of the method and the system can be found in our paper.
00012  *
00013  * If you are using this implementation in your research, please consider citing our work:
00014  *
00015 @inproceedings{martinmartin_ip_iros_2014,
00016 Title = {Online Interactive Perception of Articulated Objects with Multi-Level Recursive Estimation Based on Task-Specific Priors},
00017 Author = {Roberto {Mart\'in-Mart\'in} and Oliver Brock},
00018 Booktitle = {Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems},
00019 Pages = {2494-2501},
00020 Year = {2014},
00021 Location = {Chicago, Illinois, USA},
00022 Note = {http://www.robotics.tu-berlin.de/fileadmin/fg170/Publikationen_pdf/martinmartin_ip_iros_2014.pdf},
00023 Url = {http://www.robotics.tu-berlin.de/fileadmin/fg170/Publikationen_pdf/martinmartin_ip_iros_2014.pdf},
00024 Projectname = {Interactive Perception}
00025 }
00026  * If you have questions or suggestions, contact us:
00027  * roberto.martinmartin@tu-berlin.de
00028  *
00029  * Enjoy!
00030  */
00031 
00032 #ifndef OMIPTYPEDEFS_H_
00033 #define OMIPTYPEDEFS_H_
00034 
00035 // ROS, PCL, Opencv
00036 #include <visualization_msgs/MarkerArray.h>
00037 #include <pcl/point_types.h>
00038 #include <pcl/point_cloud.h>
00039 #include <cv_bridge/cv_bridge.h>
00040 #include <sensor_msgs/PointCloud2.h>
00041 
00042 // OMIP
00043 #include <omip_msgs/RigidBodyPosesAndVelsMsg.h>
00044 #include <omip_msgs/RigidBodyPoseAndVelMsg.h>
00045 #include <omip_msgs/JointMsg.h>
00046 #include <omip_msgs/KinematicStructureMsg.h>
00047 
00048 #define OMIP_ADD_POINT4D \
00049   union { \
00050     float data[4]; \
00051     struct { \
00052       float x; \
00053       float y; \
00054       float z; \
00055     }; \
00056   } EIGEN_ALIGN16; \
00057   inline Eigen::Map<Eigen::Vector3f> getVector3fMap () { return (Eigen::Vector3f::Map (data)); } \
00058   inline const Eigen::Map<const Eigen::Vector3f> getVector3fMap () const { return (Eigen::Vector3f::Map (data)); } \
00059   inline Eigen::Map<Eigen::Vector4f, Eigen::Aligned> getVector4fMap () { return (Eigen::Vector4f::MapAligned (data)); } \
00060   inline const Eigen::Map<const Eigen::Vector4f, Eigen::Aligned> getVector4fMap () const { return (Eigen::Vector4f::MapAligned (data)); } \
00061   inline Eigen::Map<Eigen::Array3f> getArray3fMap () { return (Eigen::Array3f::Map (data)); } \
00062   inline const Eigen::Map<const Eigen::Array3f> getArray3fMap () const { return (Eigen::Array3f::Map (data)); } \
00063   inline Eigen::Map<Eigen::Array4f, Eigen::Aligned> getArray4fMap () { return (Eigen::Array4f::MapAligned (data)); } \
00064   inline const Eigen::Map<const Eigen::Array4f, Eigen::Aligned> getArray4fMap () const { return (Eigen::Array4f::MapAligned (data)); }
00065 
00066 namespace omip
00067 {
00068 
00069 //Forward declaration
00070 class JointFilter;
00071 
00072 //Forward declaration
00073 class JointCombinedFilter;
00074 
00075 typedef pcl::PointXYZ PointPCL;
00076 typedef pcl::PointXYZL FeaturePCL;
00077 
00078 struct EIGEN_ALIGN16 _FeaturePCLwc
00079 {
00080   OMIP_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
00081   uint32_t label;
00082   float covariance[9];
00083   EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00084 };
00085 
00086 struct FeaturePCLwc : public _FeaturePCLwc
00087 {
00088   inline FeaturePCLwc ()
00089   {
00090     x = y = z = 0.0f;
00091     data[3] = 1.0f;
00092     label = 0;
00093     covariance[0] = 1.0f;
00094     covariance[1] = 0.0f;
00095     covariance[2] = 0.0f;
00096     covariance[3] = 0.0f;
00097     covariance[4] = 1.0f;
00098     covariance[5] = 0.0f;
00099     covariance[6] = 0.0f;
00100     covariance[7] = 0.0f;
00101     covariance[8] = 1.0f;
00102   }
00103 };
00104 
00105 typedef pcl::PointCloud<PointPCL> PointCloudPCLNoColor;
00106 typedef pcl::PointCloud<pcl::PointXYZRGB> PointCloudPCL;
00107 typedef pcl::PointCloud<FeaturePCL> FeatureCloudPCL;
00108 typedef pcl::PointCloud<FeaturePCLwc> FeatureCloudPCLwc;
00109 
00110 typedef long int RB_id_t;
00111 typedef long int Joint_id_t;
00112 
00113 typedef pcl::PointCloud<PointPCL> RigidBodyShape;
00114 
00115 typedef std::map<std::pair<int, int>, boost::shared_ptr<JointCombinedFilter> > KinematicModel;
00116 
00117 // Feature Tracker NODE MEASUREMENT type. We don't use this type because we need to synchronize several
00118 // inputs as measurement for the feature tracker node (at least depth and rgb images) and this cannot be handled
00119 // correctly with one single type definition
00120 typedef void ft_measurement_ros_t;
00121 
00122 // Feature Tracker FILTER MEASUREMENT type. The first pointer points to the RGB image. The second pointer points to the depth image
00123 typedef std::pair<cv_bridge::CvImagePtr, cv_bridge::CvImagePtr> ft_measurement_t;
00124 
00125 // Feature Tracker NODE STATE type
00126 typedef sensor_msgs::PointCloud2 ft_state_ros_t;
00127 
00128 // Feature Tracker FILTER STATE type
00129 typedef FeatureCloudPCLwc::Ptr ft_state_t;
00130 
00131 // Rigid Body Tracker NODE MEASUREMENT type (= ft_state_ros_t).
00132 typedef sensor_msgs::PointCloud2 rbt_measurement_ros_t;
00133 
00134 // Rigid Body Tracker FILTER MEASUREMENT type.
00135 typedef FeatureCloudPCLwc::Ptr rbt_measurement_t;
00136 
00137 // Rigid Body Tracker NODE STATE type
00138 typedef omip_msgs::RigidBodyPosesAndVelsMsg rbt_state_ros_t;
00139 
00140 // Rigid Body Tracker FILTER STATE type
00141 typedef omip_msgs::RigidBodyPosesAndVelsMsg rbt_state_t;
00142 
00143 // Kinematic Model Tracker NODE MEASUREMENT type.
00144 typedef omip_msgs::RigidBodyPosesAndVelsMsg ks_measurement_ros_t;
00145 
00146 // Kinematic Model Tracker FILTER MEASUREMENT type.
00147 typedef omip_msgs::RigidBodyPosesAndVelsMsg ks_measurement_t;
00148 
00149 // Kinematic Model tracker NODE STATE type
00150 typedef omip_msgs::KinematicStructureMsg::Ptr ks_state_ros_t;
00151 
00152 // Kinematic Model Tracker FILTER STATE type
00153 typedef KinematicModel ks_state_t;
00154 
00155 // Measurement type for the combined joint filter and all joint filters
00156 typedef std::pair<omip_msgs::RigidBodyPoseAndVelMsg, omip_msgs::RigidBodyPoseAndVelMsg> joint_measurement_t;
00157 
00158 enum shape_model_selector_t
00159 {
00160     BASED_ON_DEPTH = 1,
00161     BASED_ON_COLOR = 2,
00162     BASED_ON_EXT_DEPTH = 3,
00163     BASED_ON_EXT_COLOR = 4,
00164     BASED_ON_EXT_DEPTH_AND_COLOR = 5
00165 };
00166 
00167 enum static_environment_tracker_t
00168 {
00169     STATIC_ENVIRONMENT_EKF_TRACKER = 1,
00170     STATIC_ENVIRONMENT_ICP_TRACKER = 2
00171 };
00172 
00173 }
00174 
00175 POINT_CLOUD_REGISTER_POINT_STRUCT(omip::FeaturePCLwc,
00176                                   (float, x, x)
00177                                   (float, y, y)
00178                                   (float, z, z)
00179                                   (uint32_t, label, label)
00180                                   (float[9], covariance, covariance))
00181 
00182 
00183 #endif /* OMIPTYPEDEFS_H_ */


omip_common
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:26:37