2018-01-27 00:56:36 +08:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2018-03-02 21:16:49 +08:00
|
|
|
#ifndef CARTOGRAPHER_GRPC_INTERNAL_TESTING_MOCK_MAP_BUILDER_H
|
|
|
|
#define CARTOGRAPHER_GRPC_INTERNAL_TESTING_MOCK_MAP_BUILDER_H
|
2018-01-27 00:56:36 +08:00
|
|
|
|
|
|
|
#include "cartographer/mapping/map_builder_interface.h"
|
|
|
|
#include "cartographer/mapping/trajectory_builder_interface.h"
|
|
|
|
#include "glog/logging.h"
|
|
|
|
#include "gmock/gmock.h"
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
|
|
|
using testing::_;
|
|
|
|
|
2018-03-03 06:21:28 +08:00
|
|
|
namespace cartographer {
|
|
|
|
namespace cloud {
|
2018-01-27 00:56:36 +08:00
|
|
|
namespace testing {
|
|
|
|
|
2018-03-03 06:21:28 +08:00
|
|
|
class MockMapBuilder : public mapping::MapBuilderInterface {
|
2018-01-27 00:56:36 +08:00
|
|
|
public:
|
|
|
|
MOCK_METHOD3(
|
|
|
|
AddTrajectoryBuilder,
|
|
|
|
int(const std::set<SensorId> &expected_sensor_ids,
|
2018-03-03 06:21:28 +08:00
|
|
|
const mapping::proto::TrajectoryBuilderOptions &trajectory_options,
|
|
|
|
mapping::MapBuilderInterface::LocalSlamResultCallback
|
2018-01-27 00:56:36 +08:00
|
|
|
local_slam_result_callback));
|
2018-02-05 16:45:43 +08:00
|
|
|
MOCK_METHOD1(AddTrajectoryForDeserialization,
|
2018-03-03 06:21:28 +08:00
|
|
|
int(const mapping::proto::TrajectoryBuilderOptionsWithSensorIds
|
|
|
|
&options_with_sensor_ids_proto));
|
|
|
|
MOCK_CONST_METHOD1(GetTrajectoryBuilder,
|
|
|
|
mapping::TrajectoryBuilderInterface *(int trajectory_id));
|
2018-01-27 00:56:36 +08:00
|
|
|
MOCK_METHOD1(FinishTrajectory, void(int trajectory_id));
|
2018-03-03 06:21:28 +08:00
|
|
|
MOCK_METHOD2(SubmapToProto,
|
|
|
|
std::string(const mapping::SubmapId &,
|
|
|
|
mapping::proto::SubmapQuery::Response *));
|
|
|
|
MOCK_METHOD1(SerializeState, void(io::ProtoStreamWriterInterface *));
|
|
|
|
MOCK_METHOD2(LoadState, void(io::ProtoStreamReaderInterface *, bool));
|
2018-01-27 00:56:36 +08:00
|
|
|
MOCK_CONST_METHOD0(num_trajectory_builders, int());
|
2018-03-03 06:21:28 +08:00
|
|
|
MOCK_METHOD0(pose_graph, mapping::PoseGraphInterface *());
|
2018-02-05 16:45:43 +08:00
|
|
|
MOCK_CONST_METHOD0(
|
|
|
|
GetAllTrajectoryBuilderOptions,
|
2018-03-03 06:21:28 +08:00
|
|
|
const std::vector<mapping::proto::TrajectoryBuilderOptionsWithSensorIds>
|
2018-02-05 16:45:43 +08:00
|
|
|
&());
|
2018-01-27 00:56:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace testing
|
2018-03-03 06:21:28 +08:00
|
|
|
} // namespace cloud
|
|
|
|
} // namespace cartographer
|
2018-01-27 00:56:36 +08:00
|
|
|
|
2018-03-02 21:16:49 +08:00
|
|
|
#endif // CARTOGRAPHER_GRPC_INTERNAL_TESTING_MOCK_MAP_BUILDER_H
|