|
1 | 1 | diff --git a/ros_gz_sim/CMakeLists.txt b/ros_gz_sim/CMakeLists.txt
|
2 |
| -index dc8deb03..ec6ac678 100644 |
| 2 | +index 9f7f956..86ef3e4 100644 |
3 | 3 | --- a/ros_gz_sim/CMakeLists.txt
|
4 | 4 | +++ b/ros_gz_sim/CMakeLists.txt
|
5 |
| -@@ -12,3 +12,4 @@ endif() |
6 |
| -+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) |
| 5 | +@@ -11,6 +11,9 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
| 6 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic") |
| 7 | + endif() |
7 | 8 |
|
| 9 | ++set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) |
| 10 | ++ |
| 11 | ++ |
| 12 | + find_package(CLI11 REQUIRED) |
8 | 13 | find_package(ament_cmake REQUIRED)
|
9 |
| - find_package(rclcpp REQUIRED) |
| 14 | + find_package(builtin_interfaces REQUIRED) |
| 15 | +diff --git a/ros_gz_sim/launch/gz_sim.launch.py.in b/ros_gz_sim/launch/gz_sim.launch.py.in |
| 16 | +index 359e9d1..6a06642 100644 |
| 17 | +--- a/ros_gz_sim/launch/gz_sim.launch.py.in |
| 18 | ++++ b/ros_gz_sim/launch/gz_sim.launch.py.in |
| 19 | +@@ -16,6 +16,7 @@ |
| 20 | + |
| 21 | + import os |
| 22 | + from os import environ |
| 23 | ++import shutil |
| 24 | + |
| 25 | + from ament_index_python.packages import get_package_share_directory |
| 26 | + from catkin_pkg.package import InvalidPackage, PACKAGE_MANIFEST_FILENAME, parse_package |
| 27 | +@@ -77,6 +78,12 @@ class GazeboRosPaths: |
| 28 | + |
| 29 | + return gazebo_model_path, gazebo_plugin_path |
| 30 | + |
| 31 | ++def get_executable_path(command): |
| 32 | ++ path = shutil.which(command) |
| 33 | ++ if path.lower().endswith('.bat'): |
| 34 | ++ return os.path.splitext(path)[0] |
| 35 | ++ return path |
| 36 | ++ |
| 37 | + def launch_gz(context, *args, **kwargs): |
| 38 | + model_paths, plugin_paths = GazeboRosPaths.get_paths() |
| 39 | + |
| 40 | +@@ -111,12 +118,12 @@ def launch_gz(context, *args, **kwargs): |
| 41 | + exec_args = gz_args |
| 42 | + |
| 43 | + if len(ign_version) or (ign_version == '' and int(gz_version) < 7): |
| 44 | +- exec = 'ruby $(which ign) gazebo' |
| 45 | ++ exec = 'ruby ' + get_executable_path('ign') + ' gazebo' |
| 46 | + |
| 47 | + if len(ign_version): |
| 48 | + gz_version = ign_version |
| 49 | + else: |
| 50 | +- exec = 'ruby $(which gz) sim' |
| 51 | ++ exec = 'ruby ' + get_executable_path('gz') + ' sim' |
| 52 | + |
| 53 | + if debugger != 'false': |
| 54 | + debug_prefix = 'x-terminal-emulator -e gdb -ex run --args' |
0 commit comments