22 #include <Eigen/Dense> 44 std::random_device rd;
45 std::mt19937 gen(rd());
46 std::uniform_real_distribution<double> dis(interval_start, interval_end);
51 std::random_device rd;
52 std::mt19937 gen(rd());
53 std::normal_distribution<double> dis(mean, std_deviation);
66 geometry_msgs::Pose result(pose);
77 geometry_msgs::Pose result(pose);
78 Eigen::Quaternion<double> orientation(pose.orientation.w, pose.orientation.x, pose.orientation.y, pose.orientation.z);
83 orientation = quat_x * quat_y * quat_z * orientation;
84 result.orientation.w = orientation.w();
85 result.orientation.x = orientation.x();
86 result.orientation.y = orientation.y();
87 result.orientation.z = orientation.z();
double genUniformNumber(double interval_start, double interval_end)
Returns a value calculated on a uniform distribution.
void setOrZNoiseDistMean(double or_z_noise_dist_mean)
Sets the mean value of the normal distribution used by the orientation error generation (z-axis) ...
static const double DEFAULT_OR_Y_NOISE_DEV(0.02)
This class is used to simulate typical errors of an object recognition system.
double genNormalDistNumber(double mean, double std_deviation)
Returns a value calculated on a normal distribution.
static const double DEFAULT_OR_Z_NOISE_MEAN(0.0)
void setProbPoseInval(double prob_pose_inval)
Set the probability of the pose invalidation.
bool use_orientation_noise_
bool use_pose_invalidation_
void setOrZNoiseDistDev(double or_z_noise_dist_dev)
Sets the standard deviation value of the normal distribution used by the orientation error generation...
ErrorSimulation()
The constructor of this class.
double pos_noise_dist_dev_
geometry_msgs::Pose addNoiseToOrientation(const geometry_msgs::Pose &pose)
Adds error values to the given pose (orientation only)
void setOrYNoiseDistDev(double or_y_noise_dist_dev)
Sets the standard deviation value of the normal distribution used by the orientation error generation...
double or_x_noise_dist_mean_
void setOrXNoiseDistMean(double or_x_noise_dist_mean)
Sets the mean value of the normal distribution used by the orientation error generation (x-axis) ...
static const double DEFAULT_OR_X_NOISE_DEV(0.02)
double or_y_noise_dist_dev_
static const double DEFAULT_OR_Y_NOISE_MEAN(0.0)
double or_z_noise_dist_mean_
static const double DEFAULT_OR_Z_NOISE_DEV(0.02)
void setOrYNoiseDistMean(double or_y_noise_dist_mean)
Sets the mean value of the normal distribution used by the orientation error generation (y-axis) ...
double or_x_noise_dist_dev_
bool poseInvalidation()
Invalidates a pose by the probability member of this class.
static const double DEFAULT_POS_NOISE_DEV(0.005)
void setPoseNoiseDistMean(double pos_noise_dist_mean)
Sets the mean value of the normal distribution used by the position error generation.
double or_z_noise_dist_dev_
static const double DEFAULT_OR_X_NOISE_MEAN(0.0)
geometry_msgs::Pose addNoiseToPosition(const geometry_msgs::Pose &pose)
Adds error values to the given pose (position only)
void setPoseNoiseDistDev(double pos_noise_dist_dev)
Sets the standard deviation value of the normal distribution used by the position error generation...
static const double DEFAULT_PROB_POSE_INVAL(0.01)
static const double DEFAULT_POS_NOISE_MEAN(0.0)
double or_y_noise_dist_mean_
void setOrXNoiseDistDev(double or_x_noise_dist_dev)
Sets the standard deviation value of the normal distribution used by the orientation error generation...
double pos_noise_dist_mean_