From 30d23b9f5694e2e0282644d9ef0643c8e83fa2db Mon Sep 17 00:00:00 2001 From: gaschler Date: Thu, 4 Jan 2018 09:58:52 +0100 Subject: [PATCH] Launch grpc client and server (#641) Adds a launch file to test the entire grpc bridge. Here is an example to run: ``` catkin_make_isolated --use-ninja -DBUILD_GRPC=True source devel_isolated/setup.bash roslaunch cartographer_ros grpc_demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag ``` The bash script is a work-around to run an executable outside of the catkin packages. --- .../cartographer_ros/CMakeLists.txt | 7 +++- .../backpack_2d_server.lua | 19 +++++++++ .../launch/grpc_demo_backpack_2d.launch | 40 +++++++++++++++++++ .../scripts/cartographer_grpc_server.sh | 18 +++++++++ 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 cartographer_ros/configuration_files/backpack_2d_server.lua create mode 100644 cartographer_ros/launch/grpc_demo_backpack_2d.launch create mode 100755 cartographer_ros/scripts/cartographer_grpc_server.sh diff --git a/cartographer_ros/cartographer_ros/CMakeLists.txt b/cartographer_ros/cartographer_ros/CMakeLists.txt index 4750034..be7ae5c 100644 --- a/cartographer_ros/cartographer_ros/CMakeLists.txt +++ b/cartographer_ros/cartographer_ros/CMakeLists.txt @@ -91,7 +91,7 @@ install(TARGETS cartographer_pbstream_to_ros_map RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} ) -# TODO: Add support for shared libary case. +# TODO(cschuet): Add support for shared library case. if (${BUILD_GRPC}) google_binary(cartographer_grpc_node SRCS @@ -103,4 +103,9 @@ if (${BUILD_GRPC}) LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} ) + + install(PROGRAMS + scripts/cartographer_grpc_server.sh + DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} + ) endif() diff --git a/cartographer_ros/configuration_files/backpack_2d_server.lua b/cartographer_ros/configuration_files/backpack_2d_server.lua new file mode 100644 index 0000000..342f1b4 --- /dev/null +++ b/cartographer_ros/configuration_files/backpack_2d_server.lua @@ -0,0 +1,19 @@ +-- 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. + +include "map_builder_server.lua" + +MAP_BUILDER_SERVER.map_builder.use_trajectory_builder_2d = true + +return MAP_BUILDER_SERVER diff --git a/cartographer_ros/launch/grpc_demo_backpack_2d.launch b/cartographer_ros/launch/grpc_demo_backpack_2d.launch new file mode 100644 index 0000000..7fb65d7 --- /dev/null +++ b/cartographer_ros/launch/grpc_demo_backpack_2d.launch @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + diff --git a/cartographer_ros/scripts/cartographer_grpc_server.sh b/cartographer_ros/scripts/cartographer_grpc_server.sh new file mode 100755 index 0000000..fd767b9 --- /dev/null +++ b/cartographer_ros/scripts/cartographer_grpc_server.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# 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. + +set -xe +cartographer_grpc_server $@