Follow googlecartographer/cartographer#339. (#381)
parent
6c85257be8
commit
10edc33253
|
@ -130,18 +130,15 @@ cartographer_ros_msgs::SubmapList MapBuilderBridge::GetSubmapList() {
|
||||||
for (int trajectory_id = 0;
|
for (int trajectory_id = 0;
|
||||||
trajectory_id < map_builder_.num_trajectory_builders();
|
trajectory_id < map_builder_.num_trajectory_builders();
|
||||||
++trajectory_id) {
|
++trajectory_id) {
|
||||||
const cartographer::mapping::Submaps* submaps =
|
auto* const trajectory_builder =
|
||||||
map_builder_.GetTrajectoryBuilder(trajectory_id)->submaps();
|
map_builder_.GetTrajectoryBuilder(trajectory_id);
|
||||||
const int num_submaps =
|
const int num_submaps = trajectory_builder->num_submaps();
|
||||||
map_builder_.sparse_pose_graph()->num_submaps(trajectory_id);
|
|
||||||
cartographer_ros_msgs::TrajectorySubmapList trajectory_submap_list;
|
cartographer_ros_msgs::TrajectorySubmapList trajectory_submap_list;
|
||||||
for (int submap_index = 0; submap_index != num_submaps; ++submap_index) {
|
for (int submap_index = 0; submap_index != num_submaps; ++submap_index) {
|
||||||
cartographer_ros_msgs::SubmapEntry submap_entry;
|
cartographer_ros_msgs::SubmapEntry submap_entry;
|
||||||
submap_entry.submap_version =
|
const auto submap_data = trajectory_builder->GetSubmapData(submap_index);
|
||||||
submaps->Get(submap_index)->num_range_data();
|
submap_entry.submap_version = submap_data.submap->num_range_data();
|
||||||
submap_entry.pose = ToGeometryMsgPose(
|
submap_entry.pose = ToGeometryMsgPose(submap_data.pose);
|
||||||
map_builder_.sparse_pose_graph()->GetSubmapTransform(
|
|
||||||
::cartographer::mapping::SubmapId{trajectory_id, submap_index}));
|
|
||||||
trajectory_submap_list.submap.push_back(submap_entry);
|
trajectory_submap_list.submap.push_back(submap_entry);
|
||||||
}
|
}
|
||||||
submap_list.trajectory.push_back(trajectory_submap_list);
|
submap_list.trajectory.push_back(trajectory_submap_list);
|
||||||
|
|
Loading…
Reference in New Issue