23 proto::SensorMetadata* proto) {
24 proto->set_sensor_id(sensor_id);
25 proto->set_trajectory_id(trajectory_id);
29 const std::string& sensor_id,
int trajectory_id,
30 const sensor::proto::FixedFramePoseData& fixed_frame_pose_data,
31 proto::AddFixedFramePoseDataRequest* proto) {
33 proto->mutable_sensor_metadata());
34 *proto->mutable_fixed_frame_pose_data() = fixed_frame_pose_data;
38 const int trajectory_id,
39 const sensor::proto::ImuData& imu_data,
40 proto::AddImuDataRequest* proto) {
42 proto->mutable_sensor_metadata());
43 *proto->mutable_imu_data() = imu_data;
47 const std::string& sensor_id,
int trajectory_id,
48 const sensor::proto::OdometryData& odometry_data,
49 proto::AddOdometryDataRequest* proto) {
51 proto->mutable_sensor_metadata());
52 *proto->mutable_odometry_data() = odometry_data;
56 const std::string& sensor_id,
int trajectory_id,
57 const sensor::proto::TimedPointCloudData& timed_point_cloud_data,
58 proto::AddRangefinderDataRequest* proto) {
60 proto->mutable_sensor_metadata());
61 *proto->mutable_timed_point_cloud_data() = timed_point_cloud_data;
65 const std::string& sensor_id,
int trajectory_id,
66 const sensor::proto::LandmarkData& landmark_data,
67 proto::AddLandmarkDataRequest* proto) {
69 proto->mutable_sensor_metadata());
70 *proto->mutable_landmark_data() = landmark_data;
75 int starting_submap_index,
78 proto::SensorData* proto) {
80 proto->mutable_sensor_metadata());
81 proto->mutable_local_slam_result_data()->set_timestamp(
83 *proto->mutable_local_slam_result_data()->mutable_node_data() =
87 auto* submap = proto->mutable_local_slam_result_data()->add_submaps();
88 insertion_submap->ToProto(submap, insertion_submap->finished());
89 submap->mutable_submap_id()->set_trajectory_id(trajectory_id);
90 submap->mutable_submap_id()->set_submap_index(starting_submap_index);
91 ++starting_submap_index;
98 proto::SensorType type;
99 switch (sensor_id.
type) {
100 case SensorType::RANGE:
101 type = proto::SensorType::RANGE;
103 case SensorType::IMU:
104 type = proto::SensorType::IMU;
106 case SensorType::ODOMETRY:
107 type = proto::SensorType::ODOMETRY;
109 case SensorType::FIXED_FRAME_POSE:
110 type = proto::SensorType::FIXED_FRAME_POSE;
112 case SensorType::LANDMARK:
113 type = proto::SensorType::LANDMARK;
115 case SensorType::LOCAL_SLAM_RESULT:
116 type = proto::SensorType::LOCAL_SLAM_RESULT;
119 LOG(FATAL) <<
"unknown SensorType";
122 proto.set_type(type);
123 proto.set_id(sensor_id.
id);
132 switch (proto.type()) {
133 case proto::SensorType::RANGE:
134 type = SensorType::RANGE;
136 case proto::SensorType::IMU:
137 type = SensorType::IMU;
139 case proto::SensorType::ODOMETRY:
140 type = SensorType::ODOMETRY;
142 case proto::SensorType::FIXED_FRAME_POSE:
143 type = SensorType::FIXED_FRAME_POSE;
145 case proto::SensorType::LANDMARK:
146 type = SensorType::LANDMARK;
148 case proto::SensorType::LOCAL_SLAM_RESULT:
149 type = SensorType::LOCAL_SLAM_RESULT;
152 LOG(FATAL) <<
"unknown proto::SensorType";
std::vector< std::shared_ptr< const Submap > > insertion_submaps
mapping::TrajectoryBuilderInterface::SensorId FromProto(const proto::SensorId &proto)
void CreateAddRangeFinderDataRequest(const std::string &sensor_id, int trajectory_id, const sensor::proto::TimedPointCloudData &timed_point_cloud_data, proto::AddRangefinderDataRequest *proto)
UniversalTimeScaleClock::time_point Time
int64 ToUniversal(const Time time)
void CreateAddOdometryDataRequest(const std::string &sensor_id, int trajectory_id, const sensor::proto::OdometryData &odometry_data, proto::AddOdometryDataRequest *proto)
void CreateAddFixedFramePoseDataRequest(const std::string &sensor_id, int trajectory_id, const sensor::proto::FixedFramePoseData &fixed_frame_pose_data, proto::AddFixedFramePoseDataRequest *proto)
void CreateAddLandmarkDataRequest(const std::string &sensor_id, int trajectory_id, const sensor::proto::LandmarkData &landmark_data, proto::AddLandmarkDataRequest *proto)
proto::MapLimits ToProto(const MapLimits &map_limits)
void CreateSensorDataForLocalSlamResult(const std::string &sensor_id, int trajectory_id, common::Time time, int starting_submap_index, const mapping::TrajectoryBuilderInterface::InsertionResult &insertion_result, proto::SensorData *proto)
proto::SensorId ToProto(const mapping::TrajectoryBuilderInterface::SensorId &sensor_id)
std::shared_ptr< const TrajectoryNode::Data > constant_data
void CreateAddImuDataRequest(const std::string &sensor_id, const int trajectory_id, const sensor::proto::ImuData &imu_data, proto::AddImuDataRequest *proto)
::cartographer::mapping::TrajectoryBuilderInterface::SensorId SensorId
void CreateSensorMetadata(const std::string &sensor_id, const int trajectory_id, proto::SensorMetadata *proto)