Make the MotionFilter internal. (#707)
Also moves it from mapping_3d to mapping since it is used in both 2D and 3D SLAM. [RFC=0003](https://github.com/googlecartographer/rfcs/blob/master/text/0003-internal-headers.md)master
							parent
							
								
									0084f14c1c
								
							
						
					
					
						commit
						79b83b92b2
					
				|  | @ -14,13 +14,13 @@ | |||
|  * limitations under the License. | ||||
|  */ | ||||
| 
 | ||||
| #include "cartographer/mapping_3d/motion_filter.h" | ||||
| #include "cartographer/internal/mapping/motion_filter.h" | ||||
| 
 | ||||
| #include "cartographer/transform/transform.h" | ||||
| #include "glog/logging.h" | ||||
| 
 | ||||
| namespace cartographer { | ||||
| namespace mapping_3d { | ||||
| namespace mapping { | ||||
| 
 | ||||
| proto::MotionFilterOptions CreateMotionFilterOptions( | ||||
|     common::LuaParameterDictionary* const parameter_dictionary) { | ||||
|  | @ -57,5 +57,5 @@ bool MotionFilter::IsSimilar(const common::Time time, | |||
|   return false; | ||||
| } | ||||
| 
 | ||||
| }  // namespace mapping_3d
 | ||||
| }  // namespace mapping
 | ||||
| }  // namespace cartographer
 | ||||
|  | @ -14,18 +14,18 @@ | |||
|  * limitations under the License. | ||||
|  */ | ||||
| 
 | ||||
| #ifndef CARTOGRAPHER_MAPPING_3D_MOTION_FILTER_H_ | ||||
| #define CARTOGRAPHER_MAPPING_3D_MOTION_FILTER_H_ | ||||
| #ifndef CARTOGRAPHER_INTERNAL_MAPPING_MOTION_FILTER_H_ | ||||
| #define CARTOGRAPHER_INTERNAL_MAPPING_MOTION_FILTER_H_ | ||||
| 
 | ||||
| #include <limits> | ||||
| 
 | ||||
| #include "cartographer/common/lua_parameter_dictionary.h" | ||||
| #include "cartographer/common/time.h" | ||||
| #include "cartographer/mapping_3d/proto/motion_filter_options.pb.h" | ||||
| #include "cartographer/mapping/proto/motion_filter_options.pb.h" | ||||
| #include "cartographer/transform/rigid_transform.h" | ||||
| 
 | ||||
| namespace cartographer { | ||||
| namespace mapping_3d { | ||||
| namespace mapping { | ||||
| 
 | ||||
| proto::MotionFilterOptions CreateMotionFilterOptions( | ||||
|     common::LuaParameterDictionary* parameter_dictionary); | ||||
|  | @ -48,7 +48,7 @@ class MotionFilter { | |||
|   transform::Rigid3d last_pose_; | ||||
| }; | ||||
| 
 | ||||
| }  // namespace mapping_3d
 | ||||
| }  // namespace mapping
 | ||||
| }  // namespace cartographer
 | ||||
| 
 | ||||
| #endif  // CARTOGRAPHER_MAPPING_3D_MOTION_FILTER_H_
 | ||||
| #endif  // CARTOGRAPHER_INTERNAL_MAPPING_MOTION_FILTER_H_
 | ||||
|  | @ -14,13 +14,13 @@ | |||
|  * limitations under the License. | ||||
|  */ | ||||
| 
 | ||||
| #include "cartographer/mapping_3d/motion_filter.h" | ||||
| #include "cartographer/internal/mapping/motion_filter.h" | ||||
| 
 | ||||
| #include "cartographer/common/lua_parameter_dictionary_test_helpers.h" | ||||
| #include "gmock/gmock.h" | ||||
| 
 | ||||
| namespace cartographer { | ||||
| namespace mapping_3d { | ||||
| namespace mapping { | ||||
| namespace { | ||||
| 
 | ||||
| class MotionFilterTest : public ::testing::Test { | ||||
|  | @ -105,5 +105,5 @@ TEST_F(MotionFilterTest, RotationalMotion) { | |||
| } | ||||
| 
 | ||||
| }  // namespace
 | ||||
| }  // namespace mapping_3d
 | ||||
| }  // namespace mapping
 | ||||
| }  // namespace cartographer
 | ||||
|  | @ -20,13 +20,13 @@ | |||
| #include <memory> | ||||
| 
 | ||||
| #include "cartographer/common/time.h" | ||||
| #include "cartographer/internal/mapping/motion_filter.h" | ||||
| #include "cartographer/mapping/pose_estimate.h" | ||||
| #include "cartographer/mapping/pose_extrapolator.h" | ||||
| #include "cartographer/mapping_2d/proto/local_trajectory_builder_options.pb.h" | ||||
| #include "cartographer/mapping_2d/scan_matching/ceres_scan_matcher.h" | ||||
| #include "cartographer/mapping_2d/scan_matching/real_time_correlative_scan_matcher.h" | ||||
| #include "cartographer/mapping_2d/submaps.h" | ||||
| #include "cartographer/mapping_3d/motion_filter.h" | ||||
| #include "cartographer/sensor/imu_data.h" | ||||
| #include "cartographer/sensor/odometry_data.h" | ||||
| #include "cartographer/sensor/range_data.h" | ||||
|  | @ -94,7 +94,7 @@ class LocalTrajectoryBuilder { | |||
|   const proto::LocalTrajectoryBuilderOptions options_; | ||||
|   ActiveSubmaps active_submaps_; | ||||
| 
 | ||||
|   mapping_3d::MotionFilter motion_filter_; | ||||
|   mapping::MotionFilter motion_filter_; | ||||
|   scan_matching::RealTimeCorrelativeScanMatcher | ||||
|       real_time_correlative_scan_matcher_; | ||||
|   scan_matching::CeresScanMatcher ceres_scan_matcher_; | ||||
|  |  | |||
|  | @ -20,9 +20,9 @@ | |||
| #include <memory> | ||||
| 
 | ||||
| #include "cartographer/common/time.h" | ||||
| #include "cartographer/internal/mapping/motion_filter.h" | ||||
| #include "cartographer/mapping/pose_estimate.h" | ||||
| #include "cartographer/mapping/pose_extrapolator.h" | ||||
| #include "cartographer/mapping_3d/motion_filter.h" | ||||
| #include "cartographer/mapping_3d/proto/local_trajectory_builder_options.pb.h" | ||||
| #include "cartographer/mapping_3d/scan_matching/ceres_scan_matcher.h" | ||||
| #include "cartographer/mapping_3d/scan_matching/real_time_correlative_scan_matcher.h" | ||||
|  | @ -82,7 +82,7 @@ class LocalTrajectoryBuilder { | |||
|   const proto::LocalTrajectoryBuilderOptions options_; | ||||
|   ActiveSubmaps active_submaps_; | ||||
| 
 | ||||
|   MotionFilter motion_filter_; | ||||
|   mapping::MotionFilter motion_filter_; | ||||
|   std::unique_ptr<scan_matching::RealTimeCorrelativeScanMatcher> | ||||
|       real_time_correlative_scan_matcher_; | ||||
|   std::unique_ptr<scan_matching::CeresScanMatcher> ceres_scan_matcher_; | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ | |||
| 
 | ||||
| syntax = "proto3"; | ||||
| 
 | ||||
| package cartographer.mapping_3d.proto; | ||||
| package cartographer.mapping.proto; | ||||
| 
 | ||||
| message MotionFilterOptions { | ||||
|   // Threshold above which range data is inserted based on time. | ||||
|  | @ -16,10 +16,10 @@ | |||
| 
 | ||||
| #include "cartographer/mapping_2d/local_trajectory_builder_options.h" | ||||
| 
 | ||||
| #include "cartographer/internal/mapping/motion_filter.h" | ||||
| #include "cartographer/mapping_2d/scan_matching/ceres_scan_matcher.h" | ||||
| #include "cartographer/mapping_2d/scan_matching/real_time_correlative_scan_matcher.h" | ||||
| #include "cartographer/mapping_2d/submaps.h" | ||||
| #include "cartographer/mapping_3d/motion_filter.h" | ||||
| #include "cartographer/sensor/voxel_filter.h" | ||||
| 
 | ||||
| namespace cartographer { | ||||
|  | @ -56,9 +56,8 @@ proto::LocalTrajectoryBuilderOptions CreateLocalTrajectoryBuilderOptions( | |||
|   *options.mutable_ceres_scan_matcher_options() = | ||||
|       scan_matching::CreateCeresScanMatcherOptions( | ||||
|           parameter_dictionary->GetDictionary("ceres_scan_matcher").get()); | ||||
|   *options.mutable_motion_filter_options() = | ||||
|       mapping_3d::CreateMotionFilterOptions( | ||||
|           parameter_dictionary->GetDictionary("motion_filter").get()); | ||||
|   *options.mutable_motion_filter_options() = mapping::CreateMotionFilterOptions( | ||||
|       parameter_dictionary->GetDictionary("motion_filter").get()); | ||||
|   options.set_imu_gravity_time_constant( | ||||
|       parameter_dictionary->GetDouble("imu_gravity_time_constant")); | ||||
|   *options.mutable_submaps_options() = CreateSubmapsOptions( | ||||
|  |  | |||
|  | @ -16,7 +16,7 @@ syntax = "proto3"; | |||
| 
 | ||||
| package cartographer.mapping_2d.proto; | ||||
| 
 | ||||
| import "cartographer/mapping_3d/proto/motion_filter_options.proto"; | ||||
| import "cartographer/mapping/proto/motion_filter_options.proto"; | ||||
| import "cartographer/sensor/proto/adaptive_voxel_filter_options.proto"; | ||||
| import "cartographer/mapping_2d/proto/submaps_options.proto"; | ||||
| import "cartographer/mapping_2d/scan_matching/proto/ceres_scan_matcher_options.proto"; | ||||
|  | @ -56,7 +56,7 @@ message LocalTrajectoryBuilderOptions { | |||
|       real_time_correlative_scan_matcher_options = 7; | ||||
|   scan_matching.proto.CeresScanMatcherOptions | ||||
|       ceres_scan_matcher_options = 8; | ||||
|   mapping_3d.proto.MotionFilterOptions motion_filter_options = 13; | ||||
|   mapping.proto.MotionFilterOptions motion_filter_options = 13; | ||||
| 
 | ||||
|   // Time constant in seconds for the orientation moving average based on | ||||
|   // observed gravity via the IMU. It should be chosen so that the error | ||||
|  |  | |||
|  | @ -16,8 +16,8 @@ | |||
| 
 | ||||
| #include "cartographer/mapping_3d/local_trajectory_builder_options.h" | ||||
| 
 | ||||
| #include "cartographer/internal/mapping/motion_filter.h" | ||||
| #include "cartographer/mapping_2d/scan_matching/real_time_correlative_scan_matcher.h" | ||||
| #include "cartographer/mapping_3d/motion_filter.h" | ||||
| #include "cartographer/mapping_3d/scan_matching/ceres_scan_matcher.h" | ||||
| #include "cartographer/mapping_3d/submaps.h" | ||||
| #include "cartographer/sensor/voxel_filter.h" | ||||
|  | @ -55,7 +55,7 @@ proto::LocalTrajectoryBuilderOptions CreateLocalTrajectoryBuilderOptions( | |||
|   *options.mutable_ceres_scan_matcher_options() = | ||||
|       scan_matching::CreateCeresScanMatcherOptions( | ||||
|           parameter_dictionary->GetDictionary("ceres_scan_matcher").get()); | ||||
|   *options.mutable_motion_filter_options() = CreateMotionFilterOptions( | ||||
|   *options.mutable_motion_filter_options() = mapping::CreateMotionFilterOptions( | ||||
|       parameter_dictionary->GetDictionary("motion_filter").get()); | ||||
|   options.set_imu_gravity_time_constant( | ||||
|       parameter_dictionary->GetDouble("imu_gravity_time_constant")); | ||||
|  |  | |||
|  | @ -16,7 +16,7 @@ syntax = "proto3"; | |||
| 
 | ||||
| package cartographer.mapping_3d.proto; | ||||
| 
 | ||||
| import "cartographer/mapping_3d/proto/motion_filter_options.proto"; | ||||
| import "cartographer/mapping/proto/motion_filter_options.proto"; | ||||
| import "cartographer/sensor/proto/adaptive_voxel_filter_options.proto"; | ||||
| import "cartographer/mapping_2d/scan_matching/proto/real_time_correlative_scan_matcher_options.proto"; | ||||
| import "cartographer/mapping_3d/proto/submaps_options.proto"; | ||||
|  | @ -49,7 +49,7 @@ message LocalTrajectoryBuilderOptions { | |||
|       real_time_correlative_scan_matcher_options = 14; | ||||
|   scan_matching.proto.CeresScanMatcherOptions | ||||
|       ceres_scan_matcher_options = 6; | ||||
|   MotionFilterOptions motion_filter_options = 7; | ||||
|   mapping.proto.MotionFilterOptions motion_filter_options = 7; | ||||
| 
 | ||||
|   // Time constant in seconds for the orientation moving average based on | ||||
|   // observed gravity via the IMU. It should be chosen so that the error | ||||
|  |  | |||
|  | @ -121,6 +121,19 @@ cartographer.mapping.proto.PoseGraphOptions pose_graph_options | |||
|   Not yet documented. | ||||
| 
 | ||||
| 
 | ||||
| cartographer.mapping.proto.MotionFilterOptions | ||||
| ============================================== | ||||
| 
 | ||||
| double max_time_seconds | ||||
|   Threshold above which range data is inserted based on time. | ||||
| 
 | ||||
| double max_distance_meters | ||||
|   Threshold above which range data is inserted based on linear motion. | ||||
| 
 | ||||
| double max_angle_radians | ||||
|   Threshold above which range data is inserted based on rotational motion. | ||||
| 
 | ||||
| 
 | ||||
| cartographer.mapping.proto.PoseGraphOptions | ||||
| =========================================== | ||||
| 
 | ||||
|  | @ -215,7 +228,7 @@ cartographer.mapping_2d.scan_matching.proto.RealTimeCorrelativeScanMatcherOption | |||
| cartographer.mapping_2d.scan_matching.proto.CeresScanMatcherOptions ceres_scan_matcher_options | ||||
|   Not yet documented. | ||||
| 
 | ||||
| cartographer.mapping_3d.proto.MotionFilterOptions motion_filter_options | ||||
| cartographer.mapping.proto.MotionFilterOptions motion_filter_options | ||||
|   Not yet documented. | ||||
| 
 | ||||
| double imu_gravity_time_constant | ||||
|  | @ -347,7 +360,7 @@ cartographer.mapping_2d.scan_matching.proto.RealTimeCorrelativeScanMatcherOption | |||
| cartographer.mapping_3d.scan_matching.proto.CeresScanMatcherOptions ceres_scan_matcher_options | ||||
|   Not yet documented. | ||||
| 
 | ||||
| cartographer.mapping_3d.proto.MotionFilterOptions motion_filter_options | ||||
| cartographer.mapping.proto.MotionFilterOptions motion_filter_options | ||||
|   Not yet documented. | ||||
| 
 | ||||
| double imu_gravity_time_constant | ||||
|  | @ -365,19 +378,6 @@ cartographer.mapping_3d.proto.SubmapsOptions submaps_options | |||
|   Not yet documented. | ||||
| 
 | ||||
| 
 | ||||
| cartographer.mapping_3d.proto.MotionFilterOptions | ||||
| ================================================= | ||||
| 
 | ||||
| double max_time_seconds | ||||
|   Threshold above which range data is inserted based on time. | ||||
| 
 | ||||
| double max_distance_meters | ||||
|   Threshold above which range data is inserted based on linear motion. | ||||
| 
 | ||||
| double max_angle_radians | ||||
|   Threshold above which range data is inserted based on rotational motion. | ||||
| 
 | ||||
| 
 | ||||
| cartographer.mapping_3d.proto.RangeDataInserterOptions | ||||
| ====================================================== | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue