-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly export ros_gz_bridge for downstream targets (#503)
Signed-off-by: Michael Carroll <[email protected]>
- Loading branch information
Showing
4 changed files
with
117 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
project(test_ros_gz_bridge) | ||
|
||
# Default to C++14 | ||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 17) | ||
endif() | ||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic") | ||
endif() | ||
|
||
find_package(ament_cmake REQUIRED) | ||
find_package(ros_gz_bridge REQUIRED) | ||
|
||
|
||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
ament_lint_auto_find_test_dependencies() | ||
|
||
find_package(ament_cmake_gtest REQUIRED) | ||
find_package(launch_testing_ament_cmake REQUIRED) | ||
ament_find_gtest() | ||
|
||
ament_add_gtest(test_ros_gz_bridge src/test_ros_gz_bridge.cpp) | ||
target_link_libraries(test_ros_gz_bridge ros_gz_bridge::ros_gz_bridge) | ||
endif() | ||
|
||
ament_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>test_ros_gz_bridge</name> | ||
<version>0.246.0</version> | ||
<description>Bridge communication between ROS and Gazebo Transport</description> | ||
<maintainer email="[email protected]">Aditya Pande</maintainer> | ||
<maintainer email="[email protected]">Alejandro Hernandez</maintainer> | ||
|
||
<license>Apache 2.0</license> | ||
|
||
<author>Michael Carroll</author> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
|
||
<depend>ros_gz_bridge</depend> | ||
|
||
<test_depend>ament_cmake_gtest</test_depend> | ||
<test_depend>ament_lint_auto</test_depend> | ||
<test_depend>ament_lint_common</test_depend> | ||
<test_depend>launch_testing_ament_cmake</test_depend> | ||
<test_depend>launch_ros</test_depend> | ||
<test_depend>launch_testing</test_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2024 Open Source Robotics Foundation, Inc. | ||
// | ||
// 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 <gtest/gtest.h> | ||
|
||
#include <ros_gz_bridge/ros_gz_bridge.hpp> | ||
|
||
class test_ros_gz_bridge : public ::testing::Test | ||
{ | ||
public: | ||
static void SetUpTestCase() | ||
{ | ||
rclcpp::init(0, nullptr); | ||
} | ||
|
||
static void TearDownTestCase() | ||
{ | ||
rclcpp::shutdown(); | ||
} | ||
}; | ||
|
||
TEST_F(test_ros_gz_bridge, SpawnNode) | ||
{ | ||
ros_gz_bridge::RosGzBridge node; | ||
} |