2018-02-02 08:16:14 +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_TEST_HELPERS_H
|
|
|
|
#define CARTOGRAPHER_GRPC_INTERNAL_TESTING_TEST_HELPERS_H
|
2018-02-02 08:16:14 +08:00
|
|
|
|
|
|
|
#include "cartographer/sensor/dispatchable.h"
|
|
|
|
#include "cartographer_grpc/proto/map_builder_service.pb.h"
|
|
|
|
#include "google/protobuf/util/message_differencer.h"
|
|
|
|
|
2018-03-03 06:21:28 +08:00
|
|
|
namespace cartographer {
|
|
|
|
namespace cloud {
|
2018-02-02 08:16:14 +08:00
|
|
|
namespace testing {
|
|
|
|
|
2018-03-03 06:21:28 +08:00
|
|
|
using DataPredicateType = std::function<bool(const sensor::Data &)>;
|
2018-02-02 08:16:14 +08:00
|
|
|
using ProtoPredicateType =
|
|
|
|
std::function<bool(const google::protobuf::Message &)>;
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
DataPredicateType BuildDataPredicateEquals(const T &proto);
|
|
|
|
|
|
|
|
template <>
|
|
|
|
DataPredicateType BuildDataPredicateEquals<proto::AddImuDataRequest>(
|
|
|
|
const proto::AddImuDataRequest &proto);
|
|
|
|
template <>
|
|
|
|
DataPredicateType BuildDataPredicateEquals<proto::AddFixedFramePoseDataRequest>(
|
|
|
|
const proto::AddFixedFramePoseDataRequest &proto);
|
|
|
|
template <>
|
|
|
|
DataPredicateType BuildDataPredicateEquals<proto::AddOdometryDataRequest>(
|
|
|
|
const proto::AddOdometryDataRequest &proto);
|
|
|
|
template <>
|
|
|
|
DataPredicateType BuildDataPredicateEquals<proto::AddLandmarkDataRequest>(
|
|
|
|
const proto::AddLandmarkDataRequest &proto);
|
|
|
|
template <>
|
|
|
|
DataPredicateType BuildDataPredicateEquals<proto::AddRangefinderDataRequest>(
|
|
|
|
const proto::AddRangefinderDataRequest &proto);
|
|
|
|
|
|
|
|
ProtoPredicateType BuildProtoPredicateEquals(
|
|
|
|
const google::protobuf::Message *proto);
|
|
|
|
|
|
|
|
} // namespace testing
|
2018-03-03 06:21:28 +08:00
|
|
|
} // namespace cloud
|
|
|
|
} // namespace cartographer
|
2018-02-02 08:16:14 +08:00
|
|
|
|
2018-03-02 21:16:49 +08:00
|
|
|
#endif // CARTOGRAPHER_GRPC_INTERNAL_TESTING_TEST_HELPERS_H
|