|
NASA Astrobee Robot Software
0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
|
Go to the documentation of this file.
19 #ifndef LOCALIZATION_COMMON_TEST_UTILITIES_H_
20 #define LOCALIZATION_COMMON_TEST_UTILITIES_H_
26 #include <Eigen/Geometry>
27 #include <gtsam/geometry/Pose3.h>
29 #include <gtest/gtest.h>
36 Sampler(
const double min,
const double max,
const double count);
37 double Sample(
const int increment)
const;
60 double Noise(
const double stddev);
100 const double rotation_stddev);
102 gtsam::Pose3
AddNoiseToPose(
const gtsam::Pose3& pose,
const double translation_stddev,
const double rotation_stddev);
105 Eigen::Matrix<double, N, 1>
AddNoiseToVector(
const Eigen::Matrix<double, N, 1>& vector,
const double noise_stddev);
111 const double phi_max,
const double z_rho_scale,
const double yaw_min,
112 const double yaw_max,
const double pitch_min,
const double pitch_max,
113 const double roll_min,
const double roll_max);
122 const double phi_max,
const double z_rho_scale);
124 bool MatrixEquality(
const Eigen::MatrixXd& lhs,
const Eigen::MatrixXd& rhs,
const double tolerance);
130 return RandomDouble() * Eigen::Matrix<double, Dim, 1>::Random();
135 const Eigen::Matrix<double, D, D> random_matrix = Eigen::Matrix<double, D, D>::Random();
137 return random_matrix.transpose() * random_matrix;
141 Eigen::Matrix<double, N, 1>
AddNoiseToVector(
const Eigen::Matrix<double, N, 1>& vector,
const double noise_stddev) {
142 Eigen::Matrix<double, N, 1> noisy_vector = vector;
143 for (
int i = 0; i < vector.rows(); ++i) {
144 noisy_vector(i, 0) +=
Noise(noise_stddev);
152 #define EXPECT_MATRIX_NEAR(lhs, rhs, tol) \
154 EXPECT_PRED3(localization_common::MatrixEquality, lhs.matrix(), rhs.matrix(), tol); \
157 #endif // LOCALIZATION_COMMON_TEST_UTILITIES_H_
Definition: averager.h:33
Eigen::Vector3d RandomFrontFacingPoint()
Definition: test_utilities.cc:173
double RandomPositiveDouble()
Definition: test_utilities.cc:32
Sampler(const double min, const double max, const double count)
Definition: test_utilities.cc:25
double Noise(const double stddev)
Definition: test_utilities.cc:49
double Sample(const int increment) const
Definition: test_utilities.cc:28
Eigen::Affine3d RandomAffine3d()
Definition: test_utilities.cc:80
PoseCovariance RandomPoseCovariance()
Definition: test_utilities.cc:71
Definition: combined_nav_state.h:48
double RandomDouble()
Definition: test_utilities.cc:30
Eigen::Vector3d RandomVelocity()
Definition: test_utilities.cc:57
gtsam::Pose3 RandomPose()
Definition: test_utilities.cc:63
Definition: test_utilities.h:34
gtsam::Pose3 AddNoiseToPose(const gtsam::Pose3 &pose, const double translation_stddev, const double rotation_stddev)
Definition: test_utilities.cc:130
Eigen::Vector2d RandomPoint2d()
Definition: test_utilities.cc:61
Eigen::Isometry3d RandomIsometry3d()
Definition: test_utilities.cc:75
Eigen::Matrix3d RandomIntrinsics()
Definition: test_utilities.cc:94
Eigen::Matrix< double, Dim, 1 > RandomVector()
Definition: test_utilities.h:128
Eigen::Vector2d RandomVector2d()
Definition: test_utilities.cc:59
Time RandomTime()
Definition: test_utilities.cc:51
Eigen::Matrix< double, 6, 6 > PoseCovariance
Definition: pose_with_covariance.h:27
Eigen::Isometry3d Isometry3d(const Eigen::Vector3d &translation, const RotationType &rotation)
Definition: utilities.h:226
bool MatrixEquality(const Eigen::MatrixXd &lhs, const Eigen::MatrixXd &rhs, const double tolerance)
Definition: test_utilities.cc:193
Eigen::Vector3d RandomVector3d()
Definition: test_utilities.cc:53
Eigen::Isometry3d RandomIdentityCenteredIsometry3d(const double translation_stddev, const double rotation_stddev)
Definition: test_utilities.cc:109
Eigen::Vector3d Vector3d(const PointType &point)
Definition: utilities.h:328
Eigen::Matrix< double, D, D > RandomCovariance()
Definition: test_utilities.h:134
bool RandomBool()
Definition: test_utilities.cc:47
std::vector< Eigen::Vector3d > RandomFrontFacingPoints(const int num_points)
Definition: test_utilities.cc:165
Definition: pose_with_covariance.h:28
Eigen::Vector3d RandomPoint3d()
Definition: test_utilities.cc:55
Eigen::Isometry3d AddNoiseToIsometry3d(const Eigen::Isometry3d &pose, const double translation_stddev, const double rotation_stddev)
Definition: test_utilities.cc:113
Eigen::Isometry3d RandomFrontFacingPose(const double rho_min, const double rho_max, const double phi_min, const double phi_max, const double z_rho_scale, const double yaw_min, const double yaw_max, const double pitch_min, const double pitch_max, const double roll_min, const double roll_max)
Definition: test_utilities.cc:153
Eigen::Matrix< double, N, 1 > AddNoiseToVector(const Eigen::Matrix< double, N, 1 > &vector, const double noise_stddev)
Definition: test_utilities.h:141
PoseWithCovariance RandomPoseWithCovariance()
Definition: test_utilities.cc:73
Eigen::Affine3d Affine3d(const Eigen::Matrix< double, 7, 1 > &affine_vector)
Definition: utilities.cc:43
double RandomGaussianDouble(const double mean, const double stddev)
Definition: test_utilities.cc:40
CombinedNavState RandomCombinedNavState()
Definition: test_utilities.cc:89
double Time
Definition: time.h:23