From 9b48ba5ff48d76ea281e0d2e4773735ac273fa95 Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Wed, 5 Jul 2017 12:16:29 +0200 Subject: [PATCH] Remove unused code. (#384) --- .../mapping_2d/local_trajectory_builder.h | 1 - cartographer/sensor/configuration.cc | 73 ------------------- cartographer/sensor/configuration.h | 50 ------------- cartographer/sensor/proto/configuration.proto | 33 --------- 4 files changed, 157 deletions(-) delete mode 100644 cartographer/sensor/configuration.cc delete mode 100644 cartographer/sensor/configuration.h delete mode 100644 cartographer/sensor/proto/configuration.proto diff --git a/cartographer/mapping_2d/local_trajectory_builder.h b/cartographer/mapping_2d/local_trajectory_builder.h index 1f77b6e..26ec09d 100644 --- a/cartographer/mapping_2d/local_trajectory_builder.h +++ b/cartographer/mapping_2d/local_trajectory_builder.h @@ -28,7 +28,6 @@ #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/configuration.h" #include "cartographer/sensor/voxel_filter.h" #include "cartographer/transform/rigid_transform.h" diff --git a/cartographer/sensor/configuration.cc b/cartographer/sensor/configuration.cc deleted file mode 100644 index d88743c..0000000 --- a/cartographer/sensor/configuration.cc +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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. - */ - -#include "cartographer/sensor/configuration.h" - -#include "Eigen/Core" -#include "Eigen/Geometry" -#include "cartographer/sensor/proto/configuration.pb.h" -#include "cartographer/transform/proto/transform.pb.h" -#include "cartographer/transform/rigid_transform.h" -#include "cartographer/transform/transform.h" -#include "glog/logging.h" - -namespace cartographer { -namespace sensor { - -proto::Configuration::Sensor CreateSensorConfiguration( - common::LuaParameterDictionary* const parameter_dictionary) { - proto::Configuration::Sensor sensor; - sensor.set_frame_id(parameter_dictionary->GetString("frame_id")); - *sensor.mutable_transform() = transform::ToProto(transform::FromDictionary( - parameter_dictionary->GetDictionary("transform").get())); - return sensor; -} - -proto::Configuration CreateConfiguration( - common::LuaParameterDictionary* const parameter_dictionary) { - proto::Configuration configuration; - for (auto& sensor_parameter_dictionary : - parameter_dictionary->GetArrayValuesAsDictionaries()) { - *configuration.add_sensor() = - CreateSensorConfiguration(sensor_parameter_dictionary.get()); - } - return configuration; -} - -bool IsEnabled(const string& frame_id, - const sensor::proto::Configuration& sensor_configuration) { - for (const auto& sensor : sensor_configuration.sensor()) { - if (sensor.frame_id() == frame_id) { - return true; - } - } - return false; -} - -transform::Rigid3d GetTransformToTracking( - const string& frame_id, - const sensor::proto::Configuration& sensor_configuration) { - for (const auto& sensor : sensor_configuration.sensor()) { - if (sensor.frame_id() == frame_id) { - return transform::ToRigid3(sensor.transform()); - } - } - LOG(FATAL) << "No configuration found for sensor with frame ID '" << frame_id - << "'."; -} - -} // namespace sensor -} // namespace cartographer diff --git a/cartographer/sensor/configuration.h b/cartographer/sensor/configuration.h deleted file mode 100644 index c632371..0000000 --- a/cartographer/sensor/configuration.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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. - */ - -#ifndef CARTOGRAPHER_SENSOR_CONFIGURATION_H_ -#define CARTOGRAPHER_SENSOR_CONFIGURATION_H_ - -#include "Eigen/Geometry" -#include "cartographer/common/lua_parameter_dictionary.h" -#include "cartographer/sensor/proto/configuration.pb.h" -#include "cartographer/transform/rigid_transform.h" - -namespace cartographer { -namespace sensor { - -// Creates the configuration for a singular sensor from 'parameter_dictionary'. -proto::Configuration::Sensor CreateSensorConfiguration( - common::LuaParameterDictionary* parameter_dictionary); - -// Creates the mapping from frame_id to Sensors defined in -// 'parameter_dictionary'. -proto::Configuration CreateConfiguration( - common::LuaParameterDictionary* parameter_dictionary); - -// Returns true if 'frame_id' is mentioned in 'sensor_configuration'. -bool IsEnabled(const string& frame_id, - const sensor::proto::Configuration& sensor_configuration); - -// Returns the transform which takes data from the sensor frame to the -// tracking frame. -transform::Rigid3d GetTransformToTracking( - const string& frame_id, - const sensor::proto::Configuration& sensor_configuration); - -} // namespace sensor -} // namespace cartographer - -#endif // CARTOGRAPHER_SENSOR_CONFIGURATION_H_ diff --git a/cartographer/sensor/proto/configuration.proto b/cartographer/sensor/proto/configuration.proto deleted file mode 100644 index 3b5abbe..0000000 --- a/cartographer/sensor/proto/configuration.proto +++ /dev/null @@ -1,33 +0,0 @@ -// 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"; - -package cartographer.sensor.proto; - -import "cartographer/transform/proto/transform.proto"; - -// NEXT_ID: 16 -message Configuration { - // NEXT_ID: 4 - message Sensor { - // 'frame_id' of the sensor. - optional string frame_id = 2; - - // Transformation from 'frame_id' to the tracking frame. - optional transform.proto.Rigid3d transform = 3; - } - - repeated Sensor sensor = 15; -}