Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RB-1640] Add config option to invert base_link to map tf #3

Open
wants to merge 82 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
dc16d9d
Improve internal naming of local SLAM data. (#908)
MichaelGrupp Jun 25, 2018
ccf0158
Use PoseGraphInterface::TrajectoryState from libcartographer (#910)
MichaelGrupp Jun 29, 2018
7e19973
Discard proto data in pbstream_map_publisher via RAII. (#912)
MichaelGrupp Jun 29, 2018
2503058
Allow to ignore (un-)frozen submaps in the occupancy grid node. (#899)
MichaelGrupp Jun 29, 2018
2886960
Add internal metric families. (#914)
MichaelGrupp Jul 2, 2018
e5acc72
Use new pure localization trimmer options. (#918)
pifon2a Jul 3, 2018
d275f7f
Register internal metrics and provide a public interface. (#917)
MichaelGrupp Jul 4, 2018
894b000
Minor grammar fix. (#900)
davetcoleman Jul 5, 2018
da01a22
Update msg_conversion.cc (#925)
ojura Jul 6, 2018
b7f7347
Fix bug in FinishTrajectory logic (#926)
sebastianklose Jul 6, 2018
c751f40
Use 'landmarks' instead of 'landmark'. (#931)
pifon2a Jul 9, 2018
89116f1
Allow zero pose_publish_period (#933)
gaschler Jul 10, 2018
44a1133
List files explicitly in cartographer_ros_msgs/CMakeLists.txt (#927)
MichaelGrupp Jul 10, 2018
b414d21
Follow googlecartographer/cartographer#1241 (#923)
Jul 10, 2018
79f9748
remove unused declaration (#934)
gaschler Jul 11, 2018
486a605
Simplify gauge and histogram implementation. (#922)
MichaelGrupp Jul 12, 2018
5b80e0a
Warn for possible topic mismatch (#935)
gaschler Jul 12, 2018
e036d62
Introduce value converter tables. (#937)
Jul 12, 2018
b192c65
Add .clang-format file. (#938)
wohe Jul 13, 2018
a9abab7
Move conversion table to LoadOccupancyGridMap. (#941)
Jul 14, 2018
cfefe1d
Get rid of std::bind. (#939)
wohe Jul 14, 2018
a28503a
Add option to disable PoseExtrapolator (#946)
gaschler Jul 19, 2018
e02775c
Fix pbstream exporting binaries (#945)
Jul 19, 2018
4b3aae1
Update docs of ROS API. (#928)
MichaelGrupp Jul 25, 2018
8c650c6
Follow the CMake update. (#951)
pifon2a Jul 26, 2018
e74f6f1
Follow the Absl update. (#955)
pifon2a Jul 28, 2018
288beea
Follow googlecartographer/cartographer#1352 (#957)
Jul 30, 2018
4e663f8
Follow googlecartographer/cartographer#1353 (#959)
gaschler Jul 31, 2018
7c87c86
Add include_unfinished_submaps parameter to SerializeState() (#966)
MichaelGrupp Aug 2, 2018
05ecc31
[ABSL] Use absl::Mutex. (#969)
pifon2a Aug 7, 2018
86cc960
Adding option to launch without rviz, similar to 2d case (#972)
sebastianklose Aug 8, 2018
0fad1ab
Follow cartographer#1357 (#964)
ojura Aug 13, 2018
26907a5
Adding generic parametrizable offline_node.launch (#983)
sebastianklose Aug 27, 2018
bea4c26
Removing unless from argument (#994)
sebastianklose Aug 28, 2018
38844ac
Add --load_frozen_state to node_grpc_main.cc (#973)
MichaelGrupp Aug 29, 2018
bb4d37d
Disable forwarding proto stream by default in node_grpc_main.cc (#1013)
MichaelGrupp Sep 13, 2018
7553b34
Add toggle for pose markers to submaps display RViz plugin. (#1012)
MichaelGrupp Sep 13, 2018
041fc63
Follow googlecartographer/cartographer#1424 (#1014)
Sep 19, 2018
3c5e813
Fix submap pose marker toggling. (#1019)
MichaelGrupp Sep 19, 2018
2967d9d
Introduce base image for melodic to speed up CI (#1021)
Sep 26, 2018
91ac40a
feat: Publish progress of processing the bagfile (#940)
alireza-hosseini Sep 27, 2018
5186dbb
Replace custom SplitString() by absl::StrSplit() (#1026)
MichaelGrupp Sep 27, 2018
e87e153
Work around wstool bug in build with Docker base image. (#1041)
MichaelGrupp Oct 4, 2018
5cf1a13
Use absl::SkipEmpty() predicate. (#1042)
MichaelGrupp Oct 4, 2018
ec75808
fix: Use an explicit message_counter instead of using `std::distance`…
alireza-hosseini Oct 9, 2018
2fb51e2
Only use ROS log sink in pbstream_map_publisher_main.cc (#1040)
MichaelGrupp Oct 15, 2018
82113e1
Adding launch file arg for launch-prefix to offline nodes (#1066)
sebastianklose Oct 17, 2018
3fce044
move metrics messages at root of msg folder (#1020)
mikaelarguedas Oct 17, 2018
48f699b
Fix Clang thread-safety warning. (#1068)
MichaelGrupp Oct 19, 2018
597c6e2
Remove deleted trajectories from submaps display. (#1065)
MichaelGrupp Oct 19, 2018
5b5d720
Decrease asset writer progress log period (#1044)
ojura Oct 19, 2018
0b72865
docs: Add documentation related to `bagfile_progress` publisher (#1039)
alireza-hosseini Oct 19, 2018
5c7a379
Remove orphaned function in occupancy_grid_node_main.cc (#1034)
MichaelGrupp Oct 19, 2018
3cc89f3
Transform landmark poses to the tracking frame. (#1076)
pifon2a Oct 25, 2018
5d12bce
Add landmarks demo to the docs. (#1077)
pifon2a Oct 25, 2018
dd6f61b
Add a script for testing with fake landmarks to scripts/dev (#1071)
MichaelGrupp Oct 30, 2018
b6857d4
Rework the documentation as a step-by-step guide (#952)
FlorentRevest Nov 5, 2018
689027b
Update /write_state call in assets writer docs. (#1087)
MichaelGrupp Nov 6, 2018
18741bb
Only include correct source files in cmake (#1085)
redkite Nov 6, 2018
393a167
Consider waiting trajectories with a sensor bridge as active. (#1089)
MichaelGrupp Nov 6, 2018
67cea54
Add git dependency to package.xml (for Abseil build). (#1098)
MichaelGrupp Nov 14, 2018
f862b06
Configurable frame IDs in trajectory_comparison_main.cc (#1120)
MichaelGrupp Dec 6, 2018
54550a6
fixing compilation under OSX (#1126)
sebastianklose Dec 12, 2018
df31de0
Windows build & Azure CI (#1103)
ojura Dec 17, 2018
833b396
Don't run final optimization in visualize_pbstream.launch (#1157)
MichaelGrupp Jan 16, 2019
50bf25f
Fix typo (#1130)
esteve Jan 16, 2019
3497a23
Publish one last progress message when PlayableBag is finished. (#1160)
MichaelGrupp Jan 18, 2019
8b6ace1
Tool for extracting pbstream trajectories into bag with tf. (#1166)
sebastianklose Jan 20, 2019
39bf1e4
Fixed wrong Topic name for Landmarks (#1171)
fprott Jan 30, 2019
681ab61
Fix segfault by changing the destruction order. (#1235)
MichaelGrupp Mar 26, 2019
45fb275
Replace a few string operator+ by absl::StrCat(). (#1244)
MichaelGrupp Apr 2, 2019
cbc12d4
Extend trajectory export tool to write TransformStamped topics. (#1169)
MichaelGrupp Apr 2, 2019
51408aa
Landmarks note (#1242)
fprott Apr 3, 2019
885de83
Expanded Landmarks documentation (#1241)
fprott Apr 3, 2019
524e256
Update clang-format to new Google style. (#1260)
MichaelGrupp Apr 10, 2019
8383af4
Unify trajectory state checks for service handlers. (#1262)
MichaelGrupp Apr 15, 2019
6e40d15
Updated doc to remove abseil-cpp from ROS (#1211)
ashnarayan13 Apr 17, 2019
f6a1c97
Add explicit --save_state_filename to offline node options. (#1204)
MichaelGrupp Apr 17, 2019
0e72b2d
Service to query trajectory segments from the pose graph. (#1222)
MichaelGrupp Apr 23, 2019
458b285
Simplify start_trajectory service (RFC-28) (#1245)
mgladkova May 7, 2019
dc8fcf4
Update ROS API documentation with description of changed/new services…
mgladkova Jul 9, 2019
45c4247
[RB-1640] Add config option to invert base_link to map tf
Aug 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions Dockerfile.base.melodic
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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.

FROM ros:melodic

ARG CARTOGRAPHER_VERSION=master

# Bionic's base image doesn't ship with sudo.
RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*

# First, we invalidate the entire cache if googlecartographer/cartographer has
# changed. This file's content changes whenever master changes. See:
# http://stackoverflow.com/questions/36996046/how-to-prevent-dockerfile-caching-git-clone
ADD https://api.github.com/repos/googlecartographer/cartographer/git/refs/heads/master \
cartographer_ros/cartographer_version.json

# wstool needs the updated rosinstall file to clone the correct repos.
COPY cartographer_ros.rosinstall cartographer_ros/
COPY scripts/prepare_catkin_workspace.sh cartographer_ros/scripts/
RUN CARTOGRAPHER_VERSION=$CARTOGRAPHER_VERSION \
cartographer_ros/scripts/prepare_catkin_workspace.sh

# rosdep needs the updated package.xml files to install the correct debs.
COPY cartographer_ros/package.xml catkin_ws/src/cartographer_ros/cartographer_ros/
COPY cartographer_ros_msgs/package.xml catkin_ws/src/cartographer_ros/cartographer_ros_msgs/
COPY cartographer_rviz/package.xml catkin_ws/src/cartographer_ros/cartographer_rviz/
COPY scripts/install_debs.sh cartographer_ros/scripts/
RUN cartographer_ros/scripts/install_debs.sh && rm -rf /var/lib/apt/lists/*

# Install proto3.
RUN /catkin_ws/src/cartographer/scripts/install_proto3.sh

9 changes: 3 additions & 6 deletions Dockerfile.melodic
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ros:melodic
FROM eu.gcr.io/cartographer-141408/cartographer_ros_melodic_base

ARG CARTOGRAPHER_VERSION=master

Expand All @@ -30,9 +30,9 @@ ADD https://api.github.com/repos/googlecartographer/cartographer/git/refs/heads/

# wstool needs the updated rosinstall file to clone the correct repos.
COPY cartographer_ros.rosinstall cartographer_ros/
COPY scripts/prepare_catkin_workspace.sh cartographer_ros/scripts/
COPY scripts/update_catkin_workspace.sh cartographer_ros/scripts/
RUN CARTOGRAPHER_VERSION=$CARTOGRAPHER_VERSION \
cartographer_ros/scripts/prepare_catkin_workspace.sh
cartographer_ros/scripts/update_catkin_workspace.sh

# rosdep needs the updated package.xml files to install the correct debs.
COPY cartographer_ros/package.xml catkin_ws/src/cartographer_ros/cartographer_ros/
Expand All @@ -41,9 +41,6 @@ COPY cartographer_rviz/package.xml catkin_ws/src/cartographer_ros/cartographer_r
COPY scripts/install_debs.sh cartographer_ros/scripts/
RUN cartographer_ros/scripts/install_debs.sh && rm -rf /var/lib/apt/lists/*

# Install proto3.
RUN /catkin_ws/src/cartographer/scripts/install_proto3.sh

# Build, install, and test all packages individually to allow caching. The
# ordering of these steps must match the topological package ordering as
# determined by Catkin.
Expand Down
70 changes: 70 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# 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.

jobs:
- job: Build
pool:
vmImage: 'vs2017-win2016'
timeoutInMinutes: 360
steps:
- script: |
choco sources add -n=roswin -s https://roswin.azurewebsites.net/api/v2/ --priority 1
rem Azure VM runs out of space on C:, so use D: for ros and rosdeps
mkdir D:\opt && mklink /J C:\opt D:\opt
choco upgrade %ROS_METAPACKAGE% -y
choco upgrade ros-melodic-perception -y
robocopy "." ".\src\cartographer_ros" /E /MOVE /XD "src" > NUL
git clone https://github.com/googlecartographer/cartographer src\cartographer
call "C:\opt\ros\melodic\x64\env.bat" rosdep install --from-paths src --ignore-src -r -y
env:
ROS_METAPACKAGE: 'ros-melodic-desktop'
displayName: Install prerequisites

- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
call "C:\opt\ros\melodic\x64\setup.bat"
call src\cartographer\scripts\remove_mingw_cygwin_from_path.bat
catkin_make_isolated --use-ninja --install --cmake-args -DCMAKE_BUILD_TYPE=Release
displayName: Build

- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
call "C:\opt\ros\melodic\x64\setup.bat"
call src\cartographer\scripts\remove_mingw_cygwin_from_path.bat
cd build_isolated\cartographer\install && ctest --no-compress-output -T Test
displayName: Run cartographer tests

- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
call "C:\opt\ros\melodic\x64\setup.bat"
call src\cartographer\scripts\remove_mingw_cygwin_from_path.bat
cd build_isolated\cartographer_ros && ninja tests && ctest --no-compress-output -T Test
displayName: Build and run cartographer_ros tests
condition: always()

- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
call "C:\opt\ros\melodic\x64\setup.bat"
call src\cartographer\scripts\remove_mingw_cygwin_from_path.bat
python src\cartographer\scripts\ctest_to_junit.py build_isolated\cartographer_ros
displayName: Convert tests to jUnit
condition: always()

- task: PublishTestResults@2
displayName: Publish test results
inputs:
testRunner: 'jUnit'
testResultsFiles: '**\jUnit.xml'
searchFolder: '$(Build.SourcesDirectory)\build_isolated\cartographer_ros\Testing'
condition: always()
28 changes: 20 additions & 8 deletions cartographer_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,18 @@ set(PACKAGE_DEPENDENCIES
visualization_msgs
)

if(WIN32)
set(Boost_USE_STATIC_LIBS FALSE)
endif()
# For yet unknown reason, if Boost is find_packaged() after find_package(cartographer),
# some Boost libraries including Thread are set to static, despite Boost_USE_STATIC_LIBS,
# which causes linking problems on windows due to shared/static Thread clashing.
# PCL also finds Boost. Work around by moving before find_package(cartographer).
find_package(Boost REQUIRED COMPONENTS system iostreams)
find_package(PCL REQUIRED COMPONENTS common)

find_package(cartographer REQUIRED)
include("${CARTOGRAPHER_CMAKE_DIR}/functions.cmake")
set(BUILD_SHARED_LIBS OFF)
option(BUILD_GRPC "build features that require Cartographer gRPC support" false)
google_initialize_cartographer_project()
google_enable_testing()
Expand All @@ -46,10 +55,9 @@ find_package(catkin REQUIRED COMPONENTS ${PACKAGE_DEPENDENCIES})

include(FindPkgConfig)

find_package(Abseil REQUIRED)
find_package(LuaGoogle REQUIRED)
find_package(PCL REQUIRED COMPONENTS common)
find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS system iostreams)

find_package(urdfdom_headers REQUIRED)
if(DEFINED urdfdom_headers_VERSION)
Expand Down Expand Up @@ -82,9 +90,9 @@ catkin_package(
LIBRARIES ${PROJECT_NAME}
)

file(GLOB_RECURSE ALL_SRCS "*.cc" "*.h")
file(GLOB_RECURSE ALL_TESTS "*_test.cc")
file(GLOB_RECURSE ALL_EXECUTABLES "*_main.cc")
file(GLOB_RECURSE ALL_SRCS "cartographer_ros/*.cc" "cartographer_ros/*.h")
file(GLOB_RECURSE ALL_TESTS "cartographer_ros/*_test.cc")
file(GLOB_RECURSE ALL_EXECUTABLES "cartographer_ros/*_main.cc")
file(GLOB_RECURSE ALL_GRPC_FILES "cartographer_ros/cartographer_grpc/*")
list(REMOVE_ITEM ALL_SRCS ${ALL_TESTS})
list(REMOVE_ITEM ALL_SRCS ${ALL_EXECUTABLES})
Expand All @@ -93,7 +101,7 @@ if (NOT ${BUILD_GRPC})
list(REMOVE_ITEM ALL_TESTS ${ALL_GRPC_FILES})
list(REMOVE_ITEM ALL_EXECUTABLES ${ALL_GRPC_FILES})
endif()
add_library(${PROJECT_NAME} ${ALL_SRCS})
add_library(${PROJECT_NAME} STATIC ${ALL_SRCS})
add_subdirectory("cartographer_ros")

target_link_libraries(${PROJECT_NAME} PUBLIC cartographer)
Expand Down Expand Up @@ -153,6 +161,10 @@ if (CATKIN_ENABLE_TESTING)
target_link_libraries(${TEST_NAME} cartographer)
target_link_libraries(${TEST_NAME} ${PROJECT_NAME})
set_target_properties(${TEST_NAME} PROPERTIES COMPILE_FLAGS ${TARGET_COMPILE_FLAGS})
# Needed for dynamically linked GTest on Windows.
if (WIN32)
target_compile_definitions(${TEST_NAME} PUBLIC -DGTEST_LINKED_AS_SHARED_LIBRARY)
endif()
endforeach()
endif()

Expand All @@ -171,7 +183,7 @@ install(TARGETS ${PROJECT_NAME}
)

# Install source headers.
file(GLOB_RECURSE HDRS "*.h")
file(GLOB_RECURSE HDRS "cartographer_ros/*.h")
foreach(HDR ${HDRS})
file(RELATIVE_PATH REL_FIL ${PROJECT_SOURCE_DIR} ${HDR})
get_filename_component(INSTALL_DIR ${REL_FIL} DIRECTORY)
Expand Down
2 changes: 2 additions & 0 deletions cartographer_ros/cartographer_ros/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BasedOnStyle: Google
DerivePointerAlignment: false
22 changes: 11 additions & 11 deletions cartographer_ros/cartographer_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,6 @@ install(TARGETS cartographer_offline_node
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

google_binary(cartographer_start_trajectory
SRCS
start_trajectory_main.cc
)

install(TARGETS cartographer_start_trajectory
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

google_binary(cartographer_occupancy_grid_node
SRCS
occupancy_grid_node_main.cc
Expand Down Expand Up @@ -102,6 +91,17 @@ install(TARGETS cartographer_pbstream_map_publisher
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

google_binary(cartographer_dev_pbstream_trajectories_to_rosbag
SRCS
dev/pbstream_trajectories_to_rosbag_main.cc
)

install(TARGETS cartographer_dev_pbstream_trajectories_to_rosbag
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

google_binary(cartographer_dev_rosbag_publisher
SRCS
dev/rosbag_publisher_main.cc
Expand Down
25 changes: 12 additions & 13 deletions cartographer_ros/cartographer_ros/assets_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include <fstream>
#include <iostream>

#include "absl/memory/memory.h"
#include "cartographer/common/configuration_file_resolver.h"
#include "cartographer/common/make_unique.h"
#include "cartographer/common/math.h"
#include "cartographer/io/file_writer.h"
#include "cartographer/io/points_processor.h"
Expand All @@ -35,7 +35,6 @@
#include "cartographer/transform/transform_interpolation_buffer.h"
#include "cartographer_ros/msg_conversion.h"
#include "cartographer_ros/ros_map_writing_points_processor.h"
#include "cartographer_ros/split_string.h"
#include "cartographer_ros/time_conversion.h"
#include "cartographer_ros/urdf_reader.h"
#include "gflags/gflags.h"
Expand All @@ -61,8 +60,7 @@ CreatePipelineBuilder(
const std::string file_prefix) {
const auto file_writer_factory =
AssetsWriter::CreateFileWriterFactory(file_prefix);
auto builder =
carto::common::make_unique<carto::io::PointsProcessorPipelineBuilder>();
auto builder = absl::make_unique<carto::io::PointsProcessorPipelineBuilder>();
carto::io::RegisterBuiltInPointsProcessors(trajectories, file_writer_factory,
builder.get());
builder->Register(RosMapWritingPointsProcessor::kConfigurationFileActionName,
Expand All @@ -80,13 +78,13 @@ std::unique_ptr<carto::common::LuaParameterDictionary> LoadLuaDictionary(
const std::string& configuration_directory,
const std::string& configuration_basename) {
auto file_resolver =
carto::common::make_unique<carto::common::ConfigurationFileResolver>(
absl::make_unique<carto::common::ConfigurationFileResolver>(
std::vector<std::string>{configuration_directory});

const std::string code =
file_resolver->GetFileContentOrDie(configuration_basename);
auto lua_parameter_dictionary =
carto::common::make_unique<carto::common::LuaParameterDictionary>(
absl::make_unique<carto::common::LuaParameterDictionary>(
code, std::move(file_resolver));
return lua_parameter_dictionary;
}
Expand All @@ -99,7 +97,7 @@ std::unique_ptr<carto::io::PointsBatch> HandleMessage(
transform_interpolation_buffer) {
const carto::common::Time start_time = FromRos(message.header.stamp);

auto points_batch = carto::common::make_unique<carto::io::PointsBatch>();
auto points_batch = absl::make_unique<carto::io::PointsBatch>();
points_batch->start_time = start_time;
points_batch->frame_id = message.header.frame_id;

Expand All @@ -111,7 +109,8 @@ std::unique_ptr<carto::io::PointsBatch> HandleMessage(

for (size_t i = 0; i < point_cloud.points.size(); ++i) {
const carto::common::Time time =
point_cloud_time + carto::common::FromSeconds(point_cloud.points[i][3]);
point_cloud_time +
carto::common::FromSeconds(point_cloud.points[i].time);
if (!transform_interpolation_buffer.Has(time)) {
continue;
}
Expand All @@ -122,8 +121,9 @@ std::unique_ptr<carto::io::PointsBatch> HandleMessage(
tracking_frame, message.header.frame_id, ToRos(time)));
const carto::transform::Rigid3f sensor_to_map =
(tracking_to_map * sensor_to_tracking).cast<float>();
points_batch->points.push_back(sensor_to_map *
point_cloud.points[i].head<3>());
points_batch->points.push_back(
sensor_to_map *
carto::sensor::ToRangefinderPoint(point_cloud.points[i]));
points_batch->intensities.push_back(point_cloud.intensities[i]);
// We use the last transform for the origin, which is approximately correct.
points_batch->origin = sensor_to_map * Eigen::Vector3f::Zero();
Expand Down Expand Up @@ -251,7 +251,7 @@ void AssetsWriter::Run(const std::string& configuration_directory,
delayed_messages.pop_front();
}
delayed_messages.push_back(message);
LOG_EVERY_N(INFO, 100000)
LOG_EVERY_N(INFO, 10000)
<< "Processed " << (message.getTime() - begin_time).toSec()
<< " of " << duration_in_seconds << " bag time seconds...";
}
Expand All @@ -264,8 +264,7 @@ void AssetsWriter::Run(const std::string& configuration_directory,
::cartographer::io::FileWriterFactory AssetsWriter::CreateFileWriterFactory(
const std::string& file_path) {
const auto file_writer_factory = [file_path](const std::string& filename) {
return carto::common::make_unique<carto::io::StreamFileWriter>(file_path +
filename);
return absl::make_unique<carto::io::StreamFileWriter>(file_path + filename);
};
return file_writer_factory;
}
Expand Down
4 changes: 2 additions & 2 deletions cartographer_ros/cartographer_ros/assets_writer_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

#include "absl/strings/str_split.h"
#include "cartographer_ros/assets_writer.h"
#include "cartographer_ros/split_string.h"
#include "gflags/gflags.h"
#include "glog/logging.h"

Expand Down Expand Up @@ -56,7 +56,7 @@ int main(int argc, char** argv) {

::cartographer_ros::AssetsWriter asset_writer(
FLAGS_pose_graph_filename,
cartographer_ros::SplitString(FLAGS_bag_filenames, ','),
absl::StrSplit(FLAGS_bag_filenames, ',', absl::SkipEmpty()),
FLAGS_output_file_prefix);

asset_writer.Run(FLAGS_configuration_directory, FLAGS_configuration_basename,
Expand Down
Loading