00001 00018 #ifndef ERROR_SIMULATION_H 00019 #define ERROR_SIMULATION_H 00020 00021 #include <geometry_msgs/Pose.h> 00022 00023 namespace fake_object_recognition { 00024 00026 const static double DEFAULT_PROB_POSE_INVAL(0.01); 00027 00029 const static double DEFAULT_POS_NOISE_MEAN(0.0); 00030 00032 const static double DEFAULT_POS_NOISE_DEV(0.005); 00033 00035 const static double DEFAULT_OR_X_NOISE_MEAN(0.0); 00036 00038 const static double DEFAULT_OR_X_NOISE_DEV(0.02); 00039 00041 const static double DEFAULT_OR_Y_NOISE_MEAN(0.0); 00042 00044 const static double DEFAULT_OR_Y_NOISE_DEV(0.02); 00045 00047 const static double DEFAULT_OR_Z_NOISE_MEAN(0.0); 00048 00050 const static double DEFAULT_OR_Z_NOISE_DEV(0.02); 00051 00055 class ErrorSimulation { 00056 00058 bool use_pose_invalidation_; 00059 00061 bool use_position_noise_; 00062 00064 bool use_orientation_noise_; 00065 00067 double prob_pose_inval_; 00068 00070 double pos_noise_dist_mean_; 00071 00073 double pos_noise_dist_dev_; 00074 00075 00077 double or_x_noise_dist_mean_; 00078 00080 double or_x_noise_dist_dev_; 00081 00083 double or_y_noise_dist_mean_; 00084 00086 double or_y_noise_dist_dev_; 00087 00089 double or_z_noise_dist_mean_; 00090 00092 double or_z_noise_dist_dev_; 00093 00094 00101 double genUniformNumber(double interval_start, double interval_end); 00102 00109 double genNormalDistNumber(double mean, double std_deviation); 00110 00111 00112 public: 00116 ErrorSimulation(); 00117 00124 ErrorSimulation(bool use_pose_invalidation, bool use_position_noise, bool use_orientation_noise); 00125 00130 bool poseInvalidation(); 00131 00137 geometry_msgs::Pose addNoiseToPosition(const geometry_msgs::Pose &pose); 00138 00144 geometry_msgs::Pose addNoiseToOrientation(const geometry_msgs::Pose &pose); 00145 00151 void setProbPoseInval(double prob_pose_inval); 00152 00158 void setPoseNoiseDistMean(double pos_noise_dist_mean); 00159 00165 void setPoseNoiseDistDev(double pos_noise_dist_dev); 00166 00172 void setOrXNoiseDistMean(double or_x_noise_dist_mean); 00173 00178 void setOrXNoiseDistDev(double or_x_noise_dist_dev); 00179 00185 void setOrYNoiseDistMean(double or_y_noise_dist_mean); 00186 00191 void setOrYNoiseDistDev(double or_y_noise_dist_dev); 00192 00198 void setOrZNoiseDistMean(double or_z_noise_dist_mean); 00199 00204 void setOrZNoiseDistDev(double or_z_noise_dist_dev); 00205 }; 00206 00207 } 00208 00209 #endif /* ERROR_SIMULATION_H */