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_TRAJECTORY_BUILDER_CONTEXT_H
|
|
|
|
#define CARTOGRAPHER_GRPC_INTERNAL_TESTING_MOCK_TRAJECTORY_BUILDER_CONTEXT_H
|
2018-01-27 00:56:36 +08:00
|
|
|
|
|
|
|
#include "cartographer/mapping/trajectory_builder_interface.h"
|
|
|
|
#include "glog/logging.h"
|
|
|
|
#include "gmock/gmock.h"
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
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 MockTrajectoryBuilder : public mapping::TrajectoryBuilderInterface {
|
2018-01-27 00:56:36 +08:00
|
|
|
public:
|
|
|
|
MockTrajectoryBuilder() = default;
|
|
|
|
~MockTrajectoryBuilder() override = default;
|
|
|
|
|
|
|
|
MOCK_METHOD2(AddSensorData,
|
2018-03-03 06:21:28 +08:00
|
|
|
void(const std::string &, const sensor::TimedPointCloudData &));
|
2018-01-27 00:56:36 +08:00
|
|
|
MOCK_METHOD2(AddSensorData,
|
2018-03-03 06:21:28 +08:00
|
|
|
void(const std::string &, const sensor::ImuData &));
|
|
|
|
MOCK_METHOD2(AddSensorData,
|
|
|
|
void(const std::string &, const sensor::OdometryData &));
|
|
|
|
MOCK_METHOD2(AddSensorData,
|
|
|
|
void(const std::string &, const sensor::FixedFramePoseData &));
|
|
|
|
MOCK_METHOD2(AddSensorData,
|
|
|
|
void(const std::string &, const sensor::LandmarkData &));
|
2018-01-27 00:56:36 +08:00
|
|
|
|
|
|
|
// Some of the platforms we run on may ship with a version of gmock which does
|
|
|
|
// not yet support move-only types.
|
2018-03-03 06:21:28 +08:00
|
|
|
MOCK_METHOD1(DoAddLocalSlamResultData, void(mapping::LocalSlamResultData *));
|
|
|
|
void AddLocalSlamResultData(std::unique_ptr<mapping::LocalSlamResultData>
|
|
|
|
local_slam_result_data) override {
|
2018-01-27 00:56:36 +08:00
|
|
|
DoAddLocalSlamResultData(local_slam_result_data.get());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // 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_TRAJECTORY_BUILDER_CONTEXT_H
|