mapping/internal/testing/test_helpers.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 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 
17 #ifndef CARTOGRAPHER_MAPPING_INTERNAL_TESTING_TEST_HELPERS_H_
18 #define CARTOGRAPHER_MAPPING_INTERNAL_TESTING_TEST_HELPERS_H_
19 
20 #include <memory>
21 
23 #include "cartographer/mapping/proto/serialization.pb.h"
25 
26 namespace cartographer {
27 namespace mapping {
28 namespace test {
29 
30 std::unique_ptr<::cartographer::common::LuaParameterDictionary>
31 ResolveLuaParameters(const std::string& lua_code);
32 
33 std::vector<cartographer::sensor::TimedPointCloudData>
34 GenerateFakeRangeMeasurements(double travel_distance, double duration,
35  double time_step);
36 
37 proto::Submap CreateFakeSubmap3D(int trajectory_id = 1, int submap_index = 1);
38 
39 proto::Node CreateFakeNode(int trajectory_id = 1, int node_index = 1);
40 
41 proto::PoseGraph::Constraint CreateFakeConstraint(const proto::Node& node,
42  const proto::Submap& submap);
43 
44 proto::Trajectory* CreateTrajectoryIfNeeded(int trajectory_id,
45  proto::PoseGraph* pose_graph);
46 proto::PoseGraph::LandmarkPose CreateFakeLandmark(
47  const std::string& landmark_id, const transform::Rigid3d& global_pose);
48 
49 void AddToProtoGraph(const proto::Node& node_data,
50  proto::PoseGraph* pose_graph);
51 
52 void AddToProtoGraph(const proto::Submap& submap_data,
53  proto::PoseGraph* pose_graph);
54 
55 void AddToProtoGraph(const proto::PoseGraph::Constraint& constraint,
56  proto::PoseGraph* pose_graph);
57 
58 void AddToProtoGraph(const proto::PoseGraph::LandmarkPose& landmark_node,
59  proto::PoseGraph* pose_graph);
60 
61 } // namespace test
62 } // namespace mapping
63 } // namespace cartographer
64 
65 #endif // CARTOGRAPHER_MAPPING_INTERNAL_TESTING_TEST_HELPERS_H_
proto::PoseGraph::Constraint CreateFakeConstraint(const proto::Node &node, const proto::Submap &submap)
void AddToProtoGraph(const proto::Node &node_data, proto::PoseGraph *pose_graph)
Rigid3< double > Rigid3d
std::vector< cartographer::sensor::TimedPointCloudData > GenerateFakeRangeMeasurements(double travel_distance, double duration, double time_step)
proto::Submap CreateFakeSubmap3D(int trajectory_id, int submap_index)
proto::PoseGraph::LandmarkPose CreateFakeLandmark(const std::string &landmark_id, const transform::Rigid3d &global_pose)
proto::Node CreateFakeNode(int trajectory_id, int node_index)
std::unique_ptr<::cartographer::common::LuaParameterDictionary > ResolveLuaParameters(const std::string &lua_code)
proto::Trajectory * CreateTrajectoryIfNeeded(int trajectory_id, proto::PoseGraph *pose_graph)


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