pose_graph_test.cc
Go to the documentation of this file.
1 /*
2  * Copyright 2018 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
18 
22 #include "google/protobuf/util/message_differencer.h"
23 #include "gtest/gtest.h"
24 
25 namespace cartographer {
26 namespace mapping {
27 namespace {
28 
29 TEST(PoseGraph, SerializeConstraint) {
30  proto::PoseGraph::Constraint expected_constraint = test::CreateFakeConstraint(
32  ::google::protobuf::RepeatedPtrField<proto::PoseGraph::Constraint>
33  constraint_protos;
34  *constraint_protos.Add() = expected_constraint;
35  PoseGraph::Constraint constraint = FromProto(constraint_protos).front();
36  EXPECT_TRUE(google::protobuf::util::MessageDifferencer::Equals(
37  expected_constraint, ToProto(constraint)));
38 }
39 
40 } // namespace
41 } // namespace mapping
42 } // namespace cartographer
PoseGraph::Constraint::Tag FromProto(const proto::PoseGraph::Constraint::Tag &proto)
Definition: pose_graph.cc:38
proto::PoseGraph::Constraint CreateFakeConstraint(const proto::Node &node, const proto::Submap &submap)
proto::Submap CreateFakeSubmap3D(int trajectory_id, int submap_index)
proto::Node CreateFakeNode(int trajectory_id, int node_index)
proto::MapLimits ToProto(const MapLimits &map_limits)
Definition: map_limits.h:92
TEST(TrajectoryConnectivityStateTest, UnknownTrajectory)


cartographer
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:00:58