This commit is contained in:
2025-08-28 16:24:24 +08:00
parent d7d6c00443
commit dff540e2bb
495 changed files with 66690 additions and 319 deletions

View File

@@ -0,0 +1,14 @@
# generated from ament/cmake/core/templates/nameConfig-version.cmake.in
set(PACKAGE_VERSION "0.0.0")
set(PACKAGE_VERSION_EXACT False)
set(PACKAGE_VERSION_COMPATIBLE False)
if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}")
set(PACKAGE_VERSION_EXACT True)
set(PACKAGE_VERSION_COMPATIBLE True)
endif()
if("${PACKAGE_FIND_VERSION}" VERSION_LESS "${PACKAGE_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE True)
endif()

View File

@@ -0,0 +1,42 @@
# generated from ament/cmake/core/templates/nameConfig.cmake.in
# prevent multiple inclusion
if(_drone_interfaces_CONFIG_INCLUDED)
# ensure to keep the found flag the same
if(NOT DEFINED drone_interfaces_FOUND)
# explicitly set it to FALSE, otherwise CMake will set it to TRUE
set(drone_interfaces_FOUND FALSE)
elseif(NOT drone_interfaces_FOUND)
# use separate condition to avoid uninitialized variable warning
set(drone_interfaces_FOUND FALSE)
endif()
return()
endif()
set(_drone_interfaces_CONFIG_INCLUDED TRUE)
# output package information
if(NOT drone_interfaces_FIND_QUIETLY)
message(STATUS "Found drone_interfaces: 0.0.0 (${drone_interfaces_DIR})")
endif()
# warn when using a deprecated package
if(NOT "" STREQUAL "")
set(_msg "Package 'drone_interfaces' is deprecated")
# append custom deprecation text if available
if(NOT "" STREQUAL "TRUE")
set(_msg "${_msg} ()")
endif()
# optionally quiet the deprecation message
if(NOT ${drone_interfaces_DEPRECATED_QUIET})
message(DEPRECATION "${_msg}")
endif()
endif()
# flag package as ament-based to distinguish it after being find_package()-ed
set(drone_interfaces_FOUND_AMENT_PACKAGE TRUE)
# include all config extra files
set(_extras "rosidl_cmake-extras.cmake;ament_cmake_export_dependencies-extras.cmake;ament_cmake_export_include_directories-extras.cmake;ament_cmake_export_libraries-extras.cmake;ament_cmake_export_targets-extras.cmake;rosidl_cmake_export_typesupport_targets-extras.cmake;rosidl_cmake_export_typesupport_libraries-extras.cmake")
foreach(_extra ${_extras})
include("${drone_interfaces_DIR}/${_extra}")
endforeach()

View File

@@ -0,0 +1,13 @@
set(_AMENT_PACKAGE_NAME "drone_interfaces")
set(drone_interfaces_VERSION "0.0.0")
set(drone_interfaces_MAINTAINER "user <user@todo.todo>")
set(drone_interfaces_BUILD_DEPENDS "rosidl_default_generators")
set(drone_interfaces_BUILDTOOL_DEPENDS "ament_cmake")
set(drone_interfaces_BUILD_EXPORT_DEPENDS )
set(drone_interfaces_BUILDTOOL_EXPORT_DEPENDS )
set(drone_interfaces_EXEC_DEPENDS "rosidl_default_runtime")
set(drone_interfaces_TEST_DEPENDS )
set(drone_interfaces_GROUP_DEPENDS )
set(drone_interfaces_MEMBER_OF_GROUPS "rosidl_interface_packages")
set(drone_interfaces_DEPRECATED "")
set(drone_interfaces_EXPORT_TAGS)

View File

@@ -0,0 +1,10 @@
# Goal definition
string py_tree_json
---
# Result definition
bool success
string message
---
# Feedback definition
string node_id
int32 status # 0: RUNNING, 1: SUCCESS, 2: FAILURE

View File

@@ -0,0 +1,92 @@
# generated from ament_cmake_export_dependencies/cmake/ament_cmake_export_dependencies-extras.cmake.in
set(_exported_dependencies "action_msgs;rosidl_runtime_c;rosidl_typesupport_interface;rcutils;fastrtps_cmake_module;fastcdr;rosidl_runtime_c;rosidl_runtime_cpp;rosidl_typesupport_fastrtps_c;rosidl_typesupport_fastrtps_cpp;rosidl_typesupport_interface;rosidl_runtime_c;rosidl_typesupport_c;rosidl_typesupport_interface;rosidl_runtime_cpp;fastrtps_cmake_module;fastcdr;rmw;rosidl_runtime_c;rosidl_runtime_cpp;rosidl_typesupport_fastrtps_cpp;rosidl_typesupport_interface;rosidl_runtime_c;rosidl_runtime_cpp;rosidl_typesupport_c;rosidl_typesupport_cpp;rosidl_typesupport_interface")
find_package(ament_cmake_libraries QUIET REQUIRED)
# find_package() all dependencies
# and append their DEFINITIONS INCLUDE_DIRS, LIBRARIES, and LINK_FLAGS
# variables to drone_interfaces_DEFINITIONS, drone_interfaces_INCLUDE_DIRS,
# drone_interfaces_LIBRARIES, and drone_interfaces_LINK_FLAGS.
# Additionally collect the direct dependency names in
# drone_interfaces_DEPENDENCIES as well as the recursive dependency names
# in drone_interfaces_RECURSIVE_DEPENDENCIES.
if(NOT _exported_dependencies STREQUAL "")
find_package(ament_cmake_core QUIET REQUIRED)
set(drone_interfaces_DEPENDENCIES ${_exported_dependencies})
set(drone_interfaces_RECURSIVE_DEPENDENCIES ${_exported_dependencies})
set(_libraries)
foreach(_dep ${_exported_dependencies})
if(NOT ${_dep}_FOUND)
find_package("${_dep}" QUIET REQUIRED)
endif()
# if a package provides modern CMake interface targets use them
# exclusively assuming the classic CMake variables only exist for
# backward compatibility
set(use_modern_cmake FALSE)
if(NOT "${${_dep}_TARGETS}" STREQUAL "")
foreach(_target ${${_dep}_TARGETS})
# only use actual targets
# in case a package uses this variable for other content
if(TARGET "${_target}")
get_target_property(_include_dirs ${_target} INTERFACE_INCLUDE_DIRECTORIES)
if(_include_dirs)
list_append_unique(drone_interfaces_INCLUDE_DIRS "${_include_dirs}")
endif()
get_target_property(_imported_configurations ${_target} IMPORTED_CONFIGURATIONS)
if(_imported_configurations)
string(TOUPPER "${_imported_configurations}" _imported_configurations)
if(DEBUG_CONFIGURATIONS)
string(TOUPPER "${DEBUG_CONFIGURATIONS}" _debug_configurations_uppercase)
else()
set(_debug_configurations_uppercase "DEBUG")
endif()
foreach(_imported_config ${_imported_configurations})
get_target_property(_imported_implib ${_target} IMPORTED_IMPLIB_${_imported_config})
if(_imported_implib)
set(_imported_implib_config "optimized")
if(${_imported_config} IN_LIST _debug_configurations_uppercase)
set(_imported_implib_config "debug")
endif()
list(APPEND _libraries ${_imported_implib_config} ${_imported_implib})
else()
get_target_property(_imported_location ${_target} IMPORTED_LOCATION_${_imported_config})
if(_imported_location)
list(APPEND _libraries "${_imported_location}")
endif()
endif()
endforeach()
endif()
get_target_property(_link_libraries ${_target} INTERFACE_LINK_LIBRARIES)
if(_link_libraries)
list(APPEND _libraries "${_link_libraries}")
endif()
set(use_modern_cmake TRUE)
endif()
endforeach()
endif()
if(NOT use_modern_cmake)
if(${_dep}_DEFINITIONS)
list_append_unique(drone_interfaces_DEFINITIONS "${${_dep}_DEFINITIONS}")
endif()
if(${_dep}_INCLUDE_DIRS)
list_append_unique(drone_interfaces_INCLUDE_DIRS "${${_dep}_INCLUDE_DIRS}")
endif()
if(${_dep}_LIBRARIES)
list(APPEND _libraries "${${_dep}_LIBRARIES}")
endif()
if(${_dep}_LINK_FLAGS)
list_append_unique(drone_interfaces_LINK_FLAGS "${${_dep}_LINK_FLAGS}")
endif()
if(${_dep}_RECURSIVE_DEPENDENCIES)
list_append_unique(drone_interfaces_RECURSIVE_DEPENDENCIES "${${_dep}_RECURSIVE_DEPENDENCIES}")
endif()
endif()
if(_libraries)
ament_libraries_deduplicate(_libraries "${_libraries}")
list(APPEND drone_interfaces_LIBRARIES "${_libraries}")
endif()
endforeach()
endif()

View File

@@ -0,0 +1,16 @@
# generated from ament_cmake_export_include_directories/cmake/ament_cmake_export_include_directories-extras.cmake.in
set(_exported_include_dirs "${drone_interfaces_DIR}/../../../include/drone_interfaces")
# append include directories to drone_interfaces_INCLUDE_DIRS
# warn about not existing paths
if(NOT _exported_include_dirs STREQUAL "")
find_package(ament_cmake_core QUIET REQUIRED)
foreach(_exported_include_dir ${_exported_include_dirs})
if(NOT IS_DIRECTORY "${_exported_include_dir}")
message(WARNING "Package 'drone_interfaces' exports the include directory '${_exported_include_dir}' which doesn't exist")
endif()
normalize_path(_exported_include_dir "${_exported_include_dir}")
list(APPEND drone_interfaces_INCLUDE_DIRS "${_exported_include_dir}")
endforeach()
endif()

View File

@@ -0,0 +1,141 @@
# generated from ament_cmake_export_libraries/cmake/template/ament_cmake_export_libraries.cmake.in
set(_exported_libraries "drone_interfaces__rosidl_generator_c;drone_interfaces__rosidl_typesupport_c;drone_interfaces__rosidl_typesupport_cpp")
set(_exported_library_names "")
# populate drone_interfaces_LIBRARIES
if(NOT _exported_libraries STREQUAL "")
# loop over libraries, either target names or absolute paths
list(LENGTH _exported_libraries _length)
set(_i 0)
while(_i LESS _length)
list(GET _exported_libraries ${_i} _arg)
# pass linker flags along
if("${_arg}" MATCHES "^-" AND NOT "${_arg}" MATCHES "^-[l|framework]")
list(APPEND drone_interfaces_LIBRARIES "${_arg}")
math(EXPR _i "${_i} + 1")
continue()
endif()
if("${_arg}" MATCHES "^(debug|optimized|general)$")
# remember build configuration keyword
# and get following library
set(_cfg "${_arg}")
math(EXPR _i "${_i} + 1")
if(_i EQUAL _length)
message(FATAL_ERROR "Package 'drone_interfaces' passes the build configuration keyword '${_cfg}' as the last exported library")
endif()
list(GET _exported_libraries ${_i} _library)
else()
# the value is a library without a build configuration keyword
set(_cfg "")
set(_library "${_arg}")
endif()
math(EXPR _i "${_i} + 1")
if(NOT IS_ABSOLUTE "${_library}")
# search for library target relative to this CMake file
set(_lib "NOTFOUND")
find_library(
_lib NAMES "${_library}"
PATHS "${drone_interfaces_DIR}/../../../lib"
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
if(NOT _lib)
# warn about not existing library and ignore it
message(FATAL_ERROR "Package 'drone_interfaces' exports the library '${_library}' which couldn't be found")
elseif(NOT IS_ABSOLUTE "${_lib}")
# the found library must be an absolute path
message(FATAL_ERROR "Package 'drone_interfaces' found the library '${_library}' at '${_lib}' which is not an absolute path")
elseif(NOT EXISTS "${_lib}")
# the found library must exist
message(FATAL_ERROR "Package 'drone_interfaces' found the library '${_lib}' which doesn't exist")
else()
list(APPEND drone_interfaces_LIBRARIES ${_cfg} "${_lib}")
endif()
else()
if(NOT EXISTS "${_library}")
# the found library must exist
message(WARNING "Package 'drone_interfaces' exports the library '${_library}' which doesn't exist")
else()
list(APPEND drone_interfaces_LIBRARIES ${_cfg} "${_library}")
endif()
endif()
endwhile()
endif()
# find_library() library names with optional LIBRARY_DIRS
# and add the libraries to drone_interfaces_LIBRARIES
if(NOT _exported_library_names STREQUAL "")
# loop over library names
# but remember related build configuration keyword if available
list(LENGTH _exported_library_names _length)
set(_i 0)
while(_i LESS _length)
list(GET _exported_library_names ${_i} _arg)
# pass linker flags along
if("${_arg}" MATCHES "^-" AND NOT "${_arg}" MATCHES "^-[l|framework]")
list(APPEND drone_interfaces_LIBRARIES "${_arg}")
math(EXPR _i "${_i} + 1")
continue()
endif()
if("${_arg}" MATCHES "^(debug|optimized|general)$")
# remember build configuration keyword
# and get following library name
set(_cfg "${_arg}")
math(EXPR _i "${_i} + 1")
if(_i EQUAL _length)
message(FATAL_ERROR "Package 'drone_interfaces' passes the build configuration keyword '${_cfg}' as the last exported target")
endif()
list(GET _exported_library_names ${_i} _library)
else()
# the value is a library target without a build configuration keyword
set(_cfg "")
set(_library "${_arg}")
endif()
math(EXPR _i "${_i} + 1")
# extract optional LIBRARY_DIRS from library name
string(REPLACE ":" ";" _library_dirs "${_library}")
list(GET _library_dirs 0 _library_name)
list(REMOVE_AT _library_dirs 0)
set(_lib "NOTFOUND")
if(NOT _library_dirs)
# search for library in the common locations
find_library(
_lib
NAMES "${_library_name}"
)
if(NOT _lib)
# warn about not existing library and later ignore it
message(WARNING "Package 'drone_interfaces' exports library '${_library_name}' which couldn't be found")
endif()
else()
# search for library in the specified directories
find_library(
_lib
NAMES "${_library_name}"
PATHS ${_library_dirs}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
if(NOT _lib)
# warn about not existing library and later ignore it
message(WARNING
"Package 'drone_interfaces' exports library '${_library_name}' with LIBRARY_DIRS '${_library_dirs}' which couldn't be found")
endif()
endif()
if(_lib)
list(APPEND drone_interfaces_LIBRARIES ${_cfg} "${_lib}")
endif()
endwhile()
endif()
# TODO(dirk-thomas) deduplicate drone_interfaces_LIBRARIES
# while maintaining library order
# as well as build configuration keywords
# as well as linker flags

View File

@@ -0,0 +1,27 @@
# generated from ament_cmake_export_targets/cmake/ament_cmake_export_targets-extras.cmake.in
set(_exported_targets "export_drone_interfaces__rosidl_generator_c;export_drone_interfaces__rosidl_typesupport_fastrtps_c;drone_interfaces__rosidl_typesupport_introspection_c;drone_interfaces__rosidl_typesupport_c;export_drone_interfaces__rosidl_generator_cpp;export_drone_interfaces__rosidl_typesupport_fastrtps_cpp;drone_interfaces__rosidl_typesupport_introspection_cpp;drone_interfaces__rosidl_typesupport_cpp;export_drone_interfaces__rosidl_generator_py")
# include all exported targets
if(NOT _exported_targets STREQUAL "")
foreach(_target ${_exported_targets})
set(_export_file "${drone_interfaces_DIR}/${_target}Export.cmake")
include("${_export_file}")
# extract the target names associated with the export
set(_regex "foreach\\((_cmake)?_expected_?[Tt]arget (IN ITEMS )?(.+)\\)")
file(
STRINGS "${_export_file}" _foreach_targets
REGEX "${_regex}")
list(LENGTH _foreach_targets _matches)
if(NOT _matches EQUAL 1)
message(FATAL_ERROR
"Failed to find exported target names in '${_export_file}'")
endif()
string(REGEX REPLACE "${_regex}" "\\3" _targets "${_foreach_targets}")
string(REPLACE " " ";" _targets "${_targets}")
list(LENGTH _targets _length)
list(APPEND drone_interfaces_TARGETS ${_targets})
endforeach()
endif()

View File

@@ -0,0 +1,4 @@
# copied from
# ament_cmake_core/cmake/environment_hooks/environment/ament_prefix_path.sh
ament_prepend_unique_value AMENT_PREFIX_PATH "$AMENT_CURRENT_PREFIX"

View File

@@ -0,0 +1,16 @@
# copied from ament_package/template/environment_hook/library_path.sh
# detect if running on Darwin platform
_UNAME=`uname -s`
_IS_DARWIN=0
if [ "$_UNAME" = "Darwin" ]; then
_IS_DARWIN=1
fi
unset _UNAME
if [ $_IS_DARWIN -eq 0 ]; then
ament_prepend_unique_value LD_LIBRARY_PATH "$AMENT_CURRENT_PREFIX/lib"
else
ament_prepend_unique_value DYLD_LIBRARY_PATH "$AMENT_CURRENT_PREFIX/lib"
fi
unset _IS_DARWIN

View File

@@ -0,0 +1,14 @@
# generated from ament/cmake/core/templates/nameConfig-version.cmake.in
set(PACKAGE_VERSION "@PACKAGE_VERSION@")
set(PACKAGE_VERSION_EXACT False)
set(PACKAGE_VERSION_COMPATIBLE False)
if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}")
set(PACKAGE_VERSION_EXACT True)
set(PACKAGE_VERSION_COMPATIBLE True)
endif()
if("${PACKAGE_FIND_VERSION}" VERSION_LESS "${PACKAGE_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE True)
endif()

View File

@@ -0,0 +1,42 @@
# generated from ament/cmake/core/templates/nameConfig.cmake.in
# prevent multiple inclusion
if(_@PROJECT_NAME@_CONFIG_INCLUDED)
# ensure to keep the found flag the same
if(NOT DEFINED @PROJECT_NAME@_FOUND)
# explicitly set it to FALSE, otherwise CMake will set it to TRUE
set(@PROJECT_NAME@_FOUND FALSE)
elseif(NOT @PROJECT_NAME@_FOUND)
# use separate condition to avoid uninitialized variable warning
set(@PROJECT_NAME@_FOUND FALSE)
endif()
return()
endif()
set(_@PROJECT_NAME@_CONFIG_INCLUDED TRUE)
# output package information
if(NOT @PROJECT_NAME@_FIND_QUIETLY)
message(STATUS "Found @PROJECT_NAME@: @PACKAGE_VERSION@ (${@PROJECT_NAME@_DIR})")
endif()
# warn when using a deprecated package
if(NOT "@PACKAGE_DEPRECATED@" STREQUAL "")
set(_msg "Package '@PROJECT_NAME@' is deprecated")
# append custom deprecation text if available
if(NOT "@PACKAGE_DEPRECATED@" STREQUAL "TRUE")
set(_msg "${_msg} (@PACKAGE_DEPRECATED@)")
endif()
# optionally quiet the deprecation message
if(NOT ${@PROJECT_NAME@_DEPRECATED_QUIET})
message(DEPRECATION "${_msg}")
endif()
endif()
# flag package as ament-based to distinguish it after being find_package()-ed
set(@PROJECT_NAME@_FOUND_AMENT_PACKAGE TRUE)
# include all config extra files
set(_extras "@PACKAGE_CONFIG_EXTRA_FILES@")
foreach(_extra ${_extras})
include("${@PROJECT_NAME@_DIR}/${_extra}")
endforeach()

View File

@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<package format="3">
<name>drone_interfaces</name>
<version>0.0.0</version>
<description>Interfaces for the drone project</description>
<maintainer email="user@todo.todo">user</maintainer>
<license>Apache License 2.0</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<build_depend>rosidl_default_generators</build_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
<member_of_group>rosidl_interface_packages</member_of_group>
</package>

View File

@@ -0,0 +1,150 @@
#!/usr/bin/env python3
# Copyright 2014-2015 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.
import argparse
from collections import OrderedDict
import os
import sys
from catkin_pkg.package import parse_package_string
def main(argv=sys.argv[1:]):
"""
Extract the information from package.xml and make them accessible to CMake.
Parse the given package.xml file and
print CMake code defining several variables containing the content.
"""
parser = argparse.ArgumentParser(
description='Parse package.xml file and print CMake code defining '
'several variables',
)
parser.add_argument(
'package_xml',
type=argparse.FileType('r', encoding='utf-8'),
help='The path to a package.xml file',
)
parser.add_argument(
'outfile',
nargs='?',
help='The filename where the output should be written to',
)
args = parser.parse_args(argv)
try:
package = parse_package_string(
args.package_xml.read(), filename=args.package_xml.name)
except Exception as e:
print("Error parsing '%s':" % args.package_xml.name, file=sys.stderr)
raise e
finally:
args.package_xml.close()
lines = generate_cmake_code(package)
if args.outfile:
with open(args.outfile, 'w', encoding='utf-8') as f:
for line in lines:
f.write('%s\n' % line)
else:
for line in lines:
print(line)
def get_dependency_values(key, depends):
dependencies = []
# Filter the dependencies, checking for any condition attributes
dependencies.append((key, ' '.join([
'"%s"' % str(d) for d in depends
if d.condition is None or d.evaluate_condition(os.environ)
])))
for d in depends:
comparisons = [
'version_lt',
'version_lte',
'version_eq',
'version_gte',
'version_gt']
for comp in comparisons:
value = getattr(d, comp, None)
if value is not None:
dependencies.append(('%s_%s_%s' % (key, str(d), comp.upper()),
'"%s"' % value))
return dependencies
def generate_cmake_code(package):
"""
Return a list of CMake set() commands containing the manifest information.
:param package: catkin_pkg.package.Package
:returns: list of str
"""
variables = []
variables.append(('VERSION', '"%s"' % package.version))
variables.append((
'MAINTAINER',
'"%s"' % (', '.join([str(m) for m in package.maintainers]))))
variables.extend(get_dependency_values('BUILD_DEPENDS',
package.build_depends))
variables.extend(get_dependency_values('BUILDTOOL_DEPENDS',
package.buildtool_depends))
variables.extend(get_dependency_values('BUILD_EXPORT_DEPENDS',
package.build_export_depends))
variables.extend(get_dependency_values('BUILDTOOL_EXPORT_DEPENDS',
package.buildtool_export_depends))
variables.extend(get_dependency_values('EXEC_DEPENDS',
package.exec_depends))
variables.extend(get_dependency_values('TEST_DEPENDS',
package.test_depends))
variables.extend(get_dependency_values('GROUP_DEPENDS',
package.group_depends))
variables.extend(get_dependency_values('MEMBER_OF_GROUPS',
package.member_of_groups))
deprecated = [e.content for e in package.exports
if e.tagname == 'deprecated']
variables.append(('DEPRECATED',
'"%s"' % ((deprecated[0] if deprecated[0] else 'TRUE')
if deprecated
else '')))
lines = []
lines.append('set(_AMENT_PACKAGE_NAME "%s")' % package.name)
for (k, v) in variables:
lines.append('set(%s_%s %s)' % (package.name, k, v))
lines.append('set(%s_EXPORT_TAGS)' % package.name)
replaces = OrderedDict()
replaces['${prefix}/'] = ''
replaces['\\'] = '\\\\' # escape backslashes
replaces['"'] = '\\"' # prevent double quotes to end the CMake string
replaces[';'] = '\\;' # prevent semicolons to be interpreted as list separators
for export in package.exports:
export = str(export)
for k, v in replaces.items():
export = export.replace(k, v)
lines.append('list(APPEND %s_EXPORT_TAGS "%s")' % (package.name, export))
return lines
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,5 @@
# copied from ament_cmake_core/cmake/environment_hooks/environment/path.sh
if [ -d "$AMENT_CURRENT_PREFIX/bin" ]; then
ament_prepend_unique_value PATH "$AMENT_CURRENT_PREFIX/bin"
fi

View File

@@ -0,0 +1,3 @@
# generated from ament_package/template/environment_hook/pythonpath.sh.in
ament_prepend_unique_value PYTHONPATH "$AMENT_CURRENT_PREFIX/@PYTHON_INSTALL_DIR@"

View File

@@ -0,0 +1,4 @@
# generated from rosidl_cmake/cmake/rosidl_cmake-extras.cmake.in
set(drone_interfaces_IDL_FILES "action/ExecuteMission.idl")
set(drone_interfaces_INTERFACE_FILES "action/ExecuteMission.action")

View File

@@ -0,0 +1,49 @@
# generated from
# rosidl_cmake/cmake/template/rosidl_cmake_export_typesupport_libraries.cmake.in
set(_exported_typesupport_libraries
"__rosidl_typesupport_fastrtps_c:drone_interfaces__rosidl_typesupport_fastrtps_c;__rosidl_typesupport_fastrtps_cpp:drone_interfaces__rosidl_typesupport_fastrtps_cpp")
# populate drone_interfaces_LIBRARIES_<suffix>
if(NOT _exported_typesupport_libraries STREQUAL "")
# loop over typesupport libraries
foreach(_tuple ${_exported_typesupport_libraries})
string(REPLACE ":" ";" _tuple "${_tuple}")
list(GET _tuple 0 _suffix)
list(GET _tuple 1 _library)
if(NOT IS_ABSOLUTE "${_library}")
# search for library target relative to this CMake file
set(_lib "NOTFOUND")
find_library(
_lib NAMES "${_library}"
PATHS "${drone_interfaces_DIR}/../../../lib"
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
if(NOT _lib)
# the library wasn't found
message(FATAL_ERROR
"Package 'drone_interfaces' exports the typesupport library '${_library}' which couldn't be found")
elseif(NOT IS_ABSOLUTE "${_lib}")
# the found library must be an absolute path
message(FATAL_ERROR
"Package 'drone_interfaces' found the typesupport library '${_library}' at '${_lib}' "
"which is not an absolute path")
elseif(NOT EXISTS "${_lib}")
# the found library must exist
message(FATAL_ERROR "Package 'drone_interfaces' found the typesupport library '${_lib}' which doesn't exist")
else()
list(APPEND drone_interfaces_LIBRARIES${_suffix} ${_cfg} "${_lib}")
endif()
else()
if(NOT EXISTS "${_library}")
# the found library must exist
message(WARNING "Package 'drone_interfaces' exports the typesupport library '${_library}' which doesn't exist")
else()
list(APPEND drone_interfaces_LIBRARIES${_suffix} "${_library}")
endif()
endif()
endforeach()
endif()

View File

@@ -0,0 +1,23 @@
# generated from
# rosidl_cmake/cmake/template/rosidl_cmake_export_typesupport_targets.cmake.in
set(_exported_typesupport_targets
"__rosidl_generator_c:drone_interfaces__rosidl_generator_c;__rosidl_typesupport_fastrtps_c:drone_interfaces__rosidl_typesupport_fastrtps_c;__rosidl_typesupport_introspection_c:drone_interfaces__rosidl_typesupport_introspection_c;__rosidl_typesupport_c:drone_interfaces__rosidl_typesupport_c;__rosidl_generator_cpp:drone_interfaces__rosidl_generator_cpp;__rosidl_typesupport_fastrtps_cpp:drone_interfaces__rosidl_typesupport_fastrtps_cpp;__rosidl_typesupport_introspection_cpp:drone_interfaces__rosidl_typesupport_introspection_cpp;__rosidl_typesupport_cpp:drone_interfaces__rosidl_typesupport_cpp;__rosidl_generator_py:drone_interfaces__rosidl_generator_py")
# populate drone_interfaces_TARGETS_<suffix>
if(NOT _exported_typesupport_targets STREQUAL "")
# loop over typesupport targets
foreach(_tuple ${_exported_typesupport_targets})
string(REPLACE ":" ";" _tuple "${_tuple}")
list(GET _tuple 0 _suffix)
list(GET _tuple 1 _target)
set(_target "drone_interfaces::${_target}")
if(NOT TARGET "${_target}")
# the exported target must exist
message(WARNING "Package 'drone_interfaces' exports the typesupport target '${_target}' which doesn't exist")
else()
list(APPEND drone_interfaces_TARGETS${_suffix} "${_target}")
endif()
endforeach()
endif()

View File

@@ -0,0 +1,112 @@
#!/usr/bin/env python3
# Copyright 2014-2015 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.
import argparse
import os
import sys
from ament_package.templates import get_environment_hook_template_path
from ament_package.templates import get_package_level_template_names
from ament_package.templates import get_package_level_template_path
from ament_package.templates import get_prefix_level_template_names
from ament_package.templates import get_prefix_level_template_path
IS_WINDOWS = os.name == 'nt'
def main(argv=sys.argv[1:]):
"""
Extract the information about templates provided by ament_package.
Call the API provided by ament_package and
print CMake code defining several variables containing information about
the available templates.
"""
parser = argparse.ArgumentParser(
description='Extract information about templates provided by '
'ament_package and print CMake code defining several '
'variables',
)
parser.add_argument(
'outfile',
nargs='?',
help='The filename where the output should be written to',
)
args = parser.parse_args(argv)
lines = generate_cmake_code()
if args.outfile:
basepath = os.path.dirname(args.outfile)
if not os.path.exists(basepath):
os.makedirs(basepath)
with open(args.outfile, 'w') as f:
for line in lines:
f.write('%s\n' % line)
else:
for line in lines:
print(line)
def generate_cmake_code():
"""
Return a list of CMake set() commands containing the template information.
:returns: list of str
"""
variables = []
if not IS_WINDOWS:
variables.append((
'ENVIRONMENT_HOOK_LIBRARY_PATH',
'"%s"' % get_environment_hook_template_path('library_path.sh')))
else:
variables.append(('ENVIRONMENT_HOOK_LIBRARY_PATH', ''))
ext = '.bat.in' if IS_WINDOWS else '.sh.in'
variables.append((
'ENVIRONMENT_HOOK_PYTHONPATH',
'"%s"' % get_environment_hook_template_path('pythonpath' + ext)))
templates = []
for name in get_package_level_template_names():
templates.append('"%s"' % get_package_level_template_path(name))
variables.append((
'PACKAGE_LEVEL',
templates))
templates = []
for name in get_prefix_level_template_names():
templates.append('"%s"' % get_prefix_level_template_path(name))
variables.append((
'PREFIX_LEVEL',
templates))
lines = []
for (k, v) in variables:
if isinstance(v, list):
lines.append('set(ament_cmake_package_templates_%s "")' % k)
for vv in v:
lines.append('list(APPEND ament_cmake_package_templates_%s %s)'
% (k, vv))
else:
lines.append('set(ament_cmake_package_templates_%s %s)' % (k, v))
# Ensure backslashes are replaced with forward slashes because CMake cannot
# parse files with backslashes in it.
return [line.replace('\\', '/') for line in lines]
if __name__ == '__main__':
main()