// Copyright 2018 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 = "proto3";

package cartographer.pose_graph.proto;

import "cartographer/transform/proto/transform.proto";

enum Parameterization {
  NONE = 0;
  FIX_Z = 1;
  YAW_ONLY = 2;
  YAW_CONSTANT = 3;
}

message Pose2D {
  transform.proto.Vector2d translation = 1;
  double rotation = 2;
}

message Pose3D {
  transform.proto.Vector3d translation = 1;
  transform.proto.Quaterniond rotation = 2;
  Parameterization translation_parameterization = 3;
  Parameterization rotation_parameterization = 4;
}

message ImuCalibration {
  double gravity_constant = 1;
  transform.proto.Quaterniond orientation = 2;
  Parameterization orientation_parameterization = 3;
}

message NodeId {
  string object_id = 1;
  int64 timestamp = 2;
}

message Parameters {
  oneof type {
    Pose2D pose_2d = 1;
    Pose3D pose_3d = 2;
    ImuCalibration imu_calibration = 3;
  }
}

message Node {
  NodeId id = 1;
  bool constant = 2;
  Parameters parameters = 3;
}

