// Copyright 2016 The Cartographer Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto2";

import "cartographer/mapping_3d/proto/motion_filter_options.proto";
import "cartographer/sensor/proto/adaptive_voxel_filter_options.proto";
import "cartographer/mapping_3d/proto/kalman_local_trajectory_builder_options.proto";
import "cartographer/mapping_3d/proto/optimizing_local_trajectory_builder_options.proto";
import "cartographer/mapping_3d/proto/submaps_options.proto";
import "cartographer/mapping_3d/scan_matching/proto/ceres_scan_matcher_options.proto";

package cartographer.mapping_3d.proto;

message LocalTrajectoryBuilderOptions {
  enum Use {
    KALMAN = 0;
    OPTIMIZING = 1;
  }

  // Rangefinder points outside these ranges will be dropped.
  optional float min_range = 1;
  optional float max_range = 2;

  // Number of scans to accumulate into one unwarped, combined scan to use for
  // scan matching.
  optional int32 scans_per_accumulation = 3;

  // Voxel filter that gets applied to the range data immediately after
  // cropping.
  optional float voxel_filter_size = 4;

  // Voxel filter used to compute a sparser point cloud for matching.
  optional sensor.proto.AdaptiveVoxelFilterOptions
      high_resolution_adaptive_voxel_filter_options = 5;
  optional sensor.proto.AdaptiveVoxelFilterOptions
      low_resolution_adaptive_voxel_filter_options = 12;

  optional scan_matching.proto.CeresScanMatcherOptions
      ceres_scan_matcher_options = 6;
  optional MotionFilterOptions motion_filter_options = 7;
  optional SubmapsOptions submaps_options = 8;

  // Which one of the implementation to instantiate and use.
  optional Use use = 9;
  optional KalmanLocalTrajectoryBuilderOptions
      kalman_local_trajectory_builder_options = 10;
  optional OptimizingLocalTrajectoryBuilderOptions
      optimizing_local_trajectory_builder_options = 11;
}
