├── src └── auto_abi_checker │ ├── __init__.py │ ├── test │ ├── __init__.py │ ├── files │ │ └── usr │ │ │ ├── lib │ │ │ ├── x86_64-linux-gnu │ │ │ │ ├── libsdformat8.so │ │ │ │ ├── libsdformat8.so.8 │ │ │ │ ├── libsdformat8.so.8.3.0 │ │ │ │ ├── pkgconfig │ │ │ │ │ └── sdformat8.pc │ │ │ │ └── cmake │ │ │ │ │ └── sdformat8 │ │ │ │ │ ├── sdformat8-targets-relwithdebinfo.cmake │ │ │ │ │ ├── sdformat8-config-version.cmake │ │ │ │ │ ├── sdformat8-config.cmake │ │ │ │ │ └── sdformat8-targets.cmake │ │ │ └── ruby │ │ │ │ └── ignition │ │ │ │ └── cmdsdformat8.rb │ │ │ ├── share │ │ │ ├── doc │ │ │ │ ├── libsdformat8 │ │ │ │ │ ├── AUTHORS │ │ │ │ │ ├── changelog.Debian.gz │ │ │ │ │ ├── README.md │ │ │ │ │ └── copyright │ │ │ │ └── libsdformat8-dev │ │ │ │ │ ├── changelog.Debian.gz │ │ │ │ │ └── copyright │ │ │ └── ignition │ │ │ │ └── sdformat8.yaml │ │ │ └── include │ │ │ └── sdformat-8.3 │ │ │ └── sdf │ │ │ ├── sdf_config.h │ │ │ ├── sdf.hh │ │ │ ├── Assert.hh │ │ │ ├── system_util.hh │ │ │ ├── parser_urdf.hh │ │ │ ├── Box.hh │ │ │ ├── Sphere.hh │ │ │ ├── Gui.hh │ │ │ ├── Cylinder.hh │ │ │ ├── Plane.hh │ │ │ ├── Altimeter.hh │ │ │ ├── Scene.hh │ │ │ ├── Magnetometer.hh │ │ │ ├── AirPressure.hh │ │ │ ├── Mesh.hh │ │ │ ├── Atmosphere.hh │ │ │ ├── Collision.hh │ │ │ ├── Physics.hh │ │ │ ├── Visual.hh │ │ │ ├── Filesystem.hh │ │ │ ├── SDFImpl.hh │ │ │ ├── Error.hh │ │ │ ├── Exception.hh │ │ │ ├── Console.hh │ │ │ ├── Root.hh │ │ │ ├── Geometry.hh │ │ │ ├── parser.hh │ │ │ ├── Types.hh │ │ │ ├── Material.hh │ │ │ ├── Joint.hh │ │ │ ├── Noise.hh │ │ │ ├── Model.hh │ │ │ └── Lidar.hh │ ├── debs │ │ ├── libsdformat8_8.3.0-1~bionic_amd64.deb │ │ └── libsdformat8-dev_8.3.0-1~bionic_amd64.deb │ └── auto-abi_TEST.py │ ├── config │ └── symbols_ignored.txt │ ├── srcs_base.py │ ├── utils.py │ ├── ros_utils.py │ ├── generator.py │ ├── srcs_local.py │ ├── srcs_apt.py │ ├── srcs_ros.py │ ├── auto-abi.py │ └── abi_executor.py ├── setup.cfg ├── MANIFEST.in ├── .gitignore ├── .travis.yml ├── setup.py └── README.md /src/auto_abi_checker/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file = README.md 3 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include src/auto_abi_checker/config * 2 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/lib/x86_64-linux-gnu/libsdformat8.so: -------------------------------------------------------------------------------- 1 | libsdformat8.so.8 -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/lib/x86_64-linux-gnu/libsdformat8.so.8: -------------------------------------------------------------------------------- 1 | libsdformat8.so.8.3.0 -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/share/doc/libsdformat8/AUTHORS: -------------------------------------------------------------------------------- 1 | Nate Koenig 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swn 3 | *.swo 4 | __pycache__ 5 | .mypy_cache 6 | *.egg-info 7 | *.pyc 8 | dist 9 | build 10 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/debs/libsdformat8_8.3.0-1~bionic_amd64.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canonical/auto-abi-checker/master/src/auto_abi_checker/test/debs/libsdformat8_8.3.0-1~bionic_amd64.deb -------------------------------------------------------------------------------- /src/auto_abi_checker/test/debs/libsdformat8-dev_8.3.0-1~bionic_amd64.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canonical/auto-abi-checker/master/src/auto_abi_checker/test/debs/libsdformat8-dev_8.3.0-1~bionic_amd64.deb -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/lib/x86_64-linux-gnu/libsdformat8.so.8.3.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canonical/auto-abi-checker/master/src/auto_abi_checker/test/files/usr/lib/x86_64-linux-gnu/libsdformat8.so.8.3.0 -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/share/doc/libsdformat8/changelog.Debian.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canonical/auto-abi-checker/master/src/auto_abi_checker/test/files/usr/share/doc/libsdformat8/changelog.Debian.gz -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/share/doc/libsdformat8-dev/changelog.Debian.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canonical/auto-abi-checker/master/src/auto_abi_checker/test/files/usr/share/doc/libsdformat8-dev/changelog.Debian.gz -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/share/ignition/sdformat8.yaml: -------------------------------------------------------------------------------- 1 | --- # Subcommands available inside ignition-transport. 2 | format: 1.0.0 3 | library_name: sdformat8 4 | library_version: 8.3.0 5 | library_path: /usr/lib/ruby/ignition/cmdsdformat8 6 | commands: 7 | - sdf : Utilities for SDF files. 8 | --- 9 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/lib/x86_64-linux-gnu/pkgconfig/sdformat8.pc: -------------------------------------------------------------------------------- 1 | prefix="/usr" 2 | libdir=${prefix}/lib/x86_64-linux-gnu 3 | includedir=${prefix}/include 4 | 5 | Name: SDF 6 | Description: Robot Modeling Language (SDF) 7 | Version: 8.3.0 8 | Requires: ignition-math6 9 | Libs: -L${libdir} -lsdformat8 10 | CFlags: -I${includedir}/sdformat-8.3 -std=c++17 11 | -------------------------------------------------------------------------------- /src/auto_abi_checker/config/symbols_ignored.txt: -------------------------------------------------------------------------------- 1 | _ZNK6rclcpp29PublisherOptionsWithAllocatorINSaIvEEE13get_allocatorEv 2 | _ZNK6rclcpp29PublisherOptionsWithAllocatorISaIvEE13get_allocatorEv 3 | _ZN6rclcpp32SubscriptionOptionsWithAllocatorISaIvEEC1Ev 4 | _ZN6rclcpp32SubscriptionOptionsWithAllocatorISaIvEEC2Ev 5 | _ZNK6rclcpp32SubscriptionOptionsWithAllocatorINSaIvEEE13get_allocatorEv 6 | _ZNK6rclcpp32SubscriptionOptionsWithAllocatorISaIvEE13get_allocatorEv 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: bionic 3 | language: python 4 | python: 5 | - "3.5" 6 | - "3.6" 7 | before_install: 8 | - sudo bash -c 'echo "deb [trusted=yes] http://packages.osrfoundation.org/gazebo/ubuntu-stable bionic main" > /etc/apt/sources.list.d/gazebo-stable.list' 9 | - sudo bash -c 'echo "deb [trusted=yes] http://packages.ros.org/ros/ubuntu bionic main" > /etc/apt/sources.list.d/ros-latest.list' 10 | - sudo apt-get update -qq 11 | install: 12 | # need ignition, tinyxml for testing 13 | - sudo apt-get install -qq python3-rosdep python3 abi-compliance-checker libignition-math4-dev libtinyxml-dev 14 | - pip install rosdistro 15 | script: 16 | - python3 setup.py test || find /tmp -name log.txt -exec cat {} \; 17 | -------------------------------------------------------------------------------- /src/auto_abi_checker/srcs_base.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright 2018 Open Robotics 4 | # Licensed under the Apache License, Version 2.0 5 | 6 | from tempfile import mkdtemp 7 | from glob import glob 8 | from os.path import join 9 | from auto_abi_checker.utils import main_step_info 10 | 11 | 12 | class SrcBase: 13 | def __init__(self, name): 14 | self.name = name 15 | self.ws = mkdtemp() 16 | self.ws_files = join(self.ws, 'files') 17 | self.compilation_flags = [] 18 | main_step_info("Init " + self.name + " -::- " + "workspace: " + self.ws) 19 | 20 | def __str__(self): 21 | return "'" + self.name + "' at " + str(self.ws) 22 | 23 | def list_files(self, pattern): 24 | return glob(self.ws + '/' + pattern) 25 | 26 | def get_cmd_compilation_flags(self): 27 | return " ".join(self.compilation_flags) 28 | -------------------------------------------------------------------------------- /src/auto_abi_checker/utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright 2018 Open Robotics 4 | # Licensed under the Apache License, Version 2.0 5 | 6 | from subprocess import check_call 7 | from sys import stderr 8 | 9 | 10 | def main_step_info(msg): 11 | print("* %s" % msg) 12 | 13 | 14 | def info(msg): 15 | print(" - %s" % msg) 16 | 17 | 18 | def subinfo(msg): 19 | print(" - %s" % msg) 20 | 21 | 22 | def _check_call(cmd): 23 | info("Run " + " ".join(cmd)) 24 | 25 | check_call(cmd) 26 | return 0 27 | 28 | 29 | class AppError(Exception): 30 | pass 31 | 32 | 33 | def error(msg): 34 | print("\n [err] " + msg, file=stderr) 35 | raise AppError() 36 | 37 | 38 | def warn(msg): 39 | print("\n [warn] " + msg, file=stderr) 40 | 41 | 42 | def comma_list_to_array(str_input): 43 | if "," in str_input: 44 | return str_input.split(",") 45 | 46 | return [str_input] 47 | -------------------------------------------------------------------------------- /src/auto_abi_checker/ros_utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright 2018 Open Robotics 4 | # Licensed under the Apache License, Version 2.0 5 | 6 | from os import remove 7 | from pathlib import Path 8 | from shutil import rmtree 9 | 10 | 11 | def remove_dds_files(directory, dds_impl): 12 | for filename in Path(directory).glob('**/*rosidl_typesupport_' + dds_impl + '*.h*'): 13 | remove(filename) 14 | for filename in Path(directory).glob('**/*rosidl_typesupport_' + dds_impl + '*.so'): 15 | remove(filename) 16 | for t_type in ["srv", "msg", "action"]: 17 | for dirname in Path(directory).glob('**/*' + t_type + '/dds_' + dds_impl): 18 | rmtree(dirname) 19 | for dirname in Path(directory).glob('**/*' + t_type + '/dds_' + dds_impl + "_c"): 20 | rmtree(dirname) 21 | 22 | 23 | def clean_non_default_dss_files(directory): 24 | remove_dds_files(directory, 'opensplice') 25 | remove_dds_files(directory, 'connext') 26 | -------------------------------------------------------------------------------- /src/auto_abi_checker/generator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright 2018 Open Robotics 4 | # Licensed under the Apache License, Version 2.0 5 | 6 | from auto_abi_checker.srcs_apt import SrcOSRFPkgGenerator 7 | from auto_abi_checker.srcs_ros import SrcROSRepoGenerator, SrcROSPkgGenerator 8 | from auto_abi_checker.srcs_local import SrcLocalDir, SrcROSWs 9 | from auto_abi_checker.utils import error 10 | 11 | 12 | class SrcGenerator: 13 | def generate(self, src_type, name): 14 | if (src_type == 'ros-pkg'): 15 | return SrcROSPkgGenerator(name) 16 | elif (src_type == 'ros-repo'): 17 | return SrcROSRepoGenerator(name) 18 | elif (src_type == 'ros-ws'): 19 | return SrcROSWs(name) 20 | elif (src_type == 'osrf-pkg'): 21 | return SrcOSRFPkgGenerator(name) 22 | elif (src_type == 'local-dir'): 23 | return SrcLocalDir(name) 24 | else: 25 | error("Internal error SrcGenerator. Unknown src-type ") 26 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/lib/x86_64-linux-gnu/cmake/sdformat8/sdformat8-targets-relwithdebinfo.cmake: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------- 2 | # Generated CMake target import file for configuration "RelWithDebInfo". 3 | #---------------------------------------------------------------- 4 | 5 | # Commands may need to know the format version. 6 | set(CMAKE_IMPORT_FILE_VERSION 1) 7 | 8 | # Import target "sdformat8::sdformat8" for configuration "RelWithDebInfo" 9 | set_property(TARGET sdformat8::sdformat8 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELWITHDEBINFO) 10 | set_target_properties(sdformat8::sdformat8 PROPERTIES 11 | IMPORTED_LOCATION_RELWITHDEBINFO "${_IMPORT_PREFIX}/lib/x86_64-linux-gnu/libsdformat8.so.8.3.0" 12 | IMPORTED_SONAME_RELWITHDEBINFO "libsdformat8.so.8" 13 | ) 14 | 15 | list(APPEND _IMPORT_CHECK_TARGETS sdformat8::sdformat8 ) 16 | list(APPEND _IMPORT_CHECK_FILES_FOR_sdformat8::sdformat8 "${_IMPORT_PREFIX}/lib/x86_64-linux-gnu/libsdformat8.so.8.3.0" ) 17 | 18 | # Commands beyond this point should not need to know the version. 19 | set(CMAKE_IMPORT_FILE_VERSION) 20 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/sdf_config.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated by CMake for sdformat8. */ 2 | 3 | /* Protocol version */ 4 | #define SDF_PROTOCOL_VERSION "1.6" 5 | /* \deprecated SDF_VERSION is deprecated. Please 6 | * use SDF_PROTOCOL_VERSION or SDF_PKG_VERSION 7 | * 8 | * SDF_VERSION is here to keep backwards compatibility. It was used 9 | * when the package version and protocol version were the same 10 | */ 11 | #define SDF_VERSION "1.6" 12 | 13 | /* Package version number */ 14 | #define SDF_MAJOR_VERSION 8 15 | #define SDF_MINOR_VERSION 3 16 | #define SDF_PATCH_VERSION 0 17 | 18 | #define SDF_MAJOR_VERSION_STR "8" 19 | #define SDF_MINOR_VERSION_STR "3" 20 | #define SDF_PATCH_VERSION_STR "0" 21 | 22 | #define SDF_PKG_VERSION "8.3" 23 | #define SDF_VERSION_FULL "8.3.0" 24 | #define SDF_VERSION_NAME 25 | #define SDF_VERSION_NAMESPACE v8 26 | 27 | #define SDF_VERSION_HEADER "Simulation Description Format (SDF), version 1.6\nCopyright (C) 2014 Open Source Robotics Foundation.\nReleased under the Apache 2 License.\nhttp://gazebosim.org/sdf\n\n" 28 | 29 | /* #undef BUILD_TYPE_PROFILE */ 30 | /* #undef BUILD_TYPE_DEBUG */ 31 | /* #undef BUILD_TYPE_RELEASE */ 32 | /* #undef HAVE_URDFDOM */ 33 | #define USE_INTERNAL_URDF 1 34 | 35 | #define SDF_SHARE_PATH "/usr/share/" 36 | #define SDF_VERSION_PATH "/usr/share/sdformat8/" 37 | -------------------------------------------------------------------------------- /src/auto_abi_checker/srcs_local.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright 2018 Open Robotics 4 | # Licensed under the Apache License, Version 2.0 5 | 6 | from os import path, listdir 7 | from shutil import copytree 8 | 9 | from auto_abi_checker.utils import _check_call, error, info 10 | from auto_abi_checker.srcs_base import SrcBase 11 | from auto_abi_checker.ros_utils import clean_non_default_dss_files 12 | 13 | 14 | class SrcLocalDir(SrcBase): 15 | def __init__(self, name): 16 | SrcBase.__init__(self, name) 17 | 18 | def validate(self, directory): 19 | if (not path.isdir(directory)): 20 | error("Path " + directory + " is not a directory") 21 | if not listdir(directory): 22 | error("Directory " + directory + "is empty") 23 | 24 | def run(self, directory): 25 | self.validate(directory) 26 | self.copy_files(directory) 27 | self.filter_files() 28 | 29 | def copy_files(self, directory): 30 | info("Run copytree from " + directory + " to " + self.ws_files) 31 | copytree(directory, self.ws_files) 32 | 33 | def filter_files(self): 34 | True 35 | 36 | 37 | class SrcROSWs(SrcLocalDir): 38 | def __init__(self, name): 39 | SrcLocalDir.__init__(self, name) 40 | 41 | def filter_files(self): 42 | clean_non_default_dss_files(self.ws_files) 43 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/sdf.hh: -------------------------------------------------------------------------------- 1 | // Automatically generated 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Assert.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_ASSERT_HH_ 18 | #define SDF_ASSERT_HH_ 19 | 20 | #include "sdf/Exception.hh" 21 | 22 | /// \brief This macro define the standard way of launching an exception 23 | /// inside SDF. 24 | #define SDF_ASSERT(_expr, _msg) ((!!(_expr)) ? ((void)0) : \ 25 | throw sdf::AssertionInternalError(__FILE__, \ 26 | __LINE__, \ 27 | #_expr, \ 28 | __FUNCTION__, \ 29 | _msg)) 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | from setuptools import setup 5 | import unittest 6 | 7 | install_requires = [ 8 | 'docopt', 9 | 'rosdistro', 10 | ] 11 | 12 | def discover_tests(): 13 | test_loader = unittest.TestLoader() 14 | test_suite = test_loader.discover('src/auto_abi_checker/tests', pattern='*_TEST.py') 15 | return test_suite 16 | 17 | kwargs = { 18 | 'name': 'auto_abi_checker', 19 | 'version': '0.1.14', 20 | 'packages': ['auto_abi_checker'], 21 | 'package_dir': {'': 'src'}, 22 | 'include_package_data': True, 23 | 'author': 'Jose Luis Rivero', 24 | 'author_email': 'jrivero@osrfoundation.org', 25 | 'classifiers': [ 26 | 'Development Status :: 3 - Alpha', 27 | 'Intended Audience :: Developers', 28 | 'Programming Language :: Python', 29 | 'Programming Language :: Python :: 3', 30 | 'License :: OSI Approved :: Apache Software License' 31 | ], 32 | 'description': 'Tool to facilitate the run of abi-compliance-checker', 33 | 'long_description': 'Tool designed to facilitate the run the great ABI compliance checker by supporting easy inputs and no configuration files', 34 | 'license': 'Apache License 2.0', 35 | 'python_requires': '>=3.0', 36 | 'scripts': ['src/auto_abi_checker/auto-abi.py'], 37 | 'install_requires': install_requires, 38 | 'url': 'https://github.com/osrf/auto-abi-checker', 39 | 'test_suite': 'src/auto_abi_checker/test/auto-abi_TEST.py', 40 | 'download_url': 'https://github.com/osrf/auto-abi-checker/archive/0.1.10.tar.gz', 41 | } 42 | 43 | setup(**kwargs) 44 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/share/doc/libsdformat8/README.md: -------------------------------------------------------------------------------- 1 | # sdformat # 2 | 3 | SDF is an XML file format that describes environments, objects, and robots 4 | in a manner suitable for robotic applications. SDF is capable of representing 5 | and describing different physic engines, lighting properties, terrain, static 6 | or dynamic objects, and articulated robots with various sensors, and acutators. 7 | The format of SDF is also described by XML, which facilitates updates and 8 | allows conversion from previous versions. 9 | 10 | * SDFormat - The specification. 11 | * SDF - Synonym for SDFormat, though SDFormat should be preferred, as "SDF" 12 | is an acronym with other meanings. 13 | * libsdformat - The C++ parsing code contained within this repository, 14 | which can be used to read SDF files and return a C++ interface. 15 | 16 | Test coverage: 17 | 18 | [![codecov](https://codecov.io/bb/osrf/sdformat/branch/default/graph/badge.svg)](https://codecov.io/bb/osrf/sdformat) 19 | 20 | 21 | ## Installation ## 22 | 23 | Standard installation can be performed in UNIX systems using the following 24 | steps: 25 | 26 | - mkdir build/ 27 | - cd build/ 28 | - cmake .. 29 | - sudo make install 30 | 31 | sdformat supported cmake parameters at configuring time: 32 | - USE_INTERNAL_URDF (bool) [default False] 33 | Use an internal copy of urdfdom 1.0.0 instead of look for one 34 | installed in the system 35 | - USE_UPSTREAM_CFLAGS (bool) [default True] 36 | Use the sdformat team compilation flags instead of the common set defined 37 | by cmake. 38 | 39 | ## Uninstallation ## 40 | 41 | To uninstall the software installed with the previous steps: 42 | - cd build/ 43 | - sudo make uninstall 44 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/system_util.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_VISIBLE_HH_ 18 | #define SDF_VISIBLE_HH_ 19 | 20 | /** \def SDFORMAT_VISIBLE 21 | * Use to represent "symbol visible" if supported 22 | */ 23 | 24 | /** \def SDFORMAT_HIDDEN 25 | * Use to represent "symbol hidden" if supported 26 | */ 27 | 28 | #if defined _WIN32 || defined __CYGWIN__ 29 | #ifdef BUILDING_DLL 30 | #ifdef __GNUC__ 31 | #define SDFORMAT_VISIBLE __attribute__ ((dllexport)) 32 | #else 33 | #define SDFORMAT_VISIBLE __declspec(dllexport) 34 | #endif 35 | #else 36 | #ifdef __GNUC__ 37 | #define SDFORMAT_VISIBLE __attribute__ ((dllimport)) 38 | #else 39 | #define SDFORMAT_VISIBLE __declspec(dllimport) 40 | #endif 41 | #endif 42 | #define SDFORMAT_HIDDEN 43 | #else 44 | #if __GNUC__ >= 4 && !defined SDFORMAT_STATIC_DEFINE 45 | #define SDFORMAT_VISIBLE __attribute__ ((visibility ("default"))) 46 | #define SDFORMAT_HIDDEN __attribute__ ((visibility ("hidden"))) 47 | #else 48 | #define SDFORMAT_VISIBLE 49 | #define SDFORMAT_HIDDEN 50 | #endif 51 | #endif 52 | 53 | // SDF_VISIBLE_HH_ 54 | #endif 55 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/lib/x86_64-linux-gnu/cmake/sdformat8/sdformat8-config-version.cmake: -------------------------------------------------------------------------------- 1 | # This is a basic version file for the Config-mode of find_package(). 2 | # It is used by write_basic_package_version_file() as input file for configure_file() 3 | # to create a version-file which can be installed along a config.cmake file. 4 | # 5 | # The created file sets PACKAGE_VERSION_EXACT if the current version string and 6 | # the requested version string are exactly the same and it sets 7 | # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, 8 | # but only if the requested major version is the same as the current one. 9 | # The variable CVF_VERSION must be set before calling configure_file(). 10 | 11 | 12 | set(PACKAGE_VERSION "8.3.0") 13 | 14 | if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) 15 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 16 | else() 17 | 18 | if("8.3.0" MATCHES "^([0-9]+)\\.") 19 | set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") 20 | else() 21 | set(CVF_VERSION_MAJOR "8.3.0") 22 | endif() 23 | 24 | if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) 25 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 26 | else() 27 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 28 | endif() 29 | 30 | if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) 31 | set(PACKAGE_VERSION_EXACT TRUE) 32 | endif() 33 | endif() 34 | 35 | 36 | # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: 37 | if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") 38 | return() 39 | endif() 40 | 41 | # check that the installed version has the same 32/64bit-ness as the one which is currently searching: 42 | if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") 43 | math(EXPR installedBits "8 * 8") 44 | set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") 45 | set(PACKAGE_VERSION_UNSUITABLE TRUE) 46 | endif() 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Auto generation of ABI report [![Build Status](https://travis-ci.org/osrf/auto-abi-checker.svg?branch=master)](https://travis-ci.org/osrf/auto-abi-checker) 2 | 3 | > Tool designed to facilitate the run the great [ABI compliance checker](https://lvc.github.io/abi-compliance-checker/) 4 | by supporting easy inputs and no configuration files 5 | 6 | 7 | ## Inputs supported: 8 | 9 | * **local-dir:** use full path to a local directory with the headers and 10 | libraries (i.e: install directory) 11 | * **osrf-pkg:** use OSRF lib name and the tool will get the library and 12 | development packages from the OSRF repositories (i.e: sdformat7) 13 | * **ros-pkg:** use the ROS package name. It can be fully qualified (i.e 14 | ros-melodic-gazebo-dev) or a ROS name (i.e gazebo_dev). If using the 15 | ROS package name, rosdistro will be obtained from ROS_DISTRO env var. 16 | Multiple packages are supported, comma separated. 17 | * **ros-repo:** use the ROS repo name and the tool will download all 18 | the packages associated with the repository. (i.e: gazebo_ros_pkgs) 19 | * **ros-ws:** use full path to the install directory of a ROS workspace 20 | 21 | 22 | ## Examples 23 | 24 | ### Use ros-repo 25 | ```bash 26 | ./auto-abi.py --orig-type ros-repo --orig gazebo_ros_pkgs --new-type local-dir --new /tmp/colcon_ws/install 27 | ``` 28 | 29 | ### Use ros-pkg 30 | 31 | Single package, using prefix 32 | 33 | ```bash 34 | ./auto-abi.py --orig-type ros-pkg --orig ros-melodic-gazebo-ros --new-type local-dir --new /tmp/colcon_ws/install 35 | ``` 36 | 37 | Multiple packages, with prefix 38 | 39 | ```bash 40 | ./auto-abi.py --orig-type ros-pkg --orig gazebo_ros,gazebo_dev,gazebo_ros_pkgs --new-type local-dir --new /tmp/colcon_ws/install 41 | ``` 42 | 43 | ### Use osrf-pkg 44 | ```bash 45 | ./auto-abi.py --orig-type osrf-pkg --orig sdformat8 --new-type osrf-pkg --new sdformat8 46 | ``` 47 | -------------------------------------------------------------------------------- /src/auto_abi_checker/srcs_apt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright 2018 Open Robotics 4 | # Licensed under the Apache License, Version 2.0 5 | 6 | from os import chdir, environ 7 | from auto_abi_checker.utils import _check_call, error 8 | from auto_abi_checker.srcs_base import SrcBase 9 | 10 | 11 | class SrcAptBase(SrcBase): 12 | def __init__(self, name): 13 | SrcBase.__init__(self, name) 14 | 15 | def run(self, value): 16 | self.validate(value) 17 | pkgs = self.get_deb_package_names(value) 18 | self.download_deb_packages(pkgs) 19 | self.extract_deb_files() 20 | self.filter_files() 21 | 22 | # override if need validation 23 | def validate(self, value): 24 | True 25 | 26 | def get_deb_package_names(self, value): 27 | raise NotImplementedError() 28 | 29 | def download_deb_packages(self, package_names): 30 | for p in package_names: 31 | # run_apt_update 32 | chdir(self.ws) 33 | result = _check_call(['apt-get', 'download', '-qq', p]) 34 | if result != 0: 35 | error("Failed to download") 36 | 37 | def run_apt_update(self): 38 | _check_call(['apt-get', 'update']) 39 | 40 | def extract_deb_files(self): 41 | files = self.list_files('*.deb') 42 | for f in files: 43 | result = _check_call(['dpkg', '-x', f, self.ws_files]) 44 | if result != 0: 45 | error("Failed to extract files") 46 | 47 | # override if need filtering 48 | def filter_files(self): 49 | True 50 | 51 | class SrcOSRFPkgGenerator(SrcAptBase): 52 | def __init__(self, name): 53 | SrcAptBase.__init__(self, name) 54 | self.osrf_url_base = 'http://bitbucket.org/osrf/' 55 | self.compilation_flags.append('--std=c++17') 56 | 57 | def get_deb_package_names(self, osrf_repo): 58 | return ["lib" + osrf_repo, "lib" + osrf_repo + "-dev"] 59 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/share/doc/libsdformat8/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: sdformat 3 | Upstream-Contact: gazebo-list@gazebosim.org 4 | Source: http://sdformat.org/ 5 | 6 | Files: * 7 | Copyright: 2011 Nate Koenig 8 | 2012 Open Source Robotics Foundation 9 | 2013 Open Source Robotics Foundation 10 | License: Apache 11 | See '/usr/share/common-licenses/Apache-2.0'. 12 | 13 | Files: test/gtest/* 14 | Copyright: 2003, Google Inc. 15 | 2005, Google Inc. 16 | 2006, Google Inc. 17 | 2007, Google Inc. 18 | 2008, Google Inc. 19 | 2009, Google Inc. 20 | License: BSD-3-clause 21 | 22 | Files: tools/check_test_ran.py 23 | src/urdf/* 24 | Copyright: 2008, Willow Garage, Inc. 25 | License: BSD-3-clause 26 | 27 | License: BSD-3-clause 28 | Software License Agreement (BSD License) 29 | . 30 | Copyright (c) 2008, Willow Garage, Inc. 31 | All rights reserved. 32 | . 33 | Redistribution and use in source and binary forms, with or without 34 | modification, are permitted provided that the following conditions 35 | are met: 36 | . 37 | * Redistributions of source code must retain the above copyright 38 | notice, this list of conditions and the following disclaimer. 39 | * Redistributions in binary form must reproduce the above 40 | copyright notice, this list of conditions and the following 41 | disclaimer in the documentation and/or other materials provided 42 | with the distribution. 43 | * Neither the name of the Willow Garage nor the names of its 44 | contributors may be used to endorse or promote products derived 45 | from this software without specific prior written permission. 46 | . 47 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 48 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 49 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 50 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 51 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 52 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 53 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 54 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 55 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 56 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 57 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 58 | POSSIBILITY OF SUCH DAMAGE. 59 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/share/doc/libsdformat8-dev/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: sdformat 3 | Upstream-Contact: gazebo-list@gazebosim.org 4 | Source: http://sdformat.org/ 5 | 6 | Files: * 7 | Copyright: 2011 Nate Koenig 8 | 2012 Open Source Robotics Foundation 9 | 2013 Open Source Robotics Foundation 10 | License: Apache 11 | See '/usr/share/common-licenses/Apache-2.0'. 12 | 13 | Files: test/gtest/* 14 | Copyright: 2003, Google Inc. 15 | 2005, Google Inc. 16 | 2006, Google Inc. 17 | 2007, Google Inc. 18 | 2008, Google Inc. 19 | 2009, Google Inc. 20 | License: BSD-3-clause 21 | 22 | Files: tools/check_test_ran.py 23 | src/urdf/* 24 | Copyright: 2008, Willow Garage, Inc. 25 | License: BSD-3-clause 26 | 27 | License: BSD-3-clause 28 | Software License Agreement (BSD License) 29 | . 30 | Copyright (c) 2008, Willow Garage, Inc. 31 | All rights reserved. 32 | . 33 | Redistribution and use in source and binary forms, with or without 34 | modification, are permitted provided that the following conditions 35 | are met: 36 | . 37 | * Redistributions of source code must retain the above copyright 38 | notice, this list of conditions and the following disclaimer. 39 | * Redistributions in binary form must reproduce the above 40 | copyright notice, this list of conditions and the following 41 | disclaimer in the documentation and/or other materials provided 42 | with the distribution. 43 | * Neither the name of the Willow Garage nor the names of its 44 | contributors may be used to endorse or promote products derived 45 | from this software without specific prior written permission. 46 | . 47 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 48 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 49 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 50 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 51 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 52 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 53 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 54 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 55 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 56 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 57 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 58 | POSSIBILITY OF SUCH DAMAGE. 59 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/lib/x86_64-linux-gnu/cmake/sdformat8/sdformat8-config.cmake: -------------------------------------------------------------------------------- 1 | # We explicitly set the desired cmake version to ensure that the policy settings 2 | # of users or of toolchains do not result in the wrong behavior for our modules. 3 | # Note that the call to find_package(~) will PUSH a new policy stack before 4 | # taking on these version settings, and then that stack will POP after the 5 | # find_package(~) has exited, so this will not affect the cmake policy settings 6 | # of a caller. 7 | cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) 8 | 9 | if(SDFormat_CONFIG_INCLUDED) 10 | return() 11 | endif() 12 | set(SDFormat_CONFIG_INCLUDED TRUE) 13 | 14 | 15 | ####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### 16 | ####### Any changes to this file will be overwritten by the next CMake run #### 17 | ####### The input file was sdf_config.cmake.in ######## 18 | 19 | get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../" ABSOLUTE) 20 | 21 | # Use original install prefix when loaded through a "/usr move" 22 | # cross-prefix symbolic link such as /lib -> /usr/lib. 23 | get_filename_component(_realCurr "${CMAKE_CURRENT_LIST_DIR}" REALPATH) 24 | get_filename_component(_realOrig "/usr/lib/x86_64-linux-gnu/cmake/sdformat8/" REALPATH) 25 | if(_realCurr STREQUAL _realOrig) 26 | set(PACKAGE_PREFIX_DIR "/usr") 27 | endif() 28 | unset(_realOrig) 29 | unset(_realCurr) 30 | 31 | macro(set_and_check _var _file) 32 | set(${_var} "${_file}") 33 | if(NOT EXISTS "${_file}") 34 | message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") 35 | endif() 36 | endmacro() 37 | 38 | #################################################################################### 39 | 40 | if(NOT TARGET sdformat8::sdformat8) 41 | include("${CMAKE_CURRENT_LIST_DIR}/sdformat8-targets.cmake") 42 | endif() 43 | 44 | list(APPEND SDFormat_INCLUDE_DIRS "/usr/include/sdformat-8.3") 45 | 46 | list(APPEND SDFormat_CFLAGS "-I/usr/include/sdformat-8.3") 47 | if (NOT WIN32) 48 | list(APPEND SDFormat_CXX_FLAGS "${SDFormat_CFLAGS} -std=c++17") 49 | endif() 50 | 51 | list(APPEND SDFormat_LIBRARY_DIRS "/usr/lib/x86_64-linux-gnu") 52 | 53 | set(SDFormat_LIBRARIES sdformat8::sdformat8) 54 | 55 | # These variables are used by ignition-cmake to automatically configure the 56 | # pkgconfig files for ignition projects. 57 | set(sdformat8_PKGCONFIG_ENTRY "sdformat8") 58 | set(sdformat8_PKGCONFIG_TYPE PKGCONFIG_REQUIRES) 59 | 60 | find_package(ignition-math6) 61 | list(APPEND SDFormat_INCLUDE_DIRS ${IGNITION-MATH_INCLUDE_DIRS}) 62 | list(APPEND SDFormat_LIBRARY_DIRS ${IGNITION-MATH_LIBRARY_DIRS}) 63 | 64 | list(APPEND SDFormat_LDFLAGS "-L/usr/lib/x86_64-linux-gnu") 65 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/parser_urdf.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDFORMAT_URDF2SDF_HH_ 18 | #define SDFORMAT_URDF2SDF_HH_ 19 | 20 | #include 21 | 22 | #include 23 | 24 | #include "sdf/Console.hh" 25 | #include 26 | #include "sdf/system_util.hh" 27 | 28 | namespace sdf 29 | { 30 | // Inline bracket to help doxygen filtering. 31 | inline namespace SDF_VERSION_NAMESPACE { 32 | // 33 | 34 | /// \brief URDF to SDF converter 35 | class SDFORMAT_VISIBLE URDF2SDF 36 | { 37 | /// \brief constructor 38 | public: URDF2SDF(); 39 | 40 | /// \brief destructor 41 | public: ~URDF2SDF(); 42 | 43 | /// \brief convert urdf xml document string to sdf xml document 44 | /// \param[in] _xmlDoc a tinyxml document containing the urdf model 45 | /// \return a tinyxml document containing sdf of the model 46 | public: TiXmlDocument InitModelDoc(TiXmlDocument* _xmlDoc); 47 | 48 | /// \brief convert urdf file to sdf xml document 49 | /// \param[in] _urdfStr a string containing filename of the urdf model 50 | /// \return a tinyxml document containing sdf of the model 51 | public: TiXmlDocument InitModelFile(const std::string &_filename); 52 | 53 | /// \brief convert urdf string to sdf xml document, with option to enforce 54 | /// limits. 55 | /// \param[in] _urdfStr a string containing model urdf 56 | /// \param[in] _enforceLimits option to enforce joint limits 57 | /// \return a tinyxml document containing sdf of the model 58 | public: TiXmlDocument InitModelString(const std::string &_urdfStr, 59 | bool _enforceLimits = true); 60 | 61 | /// \brief Return true if the filename is a URDF model. 62 | /// \param[in] _filename File to check. 63 | /// \return True if _filename is a URDF model. 64 | public: static bool IsURDF(const std::string &_filename); 65 | 66 | /// things that do not belong in urdf but should be mapped into sdf 67 | /// @todo: do this using sdf definitions, not hard coded stuff 68 | private: void ParseSDFExtension(TiXmlDocument &_urdfXml); 69 | 70 | /// list extensions for debugging 71 | private: void ListSDFExtensions(); 72 | 73 | /// list extensions for debugging 74 | private: void ListSDFExtensions(const std::string &_reference); 75 | }; 76 | } 77 | } 78 | #endif 79 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Box.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_BOX_HH_ 18 | #define SDF_BOX_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | namespace sdf 26 | { 27 | // Inline bracke to help doxygen filtering. 28 | inline namespace SDF_VERSION_NAMESPACE { 29 | // 30 | // Forward declare private data class. 31 | class BoxPrivate; 32 | 33 | /// \brief Box represents a box shape, and is usually accessed through a 34 | /// Geometry. 35 | class SDFORMAT_VISIBLE Box 36 | { 37 | /// \brief Constructor 38 | public: Box(); 39 | 40 | /// \brief Copy constructor 41 | /// \param[in] _box Box to copy. 42 | public: Box(const Box &_box); 43 | 44 | /// \brief Move constructor 45 | /// \param[in] _box Box to move. 46 | public: Box(Box &&_box) noexcept; 47 | 48 | /// \brief Move assignment operator. 49 | /// \param[in] _box Box to move. 50 | /// \return Reference to this. 51 | public: Box &operator=(Box &&_box); 52 | 53 | /// \brief Destructor 54 | public: virtual ~Box(); 55 | 56 | /// \brief Assignment operator. 57 | /// \param[in] _box The box to set values from. 58 | /// \return *this 59 | public: Box &operator=(const Box &_box); 60 | 61 | /// \brief Load the box geometry based on a element pointer. 62 | /// This is *not* the usual entry point. Typical usage of the SDF DOM is 63 | /// through the Root object. 64 | /// \param[in] _sdf The SDF Element pointer 65 | /// \return Errors, which is a vector of Error objects. Each Error includes 66 | /// an error code and message. An empty vector indicates no error. 67 | public: Errors Load(ElementPtr _sdf); 68 | 69 | /// \brief Get the box size in meters. 70 | /// \return Size of the box in meters. 71 | public: ignition::math::Vector3d Size() const; 72 | 73 | /// \brief Set the box size in meters. 74 | /// \param[in] _size Size of the box in meters. 75 | public: void SetSize(const ignition::math::Vector3d &_size); 76 | 77 | /// \brief Get a pointer to the SDF element that was used during 78 | /// load. 79 | /// \return SDF element pointer. The value will be nullptr if Load has 80 | /// not been called. 81 | public: sdf::ElementPtr Element() const; 82 | 83 | /// \brief Private data pointer. 84 | private: BoxPrivate *dataPtr; 85 | }; 86 | } 87 | } 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/auto-abi_TEST.py: -------------------------------------------------------------------------------- 1 | import os 2 | import unittest 3 | from auto_abi_checker.srcs_apt import SrcAptBase, SrcOSRFPkgGenerator 4 | from auto_abi_checker.srcs_ros import SrcROSRepoGenerator, SrcROSPkgGenerator 5 | from auto_abi_checker.srcs_local import SrcLocalDir 6 | from auto_abi_checker.abi_executor import ABIExecutor 7 | from auto_abi_checker.utils import _check_call 8 | from glob import glob 9 | 10 | 11 | class TestFlags(unittest.TestCase): 12 | def setUp(self): 13 | self.osrf = SrcOSRFPkgGenerator('test_osrf') 14 | self.ros1 = SrcROSRepoGenerator('test_ros', 'melodic') 15 | self.ros2 = SrcROSRepoGenerator('test_ros', 'dashing') 16 | self.abi_exe = ABIExecutor() 17 | 18 | def test_check_osrf_flags(self): 19 | self.assertEqual( 20 | '--std=c++17', 21 | self.abi_exe.get_compilation_flags(self.osrf, self.osrf)) 22 | 23 | def test_check_ros1_flags(self): 24 | self.assertEqual( 25 | '--std=c++14 -I/opt/ros/melodic/include', 26 | self.abi_exe.get_compilation_flags(self.ros1, self.ros1)) 27 | 28 | def test_check_combo_flags(self): 29 | self.assertEqual( 30 | '--std=c++17 -DBOOST_HAS_PTHREADS=1 -I/opt/ros/dashing/src/gtest_vendor/include -DRCUTILS__STDATOMIC_HELPER_H_ -DRTI_UNIX -I/opt/ros/dashing/include', 31 | self.abi_exe.get_compilation_flags(self.osrf, self.ros2)) 32 | 33 | 34 | class SrcTestPkg(SrcAptBase): 35 | def __init__(self, name): 36 | SrcAptBase.__init__(self, name) 37 | self.test_dir = os.path.dirname(os.path.abspath(__file__)) 38 | self.test_files_dir = os.path.join(self.test_dir, 'files') 39 | self.test_debs_dir = os.path.join(self.test_dir, 'debs') 40 | 41 | 42 | def get_deb_package_names(self, stub): 43 | return ['libsdformat8', 'libsdformat8-dev'] 44 | 45 | def download_deb_packages(self, stub): 46 | test_pkgs = glob(self.test_debs_dir + '/*.deb') 47 | for p in test_pkgs: 48 | _check_call(['cp', p, self.ws]) 49 | 50 | 51 | class TestBase(unittest.TestCase): 52 | def setUp(self): 53 | self.orig_class = SrcTestPkg('test_pkg') 54 | self.new_class = SrcLocalDir('test_local_dir') 55 | self.test_dir = os.path.dirname(os.path.abspath(__file__)) 56 | self.test_files_dir = os.path.join(self.test_dir, 'files') 57 | 58 | def test_run_apt(self): 59 | self.orig_class.run('stub') 60 | self.new_class.run(self.test_files_dir) 61 | abi_exe = ABIExecutor('12', '--std=c++17') 62 | abi_exe.run(self.orig_class, self.new_class) 63 | 64 | 65 | class TestROSPkg(unittest.TestCase): 66 | def setUp(self): 67 | self.rospkg = SrcROSPkgGenerator('test_ros_pkg', 'melodic') 68 | 69 | def test_deb_pkg_name(self): 70 | self.rospkg.run('ros-melodic-cpp-common') 71 | 72 | def test_ros_pkg_name(self): 73 | self.rospkg.run('cpp_common') 74 | 75 | def test_ros_multiple_names(self): 76 | self.rospkg.run('ros-melodic-rosclean,ros-melodic-cpp-common') 77 | 78 | 79 | if __name__ == '__main__': 80 | unittest.main() 81 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Sphere.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_SPHERE_HH_ 18 | #define SDF_SPHERE_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace sdf 25 | { 26 | // Inline bracket to help doxygen filtering. 27 | inline namespace SDF_VERSION_NAMESPACE { 28 | // 29 | 30 | // Forward declare private data class. 31 | class SpherePrivate; 32 | 33 | /// \brief Sphere represents a sphere shape, and is usually accessed through a 34 | /// Geometry. 35 | class SDFORMAT_VISIBLE Sphere 36 | { 37 | /// \brief Constructor 38 | public: Sphere(); 39 | 40 | /// \brief Copy constructor 41 | /// \param[in] _sphere Sphere to copy. 42 | public: Sphere(const Sphere &_sphere); 43 | 44 | /// \brief Move constructor 45 | /// \param[in] _sphere Sphere to move. 46 | public: Sphere(Sphere &&_sphere) noexcept; 47 | 48 | /// \brief Destructor 49 | public: virtual ~Sphere(); 50 | 51 | /// \brief Assignment operator. 52 | /// \param[in] _sphere The sphere to set values from. 53 | /// \return *this 54 | public: Sphere &operator=(const Sphere &_sphere); 55 | 56 | /// \brief Move assignment operator. 57 | /// \param[in] _sphere Sphere to move. 58 | /// \return Reference to this. 59 | public: Sphere &operator=(Sphere &&_sphere); 60 | 61 | /// \brief Load the sphere geometry based on a element pointer. 62 | /// This is *not* the usual entry point. Typical usage of the SDF DOM is 63 | /// through the Root object. 64 | /// \param[in] _sdf The SDF Element pointer 65 | /// \return Errors, which is a vector of Error objects. Each Error includes 66 | /// an error code and message. An empty vector indicates no error. 67 | public: Errors Load(ElementPtr _sdf); 68 | 69 | /// \brief Get the sphere's radius in meters. 70 | /// \return The radius of the sphere in meters. 71 | public: double Radius() const; 72 | 73 | /// \brief Set the sphere's radius in meters. 74 | /// \param[in] _radius The radius of the sphere in meters. 75 | public: void SetRadius(const double _radius); 76 | 77 | /// \brief Get a pointer to the SDF element that was used during 78 | /// load. 79 | /// \return SDF element pointer. The value will be nullptr if Load has 80 | /// not been called. 81 | public: sdf::ElementPtr Element() const; 82 | 83 | /// \brief Private data pointer. 84 | private: SpherePrivate *dataPtr; 85 | }; 86 | } 87 | } 88 | #endif 89 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Gui.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_GUI_HH_ 18 | #define SDF_GUI_HH_ 19 | 20 | #include "sdf/Element.hh" 21 | #include "sdf/Types.hh" 22 | #include "sdf/sdf_config.h" 23 | #include "sdf/system_util.hh" 24 | 25 | namespace sdf 26 | { 27 | // Inline bracke to help doxygen filtering. 28 | inline namespace SDF_VERSION_NAMESPACE { 29 | // 30 | 31 | // Forward declarations. 32 | class GuiPrivate; 33 | 34 | class SDFORMAT_VISIBLE Gui 35 | { 36 | /// \brief Default constructor 37 | public: Gui(); 38 | 39 | /// \brief Copy constructor 40 | /// \param[in] _gui Gui element to copy. 41 | public: Gui(const Gui &_gui); 42 | 43 | /// \brief Move constructor 44 | /// \param[in] _gui Gui to move. 45 | public: Gui(Gui &&_gui) noexcept; 46 | 47 | /// \brief Move assignment operator. 48 | /// \param[in] _gui Gui to move. 49 | /// \return Reference to this. 50 | public: Gui &operator=(Gui &&_gui); 51 | 52 | /// \brief Copy assignment operator. 53 | /// \param[in] _gui Gui to copy. 54 | /// \return Reference to this. 55 | public: Gui &operator=(const Gui &_gui); 56 | 57 | /// \brief Destructor 58 | public: ~Gui(); 59 | 60 | /// \brief Load the gui based on a element pointer. This is *not* the 61 | /// usual entry point. Typical usage of the SDF DOM is through the Root 62 | /// object. 63 | /// \param[in] _sdf The SDF Element pointer 64 | /// \return Errors, which is a vector of Error objects. Each Error includes 65 | /// an error code and message. An empty vector indicates no error. 66 | public: Errors Load(ElementPtr _sdf); 67 | 68 | /// \brief Get whether the Gui should be fullscreen. 69 | /// \return True if the Gui should be fullscreen. 70 | public: bool Fullscreen() const; 71 | 72 | /// \brief Set whether the Gui should be full screen. 73 | /// \param[in] _fullscreen True indicates that the Gui should be 74 | /// fullscreen. 75 | public: void SetFullscreen(const bool _fullscreen) const; 76 | 77 | /// \brief Equality operator that returns true if this Gui 78 | /// instance equals the given Gui instance. 79 | /// \param[in] _gui Gui instance to compare. 80 | /// \return True if this instance equals the given Gui. 81 | public: bool operator==(const Gui &_gui) const; 82 | 83 | /// \brief Get a pointer to the SDF element that was used during 84 | /// load. 85 | /// \return SDF element pointer. The value will be nullptr if Load has 86 | /// not been called. 87 | public: sdf::ElementPtr Element() const; 88 | 89 | /// \brief Private data pointer. 90 | private: GuiPrivate *dataPtr = nullptr; 91 | }; 92 | } 93 | } 94 | #endif 95 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Cylinder.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_CYLINDER_HH_ 18 | #define SDF_CYLINDER_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace sdf 25 | { 26 | // Inline bracke to help doxygen filtering. 27 | inline namespace SDF_VERSION_NAMESPACE { 28 | // 29 | 30 | // Forward declare private data class. 31 | class CylinderPrivate; 32 | 33 | /// \brief Cylinder represents a cylinder shape, and is usually accessed 34 | /// through a Geometry. 35 | class SDFORMAT_VISIBLE Cylinder 36 | { 37 | /// \brief Constructor 38 | public: Cylinder(); 39 | 40 | /// \brief Copy constructor 41 | /// \param[in] _cylinder Cylinder to copy. 42 | public: Cylinder(const Cylinder &_cylinder); 43 | 44 | /// \brief Move constructor 45 | /// \param[in] _cylinder Cylinder to move. 46 | public: Cylinder(Cylinder &&_cylinder) noexcept; 47 | 48 | /// \brief Destructor 49 | public: virtual ~Cylinder(); 50 | 51 | /// \brief Move assignment operator. 52 | /// \param[in] _cylinder Cylinder to move. 53 | /// \return Reference to this. 54 | public: Cylinder &operator=(Cylinder &&_cylinder); 55 | 56 | /// \brief Assignment operator. 57 | /// \param[in] _cylinder The cylinder to set values from. 58 | /// \return *this 59 | public: Cylinder &operator=(const Cylinder &_cylinder); 60 | 61 | /// \brief Load the cylinder geometry based on a element pointer. 62 | /// This is *not* the usual entry point. Typical usage of the SDF DOM is 63 | /// through the Root object. 64 | /// \param[in] _sdf The SDF Element pointer 65 | /// \return Errors, which is a vector of Error objects. Each Error includes 66 | /// an error code and message. An empty vector indicates no error. 67 | public: Errors Load(ElementPtr _sdf); 68 | 69 | /// \brief Get the cylinder's radius in meters. 70 | /// \return The radius of the cylinder in meters. 71 | public: double Radius() const; 72 | 73 | /// \brief Set the cylinder's radius in meters. 74 | /// \param[in] _radius The radius of the cylinder in meters. 75 | public: void SetRadius(const double _radius); 76 | 77 | /// \brief Get the cylinder's length in meters. 78 | /// \return The length of the cylinder in meters. 79 | public: double Length() const; 80 | 81 | /// \brief Set the cylinder's length in meters. 82 | /// \param[in] _length The length of the cylinder in meters. 83 | public: void SetLength(const double _length); 84 | 85 | /// \brief Get a pointer to the SDF element that was used during 86 | /// load. 87 | /// \return SDF element pointer. The value will be nullptr if Load has 88 | /// not been called. 89 | public: sdf::ElementPtr Element() const; 90 | 91 | /// \brief Private data pointer. 92 | private: CylinderPrivate *dataPtr; 93 | }; 94 | } 95 | } 96 | #endif 97 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Plane.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_PLANE_HH_ 18 | #define SDF_PLANE_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | namespace sdf 27 | { 28 | // Inline bracket to help doxygen filtering. 29 | inline namespace SDF_VERSION_NAMESPACE { 30 | // 31 | 32 | // Forward declare private data class. 33 | class PlanePrivate; 34 | 35 | /// \brief Plane represents a plane shape, and is usually accessed through a 36 | /// Geometry. 37 | class SDFORMAT_VISIBLE Plane 38 | { 39 | /// \brief Constructor 40 | public: Plane(); 41 | 42 | /// \brief Copy constructor 43 | /// \param[in] _plane Plane to copy. 44 | public: Plane(const Plane &_plane); 45 | 46 | /// \brief Move constructor 47 | /// \param[in] _plane Plane to move. 48 | public: Plane(Plane &&_plane) noexcept; 49 | 50 | /// \brief Destructor 51 | public: virtual ~Plane(); 52 | 53 | /// \brief Move assignment operator. 54 | /// \param[in] _plane Plane to move. 55 | /// \return Reference to this. 56 | public: Plane &operator=(Plane &&_plane); 57 | 58 | /// \brief Assignment operator. 59 | /// \param[in] _plane The plane to set values from. 60 | /// \return *this 61 | public: Plane &operator=(const Plane &_plane); 62 | 63 | /// \brief Load the plane geometry based on a element pointer. 64 | /// This is *not* the usual entry point. Typical usage of the SDF DOM is 65 | /// through the Root object. 66 | /// \param[in] _sdf The SDF Element pointer 67 | /// \return Errors, which is a vector of Error objects. Each Error includes 68 | /// an error code and message. An empty vector indicates no error. 69 | public: Errors Load(ElementPtr _sdf); 70 | 71 | /// \brief Get the plane normal vector. When a Plane is used as a geometry 72 | /// for a Visual or Collision object, then the normal is specified in the 73 | /// Visual or Collision frame, respectively. 74 | /// \return The plane normal vector. 75 | public: ignition::math::Vector3d Normal() const; 76 | 77 | /// \brief Set the plane normal vector. The _normal vector will be 78 | /// normalized. See ignition::math::Vector3d Normal() for more information 79 | /// about the normal vector, such as the frame in which it is specified. 80 | /// \param[in] _normal The plane normal vector. 81 | public: void SetNormal(const ignition::math::Vector3d &_normal); 82 | 83 | /// \brief Get the plane size in meters. 84 | /// \return The plane size in meters. 85 | public: ignition::math::Vector2d Size() const; 86 | 87 | /// \brief Set the plane size in meters. 88 | /// \param[in] _size The plane size in meters. 89 | public: void SetSize(const ignition::math::Vector2d &_size); 90 | 91 | /// \brief Get a pointer to the SDF element that was used during 92 | /// load. 93 | /// \return SDF element pointer. The value will be nullptr if Load has 94 | /// not been called. 95 | public: sdf::ElementPtr Element() const; 96 | 97 | /// \brief Private data pointer. 98 | private: PlanePrivate *dataPtr; 99 | }; 100 | } 101 | } 102 | #endif 103 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Altimeter.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_ALTIMETER_HH_ 18 | #define SDF_ALTIMETER_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | namespace sdf 26 | { 27 | // Inline bracket to help doxygen filtering. 28 | inline namespace SDF_VERSION_NAMESPACE { 29 | // 30 | class AltimeterPrivate; 31 | 32 | /// \brief Altimeter contains information about an altimeter sensor. 33 | /// This sensor can be attached to a link. 34 | class SDFORMAT_VISIBLE Altimeter 35 | { 36 | /// \brief Default constructor 37 | public: Altimeter(); 38 | 39 | /// \brief Copy constructor 40 | /// \param[in] _altimeter Altimeter to copy. 41 | public: Altimeter(const Altimeter &_altimeter); 42 | 43 | /// \brief Move constructor 44 | /// \param[in] _altimeter Altimeter to move. 45 | public: Altimeter(Altimeter &&_altimeter) noexcept; 46 | 47 | /// \brief Destructor 48 | public: ~Altimeter(); 49 | 50 | /// \brief Assignment operator. 51 | /// \param[in] _altimeter The altimeter to set values from. 52 | /// \return *this 53 | public: Altimeter &operator=(const Altimeter &_altimeter); 54 | 55 | /// \brief Move assignment operator. 56 | /// \param[in] _altimeter The altimeter to set values from. 57 | /// \return *this 58 | public: Altimeter &operator=(Altimeter &&_altimeter) noexcept; 59 | 60 | /// \brief Load the altimeter based on an element pointer. This is *not* 61 | /// the usual entry point. Typical usage of the SDF DOM is through the Root 62 | /// object. 63 | /// \param[in] _sdf The SDF Element pointer 64 | /// \return Errors, which is a vector of Error objects. Each Error includes 65 | /// an error code and message. An empty vector indicates no error. 66 | public: Errors Load(ElementPtr _sdf); 67 | 68 | /// \brief Get a pointer to the SDF element that was used during 69 | /// load. 70 | /// \return SDF element pointer. The value will be nullptr if Load has 71 | /// not been called. 72 | public: sdf::ElementPtr Element() const; 73 | 74 | /// \brief Get the noise values related to the vertical position. 75 | /// \return Noise values for the vertical position. 76 | public: const Noise &VerticalPositionNoise() const; 77 | 78 | /// \brief Set the noise values related to the vertical position. 79 | /// \param[in] _noise Noise values for the vertical position. 80 | public: void SetVerticalPositionNoise(const Noise &_noise); 81 | 82 | /// \brief Get the noise values related to the vertical velocity. 83 | /// \return Noise values for the vertical velocity. 84 | public: const Noise &VerticalVelocityNoise() const; 85 | 86 | /// \brief Set the noise values related to the vertical velocity. 87 | /// \param[in] _noise Noise values for the vertical velocity. 88 | public: void SetVerticalVelocityNoise(const Noise &_noise); 89 | 90 | /// \brief Return true if both Altimeter objects contain the same values. 91 | /// \param[_in] _alt Altimeter value to compare. 92 | /// \returen True if 'this' == _alt. 93 | public: bool operator==(const Altimeter &_alt) const; 94 | 95 | /// \brief Return true this Altimeter object does not contain the same 96 | /// values as the passed in parameter. 97 | /// \param[_in] _alt Altimeter value to compare. 98 | /// \returen True if 'this' != _alt. 99 | public: bool operator!=(const Altimeter &_alt) const; 100 | 101 | /// \brief Private data pointer. 102 | private: AltimeterPrivate *dataPtr; 103 | }; 104 | } 105 | } 106 | #endif 107 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Scene.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_SCENE_HH_ 18 | #define SDF_SCENE_HH_ 19 | 20 | #include 21 | 22 | #include "sdf/Element.hh" 23 | #include "sdf/Types.hh" 24 | #include "sdf/sdf_config.h" 25 | #include "sdf/system_util.hh" 26 | 27 | namespace sdf 28 | { 29 | // Inline bracket to help doxygen filtering. 30 | inline namespace SDF_VERSION_NAMESPACE { 31 | // 32 | 33 | // Forward declarations. 34 | class ScenePrivate; 35 | 36 | class SDFORMAT_VISIBLE Scene 37 | { 38 | /// \brief Default constructor 39 | public: Scene(); 40 | 41 | /// \brief Copy constructor 42 | /// \param[in] _scene Scene element to copy. 43 | public: Scene(const Scene &_scene); 44 | 45 | /// \brief Move constructor 46 | /// \param[in] _scene Scene to move. 47 | public: Scene(Scene &&_scene) noexcept; 48 | 49 | /// \brief Destructor 50 | public: ~Scene(); 51 | 52 | /// \brief Assignment operator. 53 | /// \param[in] _scene The scene to set values from. 54 | /// \return *this 55 | public: Scene &operator=(const Scene &_scene); 56 | 57 | /// \brief Move assignment operator. 58 | /// \param[in] _workflow The scene to move from. 59 | /// \return *this 60 | public: Scene &operator=(Scene &&_scene); 61 | 62 | /// \brief Load the scene based on a element pointer. This is *not* the 63 | /// usual entry point. Typical usage of the SDF DOM is through the Root 64 | /// object. 65 | /// \param[in] _sdf The SDF Element pointer 66 | /// \return Errors, which is a vector of Error objects. Each Error includes 67 | /// an error code and message. An empty vector indicates no error. 68 | public: Errors Load(ElementPtr _sdf); 69 | 70 | /// \brief Get the ambient color of the scene 71 | /// \return Scene ambient color 72 | public: ignition::math::Color Ambient() const; 73 | 74 | /// \brief Set the ambient color of the scene 75 | /// \param[in] _ambient Ambient color to set to 76 | public: void SetAmbient(const ignition::math::Color &_ambient); 77 | 78 | /// \brief Get the background color of the scene 79 | /// \return Scene background color 80 | public: ignition::math::Color Background() const; 81 | 82 | /// \brief Set the background color of the scene 83 | /// \param[in] _background Background color to set to 84 | public: void SetBackground(const ignition::math::Color &_background); 85 | 86 | /// \brief Get whether grid is enabled 87 | /// \return True if grid is enabled 88 | public: bool Grid() const; 89 | 90 | /// \brief Set whether the grid should be enabled 91 | /// \param[in] enabled True to enable grid 92 | public: void SetGrid(const bool _enabled); 93 | 94 | /// \brief Get whether origin visual is enabled 95 | /// \return True if origin visual is enabled 96 | public: bool OriginVisual() const; 97 | 98 | /// \brief Set whether the origin visual should be enabled 99 | /// \param[in] enabled True to enable origin visual 100 | public: void SetOriginVisual(const bool _enabled); 101 | 102 | /// \brief Get whether shadows are enabled 103 | /// \return True if shadows are enabled 104 | public: bool Shadows() const; 105 | 106 | /// \brief Set whether shadows should be enabled 107 | /// \param[in] enabled True to enable shadows 108 | public: void SetShadows(const bool _shadows); 109 | 110 | /// \brief Get a pointer to the SDF element that was used during 111 | /// load. 112 | /// \return SDF element pointer. The value will be nullptr if Load has 113 | /// not been called. 114 | public: sdf::ElementPtr Element() const; 115 | 116 | /// \brief Private data pointer. 117 | private: ScenePrivate *dataPtr = nullptr; 118 | }; 119 | } 120 | } 121 | #endif 122 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/lib/x86_64-linux-gnu/cmake/sdformat8/sdformat8-targets.cmake: -------------------------------------------------------------------------------- 1 | # Generated by CMake 2 | 3 | if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) 4 | message(FATAL_ERROR "CMake >= 2.6.0 required") 5 | endif() 6 | cmake_policy(PUSH) 7 | cmake_policy(VERSION 2.6) 8 | #---------------------------------------------------------------- 9 | # Generated CMake target import file. 10 | #---------------------------------------------------------------- 11 | 12 | # Commands may need to know the format version. 13 | set(CMAKE_IMPORT_FILE_VERSION 1) 14 | 15 | # Protect against multiple inclusion, which would fail when already imported targets are added once more. 16 | set(_targetsDefined) 17 | set(_targetsNotDefined) 18 | set(_expectedTargets) 19 | foreach(_expectedTarget sdformat8::sdformat8) 20 | list(APPEND _expectedTargets ${_expectedTarget}) 21 | if(NOT TARGET ${_expectedTarget}) 22 | list(APPEND _targetsNotDefined ${_expectedTarget}) 23 | endif() 24 | if(TARGET ${_expectedTarget}) 25 | list(APPEND _targetsDefined ${_expectedTarget}) 26 | endif() 27 | endforeach() 28 | if("${_targetsDefined}" STREQUAL "${_expectedTargets}") 29 | unset(_targetsDefined) 30 | unset(_targetsNotDefined) 31 | unset(_expectedTargets) 32 | set(CMAKE_IMPORT_FILE_VERSION) 33 | cmake_policy(POP) 34 | return() 35 | endif() 36 | if(NOT "${_targetsDefined}" STREQUAL "") 37 | message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") 38 | endif() 39 | unset(_targetsDefined) 40 | unset(_targetsNotDefined) 41 | unset(_expectedTargets) 42 | 43 | 44 | # Compute the installation prefix relative to this file. 45 | get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) 46 | # Use original install prefix when loaded through a 47 | # cross-prefix symbolic link such as /lib -> /usr/lib. 48 | get_filename_component(_realCurr "${_IMPORT_PREFIX}" REALPATH) 49 | get_filename_component(_realOrig "/usr/lib/x86_64-linux-gnu/cmake/sdformat8" REALPATH) 50 | if(_realCurr STREQUAL _realOrig) 51 | set(_IMPORT_PREFIX "/usr/lib/x86_64-linux-gnu/cmake/sdformat8") 52 | endif() 53 | unset(_realOrig) 54 | unset(_realCurr) 55 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 56 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 57 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 58 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 59 | if(_IMPORT_PREFIX STREQUAL "/") 60 | set(_IMPORT_PREFIX "") 61 | endif() 62 | 63 | # Create imported target sdformat8::sdformat8 64 | add_library(sdformat8::sdformat8 SHARED IMPORTED) 65 | 66 | set_target_properties(sdformat8::sdformat8 PROPERTIES 67 | INTERFACE_INCLUDE_DIRECTORIES "/usr/include/ignition/math6;${_IMPORT_PREFIX}/include/sdformat-8.3/sdf/.." 68 | INTERFACE_LINK_LIBRARIES "ignition-math6::requested" 69 | ) 70 | 71 | if(CMAKE_VERSION VERSION_LESS 2.8.12) 72 | message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.") 73 | endif() 74 | 75 | # Load information for each installed configuration. 76 | get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 77 | file(GLOB CONFIG_FILES "${_DIR}/sdformat8-targets-*.cmake") 78 | foreach(f ${CONFIG_FILES}) 79 | include(${f}) 80 | endforeach() 81 | 82 | # Cleanup temporary variables. 83 | set(_IMPORT_PREFIX) 84 | 85 | # Loop over all imported files and verify that they actually exist 86 | foreach(target ${_IMPORT_CHECK_TARGETS} ) 87 | foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) 88 | if(NOT EXISTS "${file}" ) 89 | message(FATAL_ERROR "The imported target \"${target}\" references the file 90 | \"${file}\" 91 | but this file does not exist. Possible reasons include: 92 | * The file was deleted, renamed, or moved to another location. 93 | * An install or uninstall procedure did not complete successfully. 94 | * The installation package was faulty and contained 95 | \"${CMAKE_CURRENT_LIST_FILE}\" 96 | but not all the files it references. 97 | ") 98 | endif() 99 | endforeach() 100 | unset(_IMPORT_CHECK_FILES_FOR_${target}) 101 | endforeach() 102 | unset(_IMPORT_CHECK_TARGETS) 103 | 104 | # This file does not depend on other imported targets which have 105 | # been exported from the same project but in a separate export set. 106 | 107 | # Commands beyond this point should not need to know the version. 108 | set(CMAKE_IMPORT_FILE_VERSION) 109 | cmake_policy(POP) 110 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Magnetometer.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_MAGNETOMETER_HH_ 18 | #define SDF_MAGNETOMETER_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | namespace sdf 26 | { 27 | // Inline bracke to help doxygen filtering. 28 | inline namespace SDF_VERSION_NAMESPACE { 29 | // 30 | class MagnetometerPrivate; 31 | 32 | /// \brief Magnetometer contains information about a magnetometer sensor. 33 | /// This sensor can be attached to a link. 34 | class SDFORMAT_VISIBLE Magnetometer 35 | { 36 | /// \brief Default constructor 37 | public: Magnetometer(); 38 | 39 | /// \brief Copy constructor 40 | /// \param[in] _magnetometer Magnetometer to copy. 41 | public: Magnetometer(const Magnetometer &_magnetometer); 42 | 43 | /// \brief Move constructor 44 | /// \param[in] _magnetometer Magnetometer to move. 45 | public: Magnetometer(Magnetometer &&_magnetometer) noexcept; 46 | 47 | /// \brief Destructor 48 | public: ~Magnetometer(); 49 | 50 | /// \brief Assignment operator. 51 | /// \param[in] _magnetometer The magnetometer to set values from. 52 | /// \return *this 53 | public: Magnetometer &operator=(const Magnetometer &_magnetometer); 54 | 55 | /// \brief Move assignment operator. 56 | /// \param[in] _magnetometer The magnetometer to set values from. 57 | /// \return *this 58 | public: Magnetometer &operator=(Magnetometer &&_magnetometer); 59 | 60 | /// \brief Load the magnetometer based on an element pointer. This is *not* 61 | /// the usual entry point. Typical usage of the SDF DOM is through the Root 62 | /// object. 63 | /// \param[in] _sdf The SDF Element pointer 64 | /// \return Errors, which is a vector of Error objects. Each Error includes 65 | /// an error code and message. An empty vector indicates no error. 66 | public: Errors Load(ElementPtr _sdf); 67 | 68 | /// \brief Get a pointer to the SDF element that was used during 69 | /// load. 70 | /// \return SDF element pointer. The value will be nullptr if Load has 71 | /// not been called. 72 | public: sdf::ElementPtr Element() const; 73 | 74 | /// \brief Get the noise values related to the body-frame x axis. 75 | /// \return Noise values for the x axis. 76 | public: const Noise &XNoise() const; 77 | 78 | /// \brief Set the noise values related to the body-frame x axis. 79 | /// \param[in] _noise Noise values for the x axis. 80 | public: void SetXNoise(const Noise &_noise); 81 | 82 | /// \brief Get the noise values related to the body-frame y axis. 83 | /// \return Noise values for the y axis. 84 | public: const Noise &YNoise() const; 85 | 86 | /// \brief Set the noise values related to the body-frame y axis. 87 | /// \param[in] _noise Noise values for the y axis. 88 | public: void SetYNoise(const Noise &_noise); 89 | 90 | /// \brief Get the noise values related to the body-frame z axis. 91 | /// \return Noise values for the z axis. 92 | public: const Noise &ZNoise() const; 93 | 94 | /// \brief Set the noise values related to the body-frame z axis. 95 | /// \param[in] _noise Noise values for the z axis. 96 | public: void SetZNoise(const Noise &_noise); 97 | 98 | /// \brief Return true if both Magnetometer objects contain the same values. 99 | /// \param[_in] _mag Magnetometer value to compare. 100 | /// \returen True if 'this' == _mag. 101 | public: bool operator==(const Magnetometer &_mag) const; 102 | 103 | /// \brief Return true this Magnetometer object does not contain the same 104 | /// values as the passed in parameter. 105 | /// \param[_in] _mag Magnetometer value to compare. 106 | /// \returen True if 'this' != _mag. 107 | public: bool operator!=(const Magnetometer &_mag) const; 108 | 109 | /// \brief Private data pointer. 110 | private: MagnetometerPrivate *dataPtr; 111 | }; 112 | } 113 | } 114 | #endif 115 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/AirPressure.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_AIRPRESSURE_HH_ 18 | #define SDF_AIRPRESSURE_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | namespace sdf 26 | { 27 | // Inline bracke to help doxygen filtering. 28 | inline namespace SDF_VERSION_NAMESPACE { 29 | // 30 | class AirPressurePrivate; 31 | 32 | /// \brief AirPressure contains information about a general 33 | /// purpose fluid pressure sensor. 34 | /// This sensor can be attached to a link. 35 | class SDFORMAT_VISIBLE AirPressure 36 | { 37 | /// \brief Default constructor 38 | public: AirPressure(); 39 | 40 | /// \brief Copy constructor 41 | /// \param[in] _airPressure AirPressure to copy. 42 | public: AirPressure(const AirPressure &_sensor); 43 | 44 | /// \brief Move constructor 45 | /// \param[in] _airPressure AirPressure to move. 46 | public: AirPressure(AirPressure &&_sensor); 47 | 48 | /// \brief Destructor 49 | public: ~AirPressure(); 50 | 51 | /// \brief Assignment operator. 52 | /// \param[in] _airPressure The airPressure to set values 53 | /// from. 54 | /// \return *this 55 | public: AirPressure &operator=(const AirPressure &_sensor); 56 | 57 | /// \brief Move assignment operator. 58 | /// \param[in] _airPressure The airPressure to set values 59 | /// from. 60 | /// \return *this 61 | public: AirPressure &operator=(AirPressure &&_sensor); 62 | 63 | /// \brief Load the airPressure based on an element pointer. 64 | /// This is *not* the usual entry point. Typical usage of the SDF DOM is 65 | /// through the Root object. 66 | /// \param[in] _sdf The SDF Element pointer 67 | /// \return Errors, which is a vector of Error objects. Each Error includes 68 | /// an error code and message. An empty vector indicates no error. 69 | public: Errors Load(ElementPtr _sdf); 70 | 71 | /// \brief Get a pointer to the SDF element that was used during 72 | /// load. 73 | /// \return SDF element pointer. The value will be nullptr if Load has 74 | /// not been called. 75 | public: sdf::ElementPtr Element() const; 76 | 77 | /// \brief Get the reference altitude of the sensor in meters. This value 78 | /// can be used by a sensor implementation to augment the altitude of the 79 | /// sensor. For example, if you are using simulation instead of creating a 80 | /// 1000 m mountain model on which to place your sensor, you could instead 81 | /// set this value to 1000 and place your model on a ground plane with a Z 82 | /// height of zero. 83 | /// \return Reference altitude in meters. 84 | public: double ReferenceAltitude() const; 85 | 86 | /// \brief Set the reference altitude of the sensor in meters. 87 | /// \sa ReferenceAltitude() 88 | /// \param[in] _ref Reference altitude in meters. 89 | public: void SetReferenceAltitude(double _ref); 90 | 91 | /// \brief Get the noise values. 92 | /// \return Noise values for pressure data. 93 | public: const Noise &PressureNoise() const; 94 | 95 | /// \brief Set the noise values related to the pressure data. 96 | /// \param[in] _noise Noise values for the pressure data. 97 | public: void SetPressureNoise(const Noise &_noise); 98 | 99 | /// \brief Return true if both AirPressure objects contain the 100 | /// same values. 101 | /// \param[_in] _mag AirPressure value to compare. 102 | /// \returen True if 'this' == _mag. 103 | public: bool operator==(const AirPressure &_air) const; 104 | 105 | /// \brief Return true this AirPressure object does not contain 106 | /// the same values as the passed in parameter. 107 | /// \param[_in] _mag AirPressure value to compare. 108 | /// \returen True if 'this' != _mag. 109 | public: bool operator!=(const AirPressure &_air) const; 110 | 111 | /// \brief Private data pointer. 112 | private: AirPressurePrivate *dataPtr; 113 | }; 114 | } 115 | } 116 | #endif 117 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Mesh.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_MESH_HH_ 18 | #define SDF_MESH_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | namespace sdf 27 | { 28 | // Inline bracket to help doxygen filtering. 29 | inline namespace SDF_VERSION_NAMESPACE { 30 | // 31 | 32 | // Forward declare private data class. 33 | class MeshPrivate; 34 | 35 | /// \brief Mesh represents a mesh shape, and is usually accessed through a 36 | /// Geometry. 37 | class SDFORMAT_VISIBLE Mesh 38 | { 39 | /// \brief Constructor 40 | public: Mesh(); 41 | 42 | /// \brief Copy constructor 43 | /// \param[in] _mesh Mesh to copy. 44 | public: Mesh(const Mesh &_mesh); 45 | 46 | /// \brief Move constructor 47 | /// \param[in] _mesh Mesh to move. 48 | public: Mesh(Mesh &&_mesh) noexcept; 49 | 50 | /// \brief Destructor 51 | public: virtual ~Mesh(); 52 | 53 | /// \brief Move assignment operator. 54 | /// \param[in] _mesh Mesh to move. 55 | /// \return Reference to this. 56 | public: Mesh &operator=(Mesh &&_mesh); 57 | 58 | /// \brief Copy Assignment operator. 59 | /// \param[in] _mesh The mesh to set values from. 60 | /// \return *this 61 | public: Mesh &operator=(const Mesh &_mesh); 62 | 63 | /// \brief Load the mesh geometry based on a element pointer. 64 | /// This is *not* the usual entry point. Typical usage of the SDF DOM is 65 | /// through the Root object. 66 | /// \param[in] _sdf The SDF Element pointer 67 | /// \return Errors, which is a vector of Error objects. Each Error includes 68 | /// an error code and message. An empty vector indicates no error. 69 | public: Errors Load(ElementPtr _sdf); 70 | 71 | /// \brief Get the mesh's URI. 72 | /// \return The URI of the mesh data. 73 | public: std::string Uri() const; 74 | 75 | /// \brief Set the mesh's URI. 76 | /// \param[in] _uri The URI of the mesh. 77 | public: void SetUri(const std::string &_uri); 78 | 79 | /// \brief Get the mesh's scale factor. 80 | /// \return The mesh's scale factor. 81 | public: ignition::math::Vector3d Scale() const; 82 | 83 | /// \brief Set the mesh's scale factor. 84 | /// \return The mesh's scale factor. 85 | public: void SetScale(const ignition::math::Vector3d &_scale); 86 | 87 | /// \brief A submesh, contained with the mesh at the specified URI, may 88 | /// optionally be specified. If specified, this submesh should be used 89 | /// instead of the entire mesh. 90 | /// \return The name of the submesh within the mesh at the specified URI. 91 | public: std::string Submesh() const; 92 | 93 | /// \brief Set the mesh's submesh. See Submesh() for more information. 94 | /// \param[in] _submesh Name of the submesh. The name should match a submesh 95 | /// within the mesh at the specified URI. 96 | public: void SetSubmesh(const std::string &_submesh); 97 | 98 | /// \brief Get whether the submesh should be centered at 0,0,0. This will 99 | /// effectively remove any transformations on the submesh before the poses 100 | /// from parent links and models are applied. The return value is only 101 | /// applicable if a SubMesh has been specified. 102 | /// \return True if the submesh should be centered. 103 | public: bool CenterSubmesh() const; 104 | 105 | /// \brief Set whether the submesh should be centered. See CenterSubmesh() 106 | /// for more information. 107 | /// \param[in] _center True to center the submesh. 108 | public: void SetCenterSubmesh(const bool _center); 109 | 110 | /// \brief Get a pointer to the SDF element that was used during load. 111 | /// \return SDF element pointer. The value will be nullptr if Load has 112 | /// not been called. 113 | public: sdf::ElementPtr Element() const; 114 | 115 | /// \brief Private data pointer. 116 | private: MeshPrivate *dataPtr; 117 | }; 118 | } 119 | } 120 | #endif 121 | -------------------------------------------------------------------------------- /src/auto_abi_checker/srcs_ros.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright 2018 Open Robotics 4 | # Licensed under the Apache License, Version 2.0 5 | 6 | import glob 7 | from os import environ 8 | from os.path import join 9 | import rosdistro 10 | 11 | from auto_abi_checker.srcs_apt import SrcAptBase 12 | from auto_abi_checker.utils import error, comma_list_to_array 13 | from auto_abi_checker.ros_utils import clean_non_default_dss_files 14 | 15 | 16 | class SrcROSBase(SrcAptBase): 17 | def __init__(self, name, ros_distro): 18 | SrcAptBase.__init__(self, name) 19 | self.ros_distro = self.detect_ros_distribution(ros_distro) 20 | self.rosdistro_index = rosdistro.get_index(rosdistro.get_index_url()) 21 | self.cache = rosdistro.get_distribution_cache(self.rosdistro_index, 22 | self.ros_distro) 23 | self.distro_file = self.cache.distribution_file 24 | # More logic could be needed with new ros distributions 25 | # ROS1 - https://www.ros.org/reps/rep-0003.html 26 | # ROS2 - http://design.ros2.org/articles/changes.html 27 | if self.ros_distro == 'melodic': 28 | self.compilation_flags.append('--std=c++14') 29 | else: 30 | self.compilation_flags.append('--std=c++17') 31 | # needed for gazebo_ros_pkgs 32 | self.compilation_flags.append('-DBOOST_HAS_PTHREADS=1') 33 | # gtest-vendor is ROS2 34 | self.compilation_flags.append('-I' + 35 | join('/opt/ros/', self.ros_distro, 'src', 'gtest_vendor', 'include')) 36 | # flag to avoid problems in rcutils 37 | # https://github.com/osrf/auto-abi-checker/issues/17 38 | self.compilation_flags.append('-DRCUTILS__STDATOMIC_HELPER_H_') 39 | # flags for rmw_connext packages 40 | self.compilation_flags.append('-DRTI_UNIX') 41 | for rti_path in glob.glob('/opt/rti.com/rti_connext_dds-*'): 42 | self.compilation_flags.append('-I' + rti_path + '/include/') 43 | self.compilation_flags.append('-I' + rti_path + '/include/ndds') 44 | # Needs to add /opt/ros includes to compile ROS software 45 | self.compilation_flags.append('-I' + 46 | join('/opt/ros/', self.ros_distro, 'include')) 47 | 48 | def detect_ros_distribution(self, user_ros_distro): 49 | if user_ros_distro: 50 | return user_ros_distro 51 | try: 52 | if environ['ROS_DISTRO']: 53 | return environ['ROS_DISTRO'] 54 | error("Not ROS distribution provided or ROS_DISTRO environment var") 55 | except KeyError: 56 | error("ROS_DISTRO environment variable not found") 57 | 58 | def get_debian_package_name_prefix(self): 59 | return 'ros-%s-' % self.ros_distro 60 | 61 | def get_debian_ros_package_name(self, ros_package_name): 62 | return '%s%s' % \ 63 | (self.get_debian_package_name_prefix(), 64 | ros_package_name.replace('_', '-')) 65 | 66 | def filter_files(self): 67 | clean_non_default_dss_files(self.ws_files) 68 | 69 | 70 | class SrcROSRepoGenerator(SrcROSBase): 71 | def __init__(self, name, ros_distro=''): 72 | SrcROSBase.__init__(self, name, ros_distro) 73 | 74 | def validate_repo(self, ros_repo): 75 | keys = self.distro_file.repositories.keys() 76 | if ros_repo in keys: 77 | return True 78 | 79 | return False 80 | 81 | def get_release_repo(self, ros_repo): 82 | return self.distro_file.repositories[ros_repo].release_repository 83 | 84 | def validate(self, ros_repo): 85 | # Check that repo exists in ROS 86 | if (not self.validate_repo(ros_repo)): 87 | error("ROS repository " + ros_repo + 88 | " not found in the rosdistro index") 89 | 90 | def get_deb_package_names(self, ros_repo): 91 | ros_pkgs = self.get_release_repo(ros_repo).package_names 92 | return [self.get_debian_ros_package_name(p) 93 | for p in ros_pkgs] 94 | 95 | 96 | class SrcROSPkgGenerator(SrcROSBase): 97 | def __init__(self, name, ros_distro=''): 98 | SrcROSBase.__init__(self, name, ros_distro) 99 | self.ros_deb_packages = [] 100 | 101 | def is_debian_package(self, pkg): 102 | if pkg.startswith('ros-'): 103 | return True 104 | return False 105 | 106 | def validate(self, ros_pkgs): 107 | for pkg in comma_list_to_array(ros_pkgs): 108 | deb_pkg = pkg 109 | if not self.is_debian_package(pkg): 110 | deb_pkg = self.get_debian_ros_package_name(pkg) 111 | self.ros_deb_packages.append(deb_pkg) 112 | 113 | def get_deb_package_names(self, ros_pkgs): 114 | return self.ros_deb_packages 115 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Atmosphere.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_ATMOSPHERE_HH_ 18 | #define SDF_ATMOSPHERE_HH_ 19 | 20 | #include 21 | #include "sdf/Element.hh" 22 | #include "sdf/Types.hh" 23 | #include "sdf/sdf_config.h" 24 | #include "sdf/system_util.hh" 25 | 26 | namespace sdf 27 | { 28 | // Inline bracket to help doxygen filtering. 29 | inline namespace SDF_VERSION_NAMESPACE { 30 | // 31 | /// \enum AtmosphereType 32 | /// \brief The set of atmosphere model types. 33 | enum class AtmosphereType 34 | { 35 | /// \brief Adiabatic atmosphere model. 36 | ADIABATIC = 0, 37 | }; 38 | 39 | // Forward declarations. 40 | class AtmospherePrivate; 41 | 42 | /// \brief The Atmosphere class contains information about 43 | /// an atmospheric model and related parameters such as temperature 44 | /// and pressure at sea level. An Atmosphere instance is optionally part of 45 | /// a World. 46 | class SDFORMAT_VISIBLE Atmosphere 47 | { 48 | /// \brief Default constructor 49 | public: Atmosphere(); 50 | 51 | /// \brief Copy constructor 52 | /// \param[in] _atmosphere Atmosphere to copy. 53 | public: Atmosphere(const Atmosphere &_atmosphere); 54 | 55 | /// \brief Move constructor 56 | /// \param[in] _atmosphere Atmosphere to move. 57 | public: Atmosphere(Atmosphere &&_atmosphere) noexcept; 58 | 59 | /// \brief Move assignment operator. 60 | /// \param[in] _atmosphere Atmosphere to move. 61 | /// \return Reference to this. 62 | public: Atmosphere &operator=(Atmosphere &&_atmosphere); 63 | 64 | /// \brief Copy assignment operator. 65 | /// \param[in] _atmosphere Atmosphere to copy. 66 | /// \return Reference to this. 67 | public: Atmosphere &operator=(const Atmosphere &_atmosphere); 68 | 69 | /// \brief Destructor 70 | public: ~Atmosphere(); 71 | 72 | /// \brief Load the atmosphere based on a element pointer. This is *not* the 73 | /// usual entry point. Typical usage of the SDF DOM is through the Root 74 | /// object. 75 | /// \param[in] _sdf The SDF Element pointer 76 | /// \return Errors, which is a vector of Error objects. Each Error includes 77 | /// an error code and message. An empty vector indicates no error. 78 | public: Errors Load(ElementPtr _sdf); 79 | 80 | /// \brief Get the type of the atmospheric model. 81 | /// \return The type of atmosphere engine, which defaults to adiabatic. 82 | public: AtmosphereType Type() const; 83 | 84 | /// \brief Set the type of the atmospheric model. 85 | /// \param[in] _type The type of atmosphere engine. 86 | public: void SetType(const AtmosphereType _type); 87 | 88 | /// \brief Get the temperature at sea level. 89 | /// \return The temperature at sea level. 90 | public: ignition::math::Temperature Temperature() const; 91 | 92 | /// \brief Set the temperature at sea level. 93 | /// \param[in] _temp The temperature at sea level. 94 | public: void SetTemperature(const ignition::math::Temperature &_temp); 95 | 96 | /// \brief Get the temperature gradient with respect to increasing 97 | /// altitude in units of K/m. 98 | /// \return The temperature gradient in K/m. 99 | public: double TemperatureGradient() const; 100 | 101 | /// \brief Set the temperature gradient with respect to increasing 102 | /// altitude in units of K/m. 103 | /// \param[in] _gradient The temperature gradient in K/m. 104 | public: void SetTemperatureGradient(const double _gradient); 105 | 106 | /// \brief Get the pressure at sea level in pascals. 107 | /// \return The pressure at sea level in pascals. 108 | public: double Pressure() const; 109 | 110 | /// \brief Set the pressure at sea level in pascals. 111 | /// \param[in] _pressure The pressure at sea level in pascals. 112 | public: void SetPressure(const double _pressure); 113 | 114 | /// \brief Equality operator that returns true if this atmosphere 115 | /// instance equals the given atmosphere instance. 116 | /// \param[in] _atmosphere Atmosphere instance to compare. 117 | /// \return True if this instance equals the given atmosphere. 118 | public: bool operator==(const Atmosphere &_atmosphere); 119 | 120 | /// \brief Private data pointer. 121 | private: AtmospherePrivate *dataPtr = nullptr; 122 | }; 123 | } 124 | } 125 | #endif 126 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Collision.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_COLLISION_HH_ 18 | #define SDF_COLLISION_HH_ 19 | 20 | #include 21 | #include 22 | #include "sdf/Element.hh" 23 | #include "sdf/Types.hh" 24 | #include "sdf/sdf_config.h" 25 | #include "sdf/system_util.hh" 26 | 27 | namespace sdf 28 | { 29 | // Inline bracke to help doxygen filtering. 30 | inline namespace SDF_VERSION_NAMESPACE { 31 | // 32 | // Forward declaration. 33 | class CollisionPrivate; 34 | class Geometry; 35 | 36 | /// \brief A collision element descibes the collison properties associated 37 | /// with a link. This can be different from the visual properties of a link. 38 | /// For example, simple collision models are often used to reduce 39 | /// computation time. 40 | class SDFORMAT_VISIBLE Collision 41 | { 42 | /// \brief Default constructor 43 | public: Collision(); 44 | 45 | /// \brief Copy constructor 46 | /// \param[in] _collision Collision to copy. 47 | public: Collision(const Collision &_collision); 48 | 49 | /// \brief Move constructor 50 | /// \param[in] _collision Collision to move. 51 | public: Collision(Collision &&_collision) noexcept; 52 | 53 | /// \brief Move assignment operator. 54 | /// \param[in] _collision Collision to move. 55 | /// \return Reference to this. 56 | public: Collision &operator=(Collision &&_collision); 57 | 58 | /// \brief Copy assignment operator. 59 | /// \param[in] _collision Collision to copy. 60 | /// \return Reference to this. 61 | public: Collision &operator=(const Collision &_collision); 62 | 63 | /// \brief Destructor 64 | public: ~Collision(); 65 | 66 | /// \brief Load the collision based on a element pointer. This is *not* the 67 | /// usual entry point. Typical usage of the SDF DOM is through the Root 68 | /// object. 69 | /// \param[in] _sdf The SDF Element pointer 70 | /// \return Errors, which is a vector of Error objects. Each Error includes 71 | /// an error code and message. An empty vector indicates no error. 72 | public: Errors Load(ElementPtr _sdf); 73 | 74 | /// \brief Get the name of the collision. 75 | /// The name of the collision must be unique within the scope of a Link. 76 | /// \return Name of the collision. 77 | public: std::string Name() const; 78 | 79 | /// \brief Set the name of the collision. 80 | /// The name of the collision must be unique within the scope of a Link. 81 | /// \param[in] _name Name of the collision. 82 | public: void SetName(const std::string &_name) const; 83 | 84 | /// \brief Get a pointer to the collisions's geometry. 85 | /// \return The collision's geometry. 86 | public: const Geometry *Geom() const; 87 | 88 | /// \brief Set the collision's geometry 89 | /// \param[in] _geom The geometry of the collision object 90 | public: void SetGeom(const Geometry &_geom); 91 | 92 | /// \brief Get the pose of the collision object. This is the pose of the 93 | /// collison as specified in SDF 94 | /// ( ... ). 95 | /// \return The pose of the collision object. 96 | public: const ignition::math::Pose3d &Pose() const; 97 | 98 | /// \brief Set the pose of the collision object. 99 | /// \sa const ignition::math::Pose3d &Pose() const 100 | /// \param[in] _pose The pose of the collision object. 101 | public: void SetPose(const ignition::math::Pose3d &_pose); 102 | 103 | /// \brief Get the name of the coordinate frame in which this collision 104 | /// object's pose is expressed. A empty value indicates that the frame is 105 | /// the parent link. 106 | /// \return The name of the pose frame. 107 | public: const std::string &PoseFrame() const; 108 | 109 | /// \brief Set the name of the coordinate frame in which this collision 110 | /// object's pose is expressed. A empty value indicates that the frame is 111 | /// the parent link. 112 | /// \param[in] _frame The name of the pose frame. 113 | public: void SetPoseFrame(const std::string &_frame); 114 | 115 | /// \brief Get a pointer to the SDF element that was used during 116 | /// load. 117 | /// \return SDF element pointer. The value will be nullptr if Load has 118 | /// not been called. 119 | public: sdf::ElementPtr Element() const; 120 | 121 | /// \brief Private data pointer. 122 | private: CollisionPrivate *dataPtr = nullptr; 123 | }; 124 | } 125 | } 126 | #endif 127 | -------------------------------------------------------------------------------- /src/auto_abi_checker/auto-abi.py: -------------------------------------------------------------------------------- 1 | #!python 2 | 3 | # Copyright 2018 Open Robotics 4 | # Licensed under the Apache License, Version 2.0 5 | """ 6 | Usage: 7 | auto-abi --orig-type --orig --new-type --new [--report-dir ] [--no-fail-if-empty] [--never-fail] [--display-exec-time] 8 | auto-abi (-h | --help) 9 | auto-abi --version 10 | 11 | orig-type: 12 | local-dir Code to check is a local directory 13 | Use full path to installation dir 14 | osrf-pkg Code to check is a OSRF package 15 | Use repository name for value (i.e. sdformat7) 16 | ros-pkg Use the ROS package name. It can be fully qualified 17 | (i.e ros-melodic-gazebo-dev) or a ROS name 18 | (i.e gazebo_dev). Multiple packages are supported, 19 | comma separated. 20 | ros-repo Code to check is a ROS repository 21 | Use repository name for value (i.e gazebo_ros_pkgs) 22 | ros-ws Code to check is a ROS workspace 23 | Use full path to install directory of catkin/colcon ws 24 | 25 | Options: 26 | -h --help Show this screen 27 | --version Show auto-abi version 28 | --report_dir Generate compat report in 29 | --no-fail-if-empty Return 0 if the abi checker does not found object files 30 | --never-fail Return 0 always even in the presence of errors 31 | --display-exec-time Show the execution time of this script 32 | """ 33 | 34 | import datetime 35 | import re 36 | import subprocess 37 | from sys import stderr, argv 38 | from time import time 39 | from docopt import docopt 40 | from auto_abi_checker.generator import SrcGenerator 41 | from auto_abi_checker.abi_executor import ABIExecutor 42 | from auto_abi_checker.utils import error, AppError, info 43 | 44 | 45 | def normalize_args(args): 46 | orig_type = args[""] 47 | orig_value = args[""] 48 | 49 | new_type = args[""] 50 | new_value = args[""] 51 | 52 | report_dir = args[""] 53 | no_fail_if_emtpy = args["--no-fail-if-empty"] 54 | never_fail = args["--never-fail"] 55 | display_exec_time = args["--display-exec-time"] 56 | 57 | return orig_type, orig_value, new_type, new_value, report_dir, no_fail_if_emtpy, never_fail, display_exec_time 58 | 59 | 60 | def check_type(value_type): 61 | if (value_type == 'ros-repo' or 62 | value_type == 'ros-pkg' or 63 | value_type == 'ros-ws' or 64 | value_type == 'osrf-pkg' or 65 | value_type == 'local-dir'): 66 | True 67 | else: 68 | error("Unknow type " + value_type) 69 | 70 | 71 | def validate_input(args): 72 | orig_type, orig_value, new_type, new_value, report_dir, no_fail_if_emtpy, never_fail, display_exec_time = args 73 | 74 | if (check_type(orig_type) and check_type(new_type)): 75 | return True 76 | 77 | return False 78 | 79 | 80 | def process_input(args, cmd_executed, tolerance_levels): 81 | orig_type, orig_value, new_type, new_value, report_dir, no_fail_if_emtpy, never_fail, display_exec_time = args 82 | 83 | if display_exec_time: 84 | start = time() 85 | 86 | try: 87 | generator = SrcGenerator() 88 | src_gen = generator.generate(orig_type, 'orig') 89 | src_gen.run(orig_value) 90 | new_gen = generator.generate(new_type, 'new') 91 | new_gen.run(new_value) 92 | 93 | abi_exe = ABIExecutor(tolerance_levels) 94 | abi_exe.run(src_gen, 95 | new_gen, 96 | report_dir, 97 | no_fail_if_emtpy, 98 | auto_abi_cmd_executed=cmd_executed) 99 | 100 | if display_exec_time: 101 | exec_time = time() - start 102 | info("Execution time: " + str(datetime.timedelta(seconds=exec_time))) 103 | except Exception as e: 104 | print(str(e)) 105 | if never_fail: 106 | print(" [warn] detected errors but return 0 since --never-fail option is enabled", file=stderr) 107 | else: 108 | exit(-1) 109 | 110 | 111 | def get_abi_checker_version(): 112 | output = subprocess.check_output(["abi-compliance-checker", "--version"]) 113 | vregex = re.compile(r'\d.\d') 114 | mo = vregex.search(output.decode("utf-8")) 115 | return mo.group(0) 116 | 117 | 118 | def main(): 119 | try: 120 | version = "0.1.14" 121 | tolerance_levels = "12" 122 | cmd_executed = ' '.join(argv[:]) 123 | args = normalize_args(docopt(__doc__, version="auto-abi " + version)) 124 | validate_input(args) 125 | print("[ auto-abi-checker " + version + " :: " + 126 | "abi-compliance-checker " + get_abi_checker_version() + 127 | " (tolerance: " + tolerance_levels + ") ] ") 128 | process_input(args, cmd_executed, tolerance_levels) 129 | except KeyboardInterrupt: 130 | print("auto-abi was stopped with a Keyboard Interrupt.\n") 131 | 132 | 133 | if __name__ == '__main__': 134 | main() 135 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Physics.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_PHYSICS_HH_ 18 | #define SDF_PHYSICS_HH_ 19 | 20 | #include 21 | 22 | #include "sdf/Element.hh" 23 | #include "sdf/Types.hh" 24 | #include "sdf/sdf_config.h" 25 | #include "sdf/system_util.hh" 26 | 27 | namespace sdf 28 | { 29 | // Inline bracket to help doxygen filtering. 30 | inline namespace SDF_VERSION_NAMESPACE { 31 | // 32 | 33 | // Forward declare private data class. 34 | class PhysicsPrivate; 35 | 36 | /// \brief The physics element specifies the type and properties of a 37 | /// dynamics engine. 38 | class SDFORMAT_VISIBLE Physics 39 | { 40 | /// \brief Default constructor 41 | public: Physics(); 42 | 43 | /// \brief Copy constructor 44 | /// \param[in] _physics Physics to copy. 45 | public: Physics(const Physics &_physics); 46 | 47 | /// \brief Move constructor 48 | /// \param[in] _physics Physics to move. 49 | public: Physics(Physics &&_physics) noexcept; 50 | 51 | /// \brief Move assignment operator. 52 | /// \param[in] _physics Physics to move. 53 | /// \return Reference to this. 54 | public: Physics &operator=(Physics &&_physics); 55 | 56 | /// \brief Copy assignment operator. 57 | /// \param[in] _physics Physics to copy. 58 | /// \return Reference to this. 59 | public: Physics &operator=(const Physics &_physics); 60 | 61 | /// \brief Destructor 62 | public: ~Physics(); 63 | 64 | /// \brief Load the physics based on an element pointer. This is *not* the 65 | /// usual entry point. Typical usage of the SDF DOM is through the Root 66 | /// object. 67 | /// \param[in] _sdf The SDF Element pointer 68 | /// \return Errors, which is a vector of Error objects. Each Error includes 69 | /// an error code and message. An empty vector indicates no error. 70 | public: Errors Load(ElementPtr _sdf); 71 | 72 | /// \brief Get the name of this set of physics parameters. 73 | /// \return Name of the physics profile. 74 | public: std::string Name() const; 75 | 76 | /// \brief Set the name of this set of physics parameters. 77 | /// \param[in] _name Name of the physics profile. 78 | public: void SetName(const std::string &_name) const; 79 | 80 | /// \brief Get a pointer to the SDF element that was used during 81 | /// load. 82 | /// \return SDF element pointer. The value will be nullptr if Load has 83 | /// not been called. 84 | public: sdf::ElementPtr Element() const; 85 | 86 | /// \brief Get whether this physics profile is marked as default. 87 | /// If true, this physics profile is set as the default physics profile 88 | /// for the World. If multiple default physics elements exist, the first 89 | /// physics profile marked as default is chosen. If no default physics 90 | /// element exists, the first physics element is chosen. 91 | /// \return True if this profile is the default. 92 | public: bool IsDefault() const; 93 | 94 | /// \brief Set whether this physics profile is the default. 95 | /// \param[in] _default True to make this profile default. 96 | public: void SetDefault(const bool _default) const; 97 | 98 | /// \brief Get the physics profile dynamics engine type. 99 | /// Current options are ode, bullet, simbody and dart. Defaults to ode if 100 | /// left unspecified. 101 | /// \return The type of dynamics engine. 102 | public: std::string EngineType() const; 103 | 104 | /// \brief Set the physics profile dynamics engine type. 105 | /// \param[in] _type The type of dynamics engine. 106 | public: void SetEngineType(const std::string &_type); 107 | 108 | /// \brief Get the max step size in seconds. 109 | /// The Maximum time step size at which every system in simulation can 110 | /// interact with the states of the world. 111 | /// \return The max step size in seconds. 112 | public: double MaxStepSize() const; 113 | 114 | /// \brief Set the max step size in seconds. 115 | /// \param[in] _step The max step size in seconds. 116 | public: void SetMaxStepSize(const double _step); 117 | 118 | /// \brief Get the target real time factor. 119 | /// Target simulation speedup factor, defined by ratio of simulation time 120 | /// to real-time. 121 | /// \return The target real time factor. 122 | public: double RealTimeFactor() const; 123 | 124 | /// \brief Set the target realtime factor. 125 | /// \param[in] _factor The target real time factor. 126 | public: void SetRealTimeFactor(const double _factor); 127 | 128 | /// \brief Private data pointer. 129 | private: PhysicsPrivate *dataPtr = nullptr; 130 | }; 131 | } 132 | } 133 | #endif 134 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/lib/ruby/ignition/cmdsdformat8.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ruby 2 | 3 | # Copyright (C) 2017 Open Source Robotics Foundation 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # We use 'dl' for Ruby <= 1.9.x and 'fiddle' for Ruby >= 2.0.x 18 | if RUBY_VERSION.split('.')[0] < '2' 19 | require 'dl' 20 | require 'dl/import' 21 | include DL 22 | else 23 | require 'fiddle' 24 | require 'fiddle/import' 25 | include Fiddle 26 | end 27 | 28 | require 'optparse' 29 | 30 | # Constants. 31 | LIBRARY_NAME = 'libsdformat8.so' 32 | LIBRARY_VERSION = '8.3.0' 33 | COMMON_OPTIONS = 34 | " -h [ --help ] Print this help message.\n"\ 35 | " --force-version Use a specific library version.\n"\ 36 | ' --versions Show the available versions.' 37 | COMMANDS = { 'sdf' => 38 | "Utilities for SDF files.\n\n"\ 39 | " ign sdf [options]\n\n"\ 40 | "Options:\n\n"\ 41 | " -k [ --check ] arg Validate arg.\n" + 42 | " -d [ --describe ] Print the SDF description.\n" + 43 | " -p [ --print ] arg Print converted arg.\n" + 44 | COMMON_OPTIONS 45 | } 46 | 47 | # 48 | # Class for the SDF command line tools. 49 | # 50 | class Cmd 51 | 52 | # 53 | # Return a structure describing the options. 54 | # 55 | def parse(args) 56 | options = {} 57 | 58 | usage = COMMANDS[args[0]] 59 | 60 | # Read the command line arguments. 61 | opt_parser = OptionParser.new do |opts| 62 | opts.banner = usage 63 | 64 | opts.on('-h', '--help", "Print this help message') do 65 | puts usage 66 | exit(0) 67 | end 68 | 69 | opts.on('-k arg', '--check arg', String, 70 | 'Validate arg') do |arg| 71 | options['check'] = arg 72 | end 73 | opts.on('-d', '--describe', 'Print the SDF description') do |v| 74 | options['describe'] = v 75 | end 76 | opts.on('-p arg', '--print arg', String, 77 | 'Print converted arg') do |arg| 78 | options['print'] = arg 79 | end 80 | end 81 | begin 82 | opt_parser.parse!(args) 83 | rescue 84 | puts usage 85 | exit(-1) 86 | end 87 | 88 | # Check that there is at least one command and there is a plugin that knows 89 | # how to handle it. 90 | if ARGV.empty? || !COMMANDS.key?(ARGV[0]) || 91 | options.empty? 92 | puts usage 93 | exit(-1) 94 | end 95 | 96 | options['command'] = ARGV[0] 97 | 98 | options 99 | end 100 | 101 | # 102 | # Execute the command 103 | # 104 | def execute(args) 105 | options = parse(args) 106 | 107 | # Debugging: 108 | # puts 'Parsed:' 109 | # puts options 110 | 111 | # Read the plugin that handles the command. 112 | plugin = LIBRARY_NAME 113 | conf_version = LIBRARY_VERSION 114 | 115 | begin 116 | Importer.dlload plugin 117 | rescue => exception 118 | puts "Library error: #{exception.message}" 119 | exit(-1) 120 | end 121 | 122 | # Read the library version. 123 | Importer.extern 'char* ignitionVersion()' 124 | begin 125 | plugin_version = Importer.ignitionVersion.to_s 126 | rescue DLError 127 | puts "Library error: Problem running 'ignitionVersion()' from #{plugin}." 128 | exit(-1) 129 | end 130 | 131 | # Sanity check: Verify that the version of the yaml file matches the version 132 | # of the library that we are using. 133 | unless plugin_version.eql? conf_version 134 | puts "Error: Version mismatch. Your configuration file version is 135 | [#{conf_version}] but #{plugin} version is [#{plugin_version}]." 136 | exit(-1) 137 | end 138 | 139 | begin 140 | case options['command'] 141 | when 'sdf' 142 | if options.key?('check') 143 | Importer.extern 'int cmdCheck(const char *)' 144 | exit(Importer.cmdCheck(options['check'])) 145 | elsif options.key?('describe') 146 | Importer.extern 'int cmdDescribe()' 147 | exit(Importer.cmdDescribe()) 148 | elsif options.key?('print') 149 | Importer.extern 'int cmdPrint(const char *)' 150 | exit(Importer.cmdPrint(options['print'])) 151 | else 152 | puts 'Command error: I do not have an implementation '\ 153 | 'for this command.' 154 | end 155 | else 156 | puts 'Command error: I do not have an implementation for '\ 157 | "command [ign #{options['command']}]." 158 | end 159 | rescue 160 | puts "Library error: Problem running [#{options['command']}]() "\ 161 | "from #{plugin}." 162 | end 163 | end 164 | end 165 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Visual.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_VISUAL_HH_ 18 | #define SDF_VISUAL_HH_ 19 | 20 | #include 21 | #include 22 | #include "sdf/Box.hh" 23 | #include "sdf/Cylinder.hh" 24 | #include "sdf/Element.hh" 25 | #include "sdf/Material.hh" 26 | #include "sdf/Plane.hh" 27 | #include "sdf/Sphere.hh" 28 | #include "sdf/Types.hh" 29 | #include "sdf/sdf_config.h" 30 | #include "sdf/system_util.hh" 31 | 32 | namespace sdf 33 | { 34 | // Inline bracket to help doxygen filtering. 35 | inline namespace SDF_VERSION_NAMESPACE { 36 | // 37 | 38 | // Forward declarations. 39 | class VisualPrivate; 40 | class Geometry; 41 | 42 | class SDFORMAT_VISIBLE Visual 43 | { 44 | /// \brief Default constructor 45 | public: Visual(); 46 | 47 | /// \brief Copy constructor 48 | /// \param[in] _visual Visual to copy. 49 | public: Visual(const Visual &_visual); 50 | 51 | /// \brief Move constructor 52 | /// \param[in] _visual Visual to move. 53 | public: Visual(Visual &&_visual) noexcept; 54 | 55 | /// \brief Move assignment operator. 56 | /// \param[in] _visual Visual to move. 57 | /// \return Reference to this. 58 | public: Visual &operator=(Visual &&_visual); 59 | 60 | /// \brief Copy assignment operator. 61 | /// \param[in] _visual Visual to copy. 62 | /// \return Reference to this. 63 | public: Visual &operator=(const Visual &_visual); 64 | 65 | /// \brief Destructor 66 | public: ~Visual(); 67 | 68 | /// \brief Load the visual based on a element pointer. This is *not* the 69 | /// usual entry point. Typical usage of the SDF DOM is through the Root 70 | /// object. 71 | /// \param[in] _sdf The SDF Element pointer 72 | /// \return Errors, which is a vector of Error objects. Each Error includes 73 | /// an error code and message. An empty vector indicates no error. 74 | public: Errors Load(ElementPtr _sdf); 75 | 76 | /// \brief Get the name of the visual. 77 | /// The name of the visual must be unique within the scope of a Link. 78 | /// \return Name of the visual. 79 | public: std::string Name() const; 80 | 81 | /// \brief Set the name of the visual. 82 | /// The name of the visual must be unique within the scope of a Link. 83 | /// \param[in] _name Name of the visual. 84 | public: void SetName(const std::string &_name) const; 85 | 86 | /// \brief Get a pointer to the visual's geometry. 87 | /// \return The visual's geometry. 88 | public: const Geometry *Geom() const; 89 | 90 | /// \brief Set the visual's geometry 91 | /// \param[in] _geom The geometry of the visual object 92 | public: void SetGeom(const Geometry &_geom); 93 | 94 | /// \brief Get the pose of the visual object. This is the pose of the 95 | /// visual as specified in SDF 96 | /// ( ... ). 97 | /// \return The pose of the visual object. 98 | public: const ignition::math::Pose3d &Pose() const; 99 | 100 | /// \brief Set the pose of the visual object. 101 | /// \sa const ignition::math::Pose3d &Pose() const 102 | /// \param[in] _pose The pose of the visual object. 103 | public: void SetPose(const ignition::math::Pose3d &_pose); 104 | 105 | /// \brief Get the name of the coordinate frame in which this visual 106 | /// object's pose is expressed. A empty value indicates that the frame is 107 | /// the parent link. 108 | /// \return The name of the pose frame. 109 | public: const std::string &PoseFrame() const; 110 | 111 | /// \brief Set the name of the coordinate frame in which this visual 112 | /// object's pose is expressed. A empty value indicates that the frame is 113 | /// the parent link. 114 | /// \return The name of the pose frame. 115 | public: void SetPoseFrame(const std::string &_pose); 116 | 117 | /// \brief Get a pointer to the SDF element that was used during 118 | /// load. 119 | /// \return SDF element pointer. The value will be nullptr if Load has 120 | /// not been called. 121 | public: sdf::ElementPtr Element() const; 122 | 123 | /// \brief Get a pointer to the visual's material properties. This can 124 | /// be a nullptr if material properties have not been set. 125 | /// \return Pointer to the visual's material properties. Nullptr 126 | /// indicates that material properties have not been set. 127 | public: sdf::Material *Material() const; 128 | 129 | /// \brief Set the visual's material 130 | /// \param[in] _material The material of the visual object 131 | public: void SetMaterial(const sdf::Material &_material); 132 | 133 | /// \brief Private data pointer. 134 | private: VisualPrivate *dataPtr = nullptr; 135 | }; 136 | } 137 | } 138 | #endif 139 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Filesystem.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | #ifndef SDF_FILESYSTEM_HH_ 19 | #define SDF_FILESYSTEM_HH_ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | #include "sdf/system_util.hh" 26 | 27 | #ifdef _WIN32 28 | // Disable warning C4251 which is triggered by 29 | // std::unique_ptr 30 | #pragma warning(push) 31 | #pragma warning(disable: 4251) 32 | #endif 33 | 34 | namespace sdf 35 | { 36 | namespace filesystem 37 | { 38 | // Inline bracke to help doxygen filtering. 39 | inline namespace SDF_VERSION_NAMESPACE { 40 | // 41 | 42 | /// \brief Determine whether the given path exists on the filesystem. 43 | /// \param[in] _path The path to check for existence 44 | /// \return True if the path exists on the filesystem, false otherwise. 45 | SDFORMAT_VISIBLE 46 | bool exists(const std::string &_path); 47 | 48 | /// \brief Determine whether the given path is a directory. 49 | /// \param[in] _path The path to check 50 | /// \return True if given path exists and is a directory, false otherwise. 51 | SDFORMAT_VISIBLE 52 | bool is_directory(const std::string &_path); 53 | 54 | /// \brief Create a new directory on the filesystem. Intermediate 55 | /// directories must already exist. 56 | /// \param[in] _path The new directory path to create 57 | /// \return True if directory creation was successful, false otherwise. 58 | SDFORMAT_VISIBLE 59 | bool create_directory(const std::string &_path); 60 | 61 | // The below is C++ variadic template magic to allow an append 62 | // method that takes 1-n number of arguments to append together. 63 | 64 | /// \brief Append the preferred path separator character for this platform 65 | /// onto the passed-in string. 66 | /// \param[in] _s The path to start with. 67 | /// \return The original path with the platform path separator appended. 68 | SDFORMAT_VISIBLE 69 | std::string const separator(std::string const &_s); 70 | 71 | /// \brief Append one or more additional path elements to the first 72 | /// passed in argument. 73 | /// \param[in] args The paths to append together 74 | /// \return A new string with the paths appended together. 75 | template 76 | std::string append(Args const &... args) 77 | { 78 | std::string result; 79 | int unpack[] { 80 | 0, (result += separator(args), 0)...}; 81 | static_cast(unpack); 82 | return result.substr(0, result.length() - 1); 83 | } 84 | 85 | /// \brief Get the current working path. 86 | /// \return Current working path if successful, the empty path on error. 87 | SDFORMAT_VISIBLE 88 | std::string current_path(); 89 | 90 | /// \brief Given a path, get just the basename portion. 91 | /// \param[in] _path The full path. 92 | /// \return A new string with just the basename portion of the path. 93 | SDFORMAT_VISIBLE 94 | std::string basename(const std::string &_path); 95 | 96 | /// \internal 97 | class DirIterPrivate; 98 | 99 | /// \class DirIter Filesystem.hh 100 | /// \brief A class for iterating over all items in a directory. 101 | class SDFORMAT_VISIBLE DirIter 102 | { 103 | /// \brief Constructor. 104 | /// \param[in] _in Directory to iterate over. 105 | public: explicit DirIter(const std::string &_in); 106 | 107 | /// \brief Constructor for end element. 108 | public: DirIter(); 109 | 110 | /// \brief Dereference operator; returns current directory record. 111 | /// \return A string representing the entire path of the directory record. 112 | public: std::string operator*() const; 113 | 114 | /// \brief Pre-increment operator; moves to next directory record. 115 | /// \return This iterator. 116 | public: const DirIter& operator++(); 117 | 118 | /// \brief Comparison operator to see if this iterator is at the 119 | /// same point as another iterator. 120 | /// \param[in] _other The other iterator to compare against. 121 | /// \return true if the iterators are equal, false otherwise. 122 | public: bool operator!=(const DirIter &_other) const; 123 | 124 | /// \brief Destructor 125 | public: ~DirIter(); 126 | 127 | /// \brief Move to the next directory record, skipping . and .. records. 128 | private: void next(); 129 | 130 | /// \brief Set the internal variable to the empty string. 131 | private: void set_internal_empty(); 132 | 133 | /// \brief Close an open directory handle. 134 | private: void close_handle(); 135 | 136 | /// \brief Private data. 137 | private: std::unique_ptr dataPtr; 138 | }; 139 | } 140 | } 141 | } 142 | 143 | #ifdef _WIN32 144 | #pragma warning(pop) 145 | #endif 146 | 147 | #endif 148 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/SDFImpl.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDFIMPL_HH_ 18 | #define SDFIMPL_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "sdf/Param.hh" 25 | #include "sdf/Element.hh" 26 | #include "sdf/sdf_config.h" 27 | #include "sdf/system_util.hh" 28 | #include "sdf/Types.hh" 29 | 30 | #ifdef _WIN32 31 | // Disable warning C4251 which is triggered by 32 | // std::unique_ptr 33 | #pragma warning(push) 34 | #pragma warning(disable: 4251) 35 | #endif 36 | 37 | /// \ingroup sdf_parser 38 | /// \brief namespace for Simulation Description Format parser 39 | namespace sdf 40 | { 41 | // Inline bracket to help doxygen filtering. 42 | inline namespace SDF_VERSION_NAMESPACE { 43 | // 44 | 45 | class SDFORMAT_VISIBLE SDF; 46 | class SDFPrivate; 47 | 48 | /// \def SDFPtr 49 | /// \brief Shared pointer to SDF 50 | typedef std::shared_ptr SDFPtr; 51 | 52 | /// \addtogroup sdf 53 | /// \{ 54 | 55 | /// \brief Find the absolute path of a file. 56 | /// \param[in] _filename Name of the file to find. 57 | /// \param[in] _searchLocalPath True to search for the file in the current 58 | /// working directory. 59 | /// \param[in] _useCallback True to find a file based on a registered 60 | /// callback if the file is not found via the normal mechanism. 61 | /// \return File's full path. 62 | SDFORMAT_VISIBLE 63 | std::string findFile(const std::string &_filename, 64 | bool _searchLocalPath = true, 65 | bool _useCallback = false); 66 | 67 | /// \brief Associate paths to a URI. 68 | /// Example paramters: "model://", "/usr/share/models:~/.gazebo/models" 69 | /// \param[in] _uri URI that will be mapped to _path 70 | /// \param[in] _path Colon separated set of paths. 71 | SDFORMAT_VISIBLE 72 | void addURIPath(const std::string &_uri, const std::string &_path); 73 | 74 | /// \brief Set the callback to use when SDF can't find a file. 75 | /// The callback should return a complete path to the requested file, or 76 | /// and empty string if the file was not found in the callback. 77 | /// \param[in] _cb The callback function. 78 | SDFORMAT_VISIBLE 79 | void setFindCallback(std::function _cb); 80 | 81 | 82 | /// \brief Base SDF class 83 | class SDFORMAT_VISIBLE SDF 84 | { 85 | public: SDF(); 86 | /// \brief Destructor 87 | public: ~SDF(); 88 | public: void PrintDescription(); 89 | public: void PrintValues(); 90 | public: void PrintDoc(); 91 | public: void Write(const std::string &_filename); 92 | public: std::string ToString() const; 93 | 94 | /// \brief Set SDF values from a string 95 | public: void SetFromString(const std::string &_sdfData); 96 | 97 | /// \brief Get a pointer to the root element 98 | /// \return Pointer to the root element 99 | public: ElementPtr Root() const; 100 | 101 | /// \brief Set the root pointer 102 | /// \param[in] _root Root element 103 | public: void Root(const ElementPtr _root); 104 | 105 | /// \brief Get the version 106 | /// \return The version as a string 107 | public: static std::string Version(); 108 | 109 | /// \brief Set the version string 110 | /// \param[in] _version SDF version string. 111 | public: static void Version(const std::string &_version); 112 | 113 | /// \brief wraps the SDF element into a root element with the version info. 114 | /// \param[in] _sdf the sdf element. Will be cloned by this function. 115 | /// \return a wrapped clone of the SDF element 116 | public: static ElementPtr WrapInRoot(const ElementPtr &_sdf); 117 | 118 | /// \brief Get a string representation of an SDF specification file. 119 | /// This function uses a built-in version of a .sdf file located in 120 | /// the sdf directory. The parser.cc code uses this function, which avoids 121 | /// touching the filesystem. 122 | /// 123 | /// Most people should not use this function. 124 | /// 125 | /// \param[in] _filename Base name of the SDF specification file to 126 | /// load. For example "root.sdf" or "world.sdf". 127 | /// \param[in] _quiet True to suppress console messages. 128 | /// \return A string that contains the contents of the specified 129 | /// _filename. An empty string is returned if the _filename could not be 130 | /// found. 131 | public: static const std::string &EmbeddedSpec( 132 | const std::string &_filename, const bool _quiet); 133 | 134 | /// \internal 135 | /// \brief Pointer to private data. 136 | private: std::unique_ptr dataPtr; 137 | 138 | /// \brief The SDF version. Set to SDF_VERSION by default, or through 139 | /// the Version function at runtime. 140 | private: static std::string version; 141 | }; 142 | /// \} 143 | } 144 | } 145 | 146 | #ifdef _WIN32 147 | #pragma warning(pop) 148 | #endif 149 | 150 | #endif 151 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Error.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_ERROR_HH_ 18 | #define SDF_ERROR_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | #include "sdf/system_util.hh" 24 | 25 | #ifdef _WIN32 26 | // Disable warning C4251 which is triggered by 27 | // std::string 28 | #pragma warning(push) 29 | #pragma warning(disable: 4251) 30 | #endif 31 | 32 | namespace sdf 33 | { 34 | // Inline bracke to help doxygen filtering. 35 | inline namespace SDF_VERSION_NAMESPACE { 36 | // 37 | 38 | /// \enum ErrorCode 39 | /// \brief Set of error codes. Usually one or more errors are returned in 40 | /// an Errors vector. The collection of Errors should be take as a whole, 41 | /// where an error toward the beginning of the vector can inform errors 42 | /// toward the end of the vector. 43 | /// \sa Errors 44 | enum class ErrorCode 45 | { 46 | // \brief No error 47 | NONE = 0, 48 | 49 | /// \brief Indicates that reading an SDF file failed. 50 | FILE_READ, 51 | 52 | /// \brief A duplicate name was found for an element where unique names 53 | /// are required. 54 | DUPLICATE_NAME, 55 | 56 | /// \brief Indicates that a required SDF attribute is missing. 57 | ATTRIBUTE_MISSING, 58 | 59 | /// \brief This error indicates that an SDF attribute is invalid. 60 | ATTRIBUTE_INVALID, 61 | 62 | /// \brief This error indicates that an SDF attribute is deprecated. 63 | ATTRIBUTE_DEPRECATED, 64 | 65 | /// \brief Indicates that a required SDF element is missing. 66 | ELEMENT_MISSING, 67 | 68 | /// \brief This error indicates that an SDF element is invalid. 69 | ELEMENT_INVALID, 70 | 71 | /// \brief This error indicates that an SDF element is deprecated. 72 | ELEMENT_DEPRECATED, 73 | 74 | /// \brief Indicates that an incorrect SDF element type was 75 | /// encountered. This error is used when an element of certain type is 76 | /// expected, and an element of a different type was received. 77 | ELEMENT_INCORRECT_TYPE, 78 | 79 | /// \brief A URI is invalid. 80 | URI_INVALID, 81 | 82 | /// \brief A error occured while trying to resolve a URI. 83 | URI_LOOKUP, 84 | 85 | /// \brief A filesystem directory does not exist. 86 | DIRECTORY_NONEXISTANT, 87 | 88 | /// \brief A link has invalid inertia. 89 | LINK_INERTIA_INVALID, 90 | 91 | /// \brief Indicates that reading an SDF string failed. 92 | STRING_READ, 93 | }; 94 | 95 | class SDFORMAT_VISIBLE Error 96 | { 97 | /// \brief default constructor 98 | public: Error() = default; 99 | 100 | /// \brief Constructor. 101 | /// \param[in] _code The error code. 102 | /// \param[in] _message A description of the error. 103 | /// \sa ErrorCode. 104 | public: Error(const ErrorCode _code, const std::string &_message); 105 | 106 | /// \brief Get the error code. 107 | /// \return An error code. 108 | /// \sa ErrorCode. 109 | public: ErrorCode Code() const; 110 | 111 | /// \brief Get the error message, which is a description of the error. 112 | /// \return Error message. 113 | public: std::string Message() const; 114 | 115 | /// \brief Safe bool conversion. 116 | /// \return True if this Error's Code() != NONE. In otherwords, this is 117 | /// true when there is an error. 118 | public: explicit operator bool() const; 119 | 120 | /// \brief Compare this Error to a boolean value. 121 | /// \return True if the boolean evaluation of this Error equals _value. 122 | /// If _value == false, then true is returned when this Error's Code() is 123 | /// equal to NONE and false is returned otherwise. If _value == true, 124 | /// then true is returned when this Error's Code() is not equal to NONE 125 | /// and false is returned otherwise. 126 | /// \sa explicit operator bool() const 127 | public: bool operator==(const bool _value) const; 128 | 129 | /// \brief Output operator for an error. 130 | /// \param[in,out] _out The output stream. 131 | /// \param[in] _err The error to output. 132 | /// \return Reference to the given output stream 133 | public: friend std::ostream &operator<<(std::ostream &_out, 134 | const sdf::Error &_err) 135 | { 136 | _out << "Error Code " 137 | << static_cast::type>(_err.Code()) 138 | << " Msg: " << _err.Message(); 139 | return _out; 140 | } 141 | 142 | /// \brief The error code value. 143 | private: ErrorCode code = ErrorCode::NONE; 144 | 145 | #ifdef _WIN32 146 | // Disable warning C4251 which is triggered by 147 | // std::string 148 | #pragma warning(push) 149 | #pragma warning(disable: 4251) 150 | #endif 151 | /// \brief Description of the error. 152 | private: std::string message = ""; 153 | #ifdef _WIN32 154 | #pragma warning(pop) 155 | #endif 156 | }; 157 | } 158 | } 159 | #ifdef _WIN32 160 | #pragma warning(pop) 161 | #endif 162 | 163 | 164 | #endif 165 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Exception.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | #ifndef SDF_EXCEPTION_HH_ 19 | #define SDF_EXCEPTION_HH_ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include "sdf/system_util.hh" 29 | 30 | #ifdef _WIN32 31 | // Disable warning C4251 which is triggered by 32 | // std::unique_ptr 33 | #pragma warning(push) 34 | #pragma warning(disable: 4251) 35 | #endif 36 | 37 | namespace sdf 38 | { 39 | // Inline bracke to help doxygen filtering. 40 | inline namespace SDF_VERSION_NAMESPACE { 41 | // 42 | 43 | /// \addtogroup sdf 44 | /// \{ 45 | 46 | /// \brief This macro logs an error to the throw stream and throws 47 | /// an exception that contains the file name and line number. 48 | #define sdfthrow(msg) {std::ostringstream throwStream;\ 49 | throwStream << msg << std::endl << std::flush;\ 50 | throw sdf::Exception(__FILE__, __LINE__, throwStream.str()); } 51 | 52 | class ExceptionPrivate; 53 | 54 | /// \class Exception Exception.hh common/common.hh 55 | /// \brief Class for generating exceptions 56 | class SDFORMAT_VISIBLE Exception 57 | { 58 | /// \brief Constructor 59 | public: Exception(); 60 | 61 | /// \brief Default constructor 62 | /// \param[in] _file File name 63 | /// \param[in] _line Line number where the error occurred 64 | /// \param[in] _msg Error message 65 | public: Exception(const char *_file, 66 | std::int64_t _line, 67 | std::string _msg); 68 | 69 | /// \brief Copy constructor 70 | /// \param[in] _e Exception to copy. 71 | public: Exception(const Exception &_e); 72 | 73 | /// \brief Move constructor 74 | /// \param[in] _e Exception to move. 75 | public: Exception(Exception &&_e) noexcept; 76 | 77 | /// \brief Assignment operator. 78 | /// \param[in] _exception The exception to set values from. 79 | /// \return *this 80 | public: Exception &operator=(const Exception &_exception); 81 | 82 | /// \brief Move assignment operator. 83 | /// \param[in] _exception Exception to move. 84 | /// \return Reference to this. 85 | public: Exception &operator=(Exception &&_exception); 86 | 87 | /// \brief Destructor 88 | public: virtual ~Exception(); 89 | 90 | /// \brief Return the error function 91 | /// \return The error function name 92 | public: std::string GetErrorFile() const; 93 | 94 | /// \brief Return the error string 95 | /// \return The error string 96 | public: std::string GetErrorStr() const; 97 | 98 | /// \brief Print the exception to std out. 99 | public: void Print() const; 100 | 101 | 102 | /// \brief stream insertion operator for Gazebo Error 103 | /// \param[in] _out the output stream 104 | /// \param[in] _err the exception 105 | public: friend std::ostream &operator<<(std::ostream& _out, 106 | const sdf::Exception &_err) 107 | { 108 | return _out << _err.GetErrorStr(); 109 | } 110 | 111 | /// \brief Private data pointer. 112 | private: std::unique_ptr dataPtr; 113 | }; 114 | 115 | /// \class InternalError Exception.hh common/common.hh 116 | /// \brief Class for generating Internal Gazebo Errors: 117 | /// those errors which should never happend and 118 | /// represent programming bugs. 119 | class SDFORMAT_VISIBLE InternalError : public Exception 120 | { 121 | /// \brief Constructor 122 | public: InternalError(); 123 | 124 | /// \brief Default constructor 125 | /// \param[in] _file File name 126 | /// \param[in] _line Line number where the error occurred 127 | /// \param[in] _msg Error message 128 | public: InternalError(const char *_file, std::int64_t _line, 129 | const std::string _msg); 130 | 131 | /// \brief Destructor 132 | public: virtual ~InternalError(); 133 | }; 134 | 135 | /// \class AssertionInternalError Exception.hh common/common.hh 136 | /// \brief Class for generating Exceptions which come from 137 | /// sdf assertions. They include information about the 138 | /// assertion expression violated, function where problem 139 | /// appeared and assertion debug message. 140 | class SDFORMAT_VISIBLE AssertionInternalError : public InternalError 141 | { 142 | /// \brief Constructor for assertions 143 | /// \param[in] _file File name 144 | /// \param[in] _line Line number where the error occurred 145 | /// \param[in] _expr Assertion expression failed resulting in an 146 | /// internal error 147 | /// \param[in] _function Function where assertion failed 148 | /// \param[in] _msg Function where assertion failed 149 | public: AssertionInternalError(const char *_file, 150 | std::int64_t _line, 151 | const std::string _expr, 152 | const std::string _function, 153 | const std::string _msg = ""); 154 | /// \brief Destructor 155 | public: virtual ~AssertionInternalError(); 156 | }; 157 | /// \} 158 | } 159 | } 160 | 161 | #ifdef _WIN32 162 | #pragma warning(pop) 163 | #endif 164 | 165 | #endif 166 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Console.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Nate Koenig 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | #ifndef SDF_CONSOLE_HH_ 19 | #define SDF_CONSOLE_HH_ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | #include "sdf/system_util.hh" 28 | 29 | #ifdef _WIN32 30 | // Disable warning C4251 which is triggered by 31 | // std::unique_ptr 32 | #pragma warning(push) 33 | #pragma warning(disable: 4251) 34 | #endif 35 | 36 | namespace sdf 37 | { 38 | // Inline bracke to help doxygen filtering. 39 | inline namespace SDF_VERSION_NAMESPACE { 40 | // 41 | 42 | /// \addtogroup sdf SDF 43 | /// \{ 44 | 45 | /// \brief Output a debug message 46 | #define sdfdbg (sdf::Console::Instance()->Log("Dbg", __FILE__, __LINE__)) 47 | 48 | /// \brief Output a message 49 | #define sdfmsg (sdf::Console::Instance()->ColorMsg("Msg", \ 50 | __FILE__, __LINE__, 32)) 51 | 52 | /// \brief Output a warning message 53 | #define sdfwarn (sdf::Console::Instance()->ColorMsg("Warning", \ 54 | __FILE__, __LINE__, 33)) 55 | 56 | /// \brief Output an error message 57 | #define sdferr (sdf::Console::Instance()->ColorMsg("Error", \ 58 | __FILE__, __LINE__, 31)) 59 | 60 | class ConsolePrivate; 61 | class Console; 62 | 63 | /// \def ConsolePtr 64 | /// \brief Shared pointer to a Console Element 65 | typedef std::shared_ptr ConsolePtr; 66 | 67 | /// \brief Message, error, warning, and logging functionality 68 | class SDFORMAT_VISIBLE Console 69 | { 70 | /// \brief An ostream-like class that we'll use for logging. 71 | public: class SDFORMAT_VISIBLE ConsoleStream 72 | { 73 | /// \brief Constructor. 74 | /// \param[in] _stream Pointer to an output stream operator. Can be 75 | /// NULL/nullptr. 76 | public: ConsoleStream(std::ostream *_stream) : 77 | stream(_stream) {} 78 | 79 | /// \brief Redirect whatever is passed in to both our ostream 80 | /// (if non-NULL) and the log file (if open). 81 | /// \param[in] _rhs Content to be logged. 82 | /// \return Reference to myself. 83 | public: template 84 | ConsoleStream &operator<<(const T &_rhs); 85 | 86 | /// \brief Print a prefix to both terminal and log file. 87 | /// \param[in] _lbl Text label 88 | /// \param[in] _file File containing the error 89 | /// \param[in] _line Line containing the error 90 | /// \param[in] _color Color to make the label. Used only on terminal. 91 | public: void Prefix(const std::string &_lbl, 92 | const std::string &_file, 93 | unsigned int _line, int _color); 94 | 95 | /// \brief The ostream to log to; can be NULL/nullptr. 96 | private: std::ostream *stream; 97 | }; 98 | 99 | /// \brief Default constructor 100 | private: Console(); 101 | 102 | /// \brief Destructor 103 | public: virtual ~Console(); 104 | 105 | /// \brief Return an instance to this class. 106 | public: static ConsolePtr Instance(); 107 | 108 | /// \brief Clear out the current console to make room for a new one. 109 | public: static void Clear(); 110 | 111 | /// \brief Set quiet output 112 | /// \param[in] q True to prevent warning 113 | public: void SetQuiet(bool _q); 114 | 115 | /// \brief Use this to output a colored message to the terminal 116 | /// \param[in] _lbl Text label 117 | /// \param[in] _file File containing the error 118 | /// \param[in] _line Line containing the error 119 | /// \param[in] _color Color to make the label 120 | /// \return Reference to an output stream 121 | public: ConsoleStream &ColorMsg(const std::string &lbl, 122 | const std::string &file, 123 | unsigned int line, int color); 124 | 125 | /// \brief Use this to output a message to a log file 126 | /// \return Reference to output stream 127 | public: ConsoleStream &Log(const std::string &lbl, 128 | const std::string &file, 129 | unsigned int line); 130 | 131 | /// \internal 132 | /// \brief Pointer to private data. 133 | private: std::unique_ptr dataPtr; 134 | }; 135 | 136 | /// \internal 137 | /// \brief Private data for Console 138 | class ConsolePrivate 139 | { 140 | /// \brief Constructor 141 | public: ConsolePrivate() : msgStream(&std::cerr), logStream(nullptr) {} 142 | 143 | /// \brief message stream 144 | public: Console::ConsoleStream msgStream; 145 | 146 | /// \brief log stream 147 | public: Console::ConsoleStream logStream; 148 | 149 | /// \brief logfile stream 150 | public: std::ofstream logFileStream; 151 | }; 152 | 153 | /////////////////////////////////////////////// 154 | template 155 | Console::ConsoleStream &Console::ConsoleStream::operator<<(const T &_rhs) 156 | { 157 | if (this->stream) 158 | { 159 | *this->stream << _rhs; 160 | } 161 | 162 | if (Console::Instance()->dataPtr->logFileStream.is_open()) 163 | { 164 | Console::Instance()->dataPtr->logFileStream << _rhs; 165 | Console::Instance()->dataPtr->logFileStream.flush(); 166 | } 167 | 168 | return *this; 169 | } 170 | } 171 | 172 | /// \} 173 | } 174 | 175 | #ifdef _WIN32 176 | #pragma warning(pop) 177 | #endif 178 | 179 | #endif 180 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Root.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_ROOT_HH_ 18 | #define SDF_ROOT_HH_ 19 | 20 | #include 21 | 22 | #include "sdf/SDFImpl.hh" 23 | #include "sdf/Types.hh" 24 | #include "sdf/sdf_config.h" 25 | #include "sdf/system_util.hh" 26 | 27 | namespace sdf 28 | { 29 | // Inline bracket to help doxygen filtering. 30 | inline namespace SDF_VERSION_NAMESPACE { 31 | // 32 | 33 | // Forward declarations. 34 | class Light; 35 | class Model; 36 | class RootPrivate; 37 | class World; 38 | 39 | /// \brief Root class that acts as an entry point to the SDF document 40 | /// model. 41 | /// 42 | /// Multiple worlds can exist in a single SDF file. A user of multiple 43 | /// worlds could run parallel instances of simulation, or offer selection 44 | /// of a world at runtime. 45 | /// 46 | /// # Usage 47 | /// 48 | /// In this example, a root object is loaded from a file specified in 49 | /// the first command line argument to a program. 50 | /// 51 | /// \snippet examples/dom.cc rootUsage 52 | /// 53 | class SDFORMAT_VISIBLE Root 54 | { 55 | /// \brief Default constructor 56 | public: Root(); 57 | 58 | /// \brief Destructor 59 | public: ~Root(); 60 | 61 | /// \brief Parse the given SDF file, and generate objects based on types 62 | /// specified in the SDF file. 63 | /// \param[in] _filename Name of the SDF file to parse. 64 | /// \return Errors, which is a vector of Error objects. Each Error includes 65 | /// an error code and message. An empty vector indicates no error. 66 | public: Errors Load(const std::string &_filename); 67 | 68 | /// \brief Parse the given SDF string, and generate objects based on types 69 | /// specified in the SDF file. 70 | /// \param[in] _sdf SDF string to parse. 71 | /// \return Errors, which is a vector of Error objects. Each Error includes 72 | /// an error code and message. An empty vector indicates no error. 73 | public: Errors LoadSdfString(const std::string &_sdf); 74 | 75 | /// \brief Parse the given SDF pointer, and generate objects based on types 76 | /// specified in the SDF file. 77 | /// \param[in] _sdf SDF pointer to parse. 78 | /// \return Errors, which is a vector of Error objects. Each Error includes 79 | /// an error code and message. An empty vector indicates no error. 80 | public: Errors Load(const SDFPtr _sdf); 81 | 82 | /// \brief Get the SDF version specified in the parsed file or SDF 83 | /// pointer. 84 | /// \return SDF version string. 85 | /// \sa void SetVersion(const std::string &_version) 86 | public: std::string Version() const; 87 | 88 | /// \brief Set the SDF version string. 89 | /// \param[in] _version The new SDF version. 90 | /// \sa std::string Version() 91 | public: void SetVersion(const std::string &_version); 92 | 93 | /// \brief Get the number of worlds. 94 | /// \return Number of worlds contained in this Root object. 95 | public: uint64_t WorldCount() const; 96 | 97 | /// \brief Get a world based on an index. 98 | /// \param[in] _index Index of the world. The index should be in the 99 | /// range [0..WorldCount()). 100 | /// \return Pointer to the world. Nullptr if the index does not exist. 101 | /// \sa uint64_t WorldCount() const 102 | public: const World *WorldByIndex(const uint64_t _index) const; 103 | 104 | /// \brief Get whether a world name exists. 105 | /// \param[in] _name Name of the world to check. 106 | /// \return True if there exists a world with the given name. 107 | public: bool WorldNameExists(const std::string &_name) const; 108 | 109 | /// \brief Get the number of models. 110 | /// \return Number of models contained in this Root object. 111 | public: uint64_t ModelCount() const; 112 | 113 | /// \brief Get a model based on an index. 114 | /// \param[in] _index Index of the model. The index should be in the 115 | /// range [0..ModelCount()). 116 | /// \return Pointer to the model. Nullptr if the index does not exist. 117 | /// \sa uint64_t ModelCount() const 118 | public: const Model *ModelByIndex(const uint64_t _index) const; 119 | 120 | /// \brief Get whether a model name exists. 121 | /// \param[in] _name Name of the model to check. 122 | /// \return True if there exists a model with the given name. 123 | public: bool ModelNameExists(const std::string &_name) const; 124 | 125 | /// \brief Get the number of lights. 126 | /// \return Number of lights contained in this Root object. 127 | public: uint64_t LightCount() const; 128 | 129 | /// \brief Get a light based on an index. 130 | /// \param[in] _index Index of the light. The index should be in the 131 | /// range [0..LightCount()). 132 | /// \return Pointer to the light. Nullptr if the index does not exist. 133 | /// \sa uint64_t LightCount() const 134 | public: const Light *LightByIndex(const uint64_t _index) const; 135 | 136 | /// \brief Get whether a light name exists. 137 | /// \param[in] _name Name of the light to check. 138 | /// \return True if there exists a light with the given name. 139 | public: bool LightNameExists(const std::string &_name) const; 140 | 141 | /// \brief Get a pointer to the SDF element that was generated during 142 | /// load. 143 | /// \return SDF element pointer. The value will be nullptr if Load has 144 | /// not been called. 145 | public: sdf::ElementPtr Element() const; 146 | 147 | /// \brief Private data pointer 148 | private: RootPrivate *dataPtr = nullptr; 149 | }; 150 | } 151 | } 152 | #endif 153 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Geometry.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_GEOMETRY_HH_ 18 | #define SDF_GEOMETRY_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace sdf 25 | { 26 | // Inline bracke to help doxygen filtering. 27 | inline namespace SDF_VERSION_NAMESPACE { 28 | // 29 | 30 | // Forward declare private data class. 31 | class GeometryPrivate; 32 | class Box; 33 | class Cylinder; 34 | class Mesh; 35 | class Plane; 36 | class Sphere; 37 | 38 | /// \enum GeometryType 39 | /// \brief The set of geometry types. 40 | enum class GeometryType 41 | { 42 | /// \brief Empty geometry. This means no shape has been defined. 43 | EMPTY = 0, 44 | 45 | /// \brief A box geometry. 46 | BOX = 1, 47 | 48 | /// \brief A cylinder geometry. 49 | CYLINDER = 2, 50 | 51 | /// \brief A plane geometry. 52 | PLANE = 3, 53 | 54 | /// \brief A sphere geometry. 55 | SPHERE = 4, 56 | 57 | /// \brief A mesh geometry. 58 | MESH = 5, 59 | }; 60 | 61 | /// \brief Geometry provides access to a shape, such as a Box. Use the 62 | /// Type function to determine the type of shape contained within a 63 | /// Geometry. Access to shape data, such as a box's size, is achieved 64 | /// through the shape accessors, such as const Box *BoxShape() const. 65 | class SDFORMAT_VISIBLE Geometry 66 | { 67 | /// \brief Default constructor 68 | public: Geometry(); 69 | 70 | /// \brief Copy constructor 71 | /// \param[in] _geometry Geometry to copy. 72 | public: Geometry(const Geometry &_geometry); 73 | 74 | /// \brief Move constructor 75 | /// \param[in] _geometry Geometry to move. 76 | public: Geometry(Geometry &&_geometry) noexcept; 77 | 78 | /// \brief Destructor 79 | public: virtual ~Geometry(); 80 | 81 | /// \brief Assignment operator. 82 | /// \param[in] _geometry The geometry to set values from. 83 | /// \return *this 84 | public: Geometry &operator=(const Geometry &_geometry); 85 | 86 | /// \brief Move assignment operator. 87 | /// \param[in] _geometry The geometry to move from. 88 | /// \return *this 89 | public: Geometry &operator=(Geometry &&_geometry); 90 | 91 | /// \brief Load the geometry based on a element pointer. This is *not* the 92 | /// usual entry point. Typical usage of the SDF DOM is through the Root 93 | /// object. 94 | /// \param[in] _sdf The SDF Element pointer 95 | /// \return Errors, which is a vector of Error objects. Each Error includes 96 | /// an error code and message. An empty vector indicates no error. 97 | public: Errors Load(ElementPtr _sdf); 98 | 99 | /// \brief Get the type of geometry. 100 | /// \return The geometry type. 101 | public: GeometryType Type() const; 102 | 103 | /// \brief Set the type of geometry. 104 | /// \param[in] _type The geometry type. 105 | public: void SetType(const GeometryType _type); 106 | 107 | /// \brief Get the box geometry, or nullptr if the contained geometry is 108 | /// not a box. 109 | /// \return Pointer to the visual's box geometry, or nullptr if the 110 | /// geometry is not a box. 111 | /// \sa GeometryType Type() const 112 | public: const Box *BoxShape() const; 113 | 114 | /// \brief Set the box shape. 115 | /// \param[in] _box The box shape. 116 | public: void SetBoxShape(const Box &_box); 117 | 118 | /// \brief Get the cylinder geometry, or nullptr if the contained 119 | /// geometry is not a cylinder. 120 | /// \return Pointer to the visual's cylinder geometry, or nullptr if the 121 | /// geometry is not a cylinder. 122 | /// \sa GeometryType Type() const 123 | public: const Cylinder *CylinderShape() const; 124 | 125 | /// \brief Set the cylinder shape. 126 | /// \param[in] _cylinder The cylinder shape. 127 | public: void SetCylinderShape(const Cylinder &_cylinder); 128 | 129 | /// \brief Get the sphere geometry, or nullptr if the contained geometry is 130 | /// not a sphere. 131 | /// \return Pointer to the visual's sphere geometry, or nullptr if the 132 | /// geometry is not a sphere. 133 | /// \sa GeometryType Type() const 134 | public: const Sphere *SphereShape() const; 135 | 136 | /// \brief Set the sphere shape. 137 | /// \param[in] _sphere The sphere shape. 138 | public: void SetSphereShape(const Sphere &_sphere); 139 | 140 | /// \brief Get the plane geometry, or nullptr if the contained geometry is 141 | /// not a plane. 142 | /// \return Pointer to the visual's plane geometry, or nullptr if the 143 | /// geometry is not a plane. 144 | /// \sa GeometryType Type() const 145 | public: const Plane *PlaneShape() const; 146 | 147 | /// \brief Set the plane shape. 148 | /// \param[in] _plane The plane shape. 149 | public: void SetPlaneShape(const Plane &_plane); 150 | 151 | /// \brief Get the mesh geometry, or nullptr if the contained geometry is 152 | /// not a mesh. 153 | /// \return Pointer to the visual's mesh geometry, or nullptr if the 154 | /// geometry is not a mesh. 155 | /// \sa GeometryType Type() const 156 | public: const Mesh *MeshShape() const; 157 | 158 | /// \brief Set the mesh shape. 159 | /// \param[in] _mesh The mesh shape. 160 | public: void SetMeshShape(const Mesh &_mesh); 161 | 162 | /// \brief Get a pointer to the SDF element that was used during 163 | /// load. 164 | /// \return SDF element pointer. The value will be nullptr if Load has 165 | /// not been called. 166 | public: sdf::ElementPtr Element() const; 167 | 168 | /// \brief Private data pointer. 169 | private: GeometryPrivate *dataPtr; 170 | }; 171 | } 172 | } 173 | #endif 174 | -------------------------------------------------------------------------------- /src/auto_abi_checker/abi_executor.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright 2018 Open Robotics 4 | # Licensed under the Apache License, Version 2.0 5 | 6 | import subprocess 7 | from tempfile import mkdtemp 8 | from os import chdir, makedirs, environ 9 | from os.path import join, isdir, exists, realpath, dirname 10 | from auto_abi_checker.utils import _check_call, error, info, subinfo, main_step_info 11 | 12 | 13 | class ABIExecutor(): 14 | def __init__(self, tolerance_levels='0', compilation_flags=''): 15 | self.bin = 'abi-compliance-checker' 16 | self.ws = mkdtemp() 17 | self.ws_abi_dump = join(self.ws, 'abi_dumps') 18 | self.ws_report = join(self.ws, 'compat_reports', 'X_to_X') 19 | self.compiler = realpath('/usr/bin/cc') 20 | self.report_name = 'test_name_report' 21 | self.compilation_flags = compilation_flags 22 | self.tolerance_levels = tolerance_levels 23 | self.no_fail_if_emtpy = False 24 | self.empty_objects_found = False 25 | self.compilaton_errors_found = False 26 | self.auto_abi_cmd_executed = '' 27 | self.ignore_file = join(dirname(__file__), 'config', 'symbols_ignored.txt') 28 | 29 | def run(self, orig_src, new_src, report_dir='', no_fail_if_emtpy=False, 30 | auto_abi_cmd_executed=''): 31 | main_step_info("Run abichecker") 32 | # Use orig value as report name 33 | self.report_name = orig_src.name 34 | self.no_fail_if_emtpy = no_fail_if_emtpy 35 | self.auto_abi_cmd_executed = auto_abi_cmd_executed 36 | # if compilation_flags is set respect the value 37 | if not self.compilation_flags: 38 | self.compilation_flags = self.get_compilation_flags( 39 | orig_src, new_src) 40 | chdir(self.ws) 41 | if report_dir: 42 | if not isdir(report_dir): 43 | error("The directory to host the report does not exists: " + report_dir) 44 | self.ws_report = report_dir 45 | if self.dump(orig_src) != 0: 46 | error("ABI Dump from " + str(orig_src) + " failed") 47 | if self.dump(new_src) != 0: 48 | error("ABI Dump from " + str(new_src) + " failed") 49 | self.generate_report(orig_src, new_src) 50 | 51 | def get_compilation_flags(self, orig_src, new_src): 52 | r = list(orig_src.compilation_flags) 53 | r.extend(x for x in new_src.compilation_flags if x not in r) 54 | return " ".join(r) 55 | 56 | def get_dump_dir(self, src_class): 57 | return join(self.ws_abi_dump, src_class.name, 'X') 58 | 59 | def get_dump_file(self, src_class): 60 | return join(self.get_dump_dir(src_class), 'ABI.dump') 61 | 62 | def get_dump_error_log(self, src_class): 63 | return join(self.ws, 'logs', src_class.name, 'X', 'log.txt') 64 | 65 | def get_compat_report_file(self): 66 | return join(self.ws_report, 'compat_report.html') 67 | 68 | def dump(self, src_class): 69 | cmd = [self.bin, 70 | '-l', src_class.name, 71 | '-tolerance', self.tolerance_levels, 72 | '--gcc-path', self.compiler, 73 | '-dump', src_class.ws_files, 74 | '-gcc-options', self.compilation_flags] 75 | print(" - Run '%s'" % ' '.join(cmd)) 76 | try: 77 | subprocess.check_output(cmd, stderr=subprocess.STDOUT) 78 | except subprocess.CalledProcessError as e: 79 | error_msg = e.output.decode('utf-8') 80 | # check if the error is because no headers/object are found 81 | if "library objects are not found" in error_msg or \ 82 | "header files are not found" in error_msg: 83 | self.empty_objects_found = True 84 | if self.no_fail_if_emtpy: 85 | subinfo("Skip error on no headers/objects found") 86 | return 0 87 | error("No headers/objects found in " + str(src_class)) 88 | # check if the error is because compilation problems 89 | if "errors occurred when compiling headers" in error_msg: 90 | self.compilaton_errors_found = True 91 | # print error 92 | error_log_str = "" 93 | with open(self.get_dump_error_log(src_class)) as log: 94 | error_log_str = log.read() 95 | print(error_log_str) 96 | msg = "Compilation problems during compiling headers " + str(src_class) 97 | self.generate_fake_report(msg + "

" + error_log_str + "
") 98 | error(msg) 99 | # If unknown error print it to help user debug 100 | print("\n" + error_msg) 101 | return 1 102 | 103 | return 0 104 | 105 | def generate_report(self, orig_src, new_src): 106 | if self.empty_objects_found: 107 | msg = "No real report generated since empty dumps were found" 108 | self.generate_fake_report(msg) 109 | main_step_info(msg) 110 | return 0 111 | 112 | result = _check_call([self.bin, 113 | '-skip-symbols', self.ignore_file, 114 | '-l', self.report_name, 115 | '-report-path', self.get_compat_report_file(), 116 | '-old', self.get_dump_file(orig_src), 117 | '-new', self.get_dump_file(new_src)]) 118 | 119 | if result != 0: 120 | return result 121 | 122 | main_step_info("Generated: " + self.get_compat_report_file()) 123 | return 0 124 | 125 | def generate_fake_report(self, msg): 126 | html_str = """ 127 | 128 | 129 | 130 | 131 |

API/ABI API compatibility report by auto-abi-checker

132 | 133 | """ 134 | 135 | if self.auto_abi_cmd_executed: 136 | html_str += """ 137 |

Reproduce the error locally

138 |
139 |                 pip3 install -U auto_abi_checker
140 |                 source /opt/ros/""" + environ['ROS_DISTRO'] + """/setup.bash && mkdir -p """ + self.ws_report + """
141 |                 """ + self.auto_abi_cmd_executed + """
142 |                 
143 | """ 144 | 145 | html_str += """ 146 |

Error

147 | 148 |

""" + msg + """

149 | 150 | 151 | 152 | """ 153 | if not exists(self.ws_report): 154 | makedirs(self.ws_report) 155 | 156 | report_file = open(self.get_compat_report_file(), "w") 157 | report_file.write(html_str) 158 | report_file.close() 159 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/parser.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_PARSER_HH_ 18 | #define SDF_PARSER_HH_ 19 | 20 | #include 21 | 22 | #include "sdf/SDFImpl.hh" 23 | #include "sdf/sdf_config.h" 24 | #include "sdf/system_util.hh" 25 | 26 | /// \ingroup sdf_parser 27 | /// \brief namespace for Simulation Description Format parser 28 | /// 29 | /// The parsing functions read XML elements contained in either a file or 30 | /// string and translates the XML elements into SDF data structures. This 31 | /// translation finds errors in the provided XML, fills in default values, 32 | /// and performs any necessary version related conversions. 33 | /// 34 | /// XML elements that are not part of the SDF specification are copied in 35 | /// place. This preserves the given XML structure and data. 36 | namespace sdf 37 | { 38 | // Inline bracket to help doxygen filtering. 39 | inline namespace SDF_VERSION_NAMESPACE { 40 | // 41 | 42 | /// \brief Init based on the installed sdf_format.xml file 43 | SDFORMAT_VISIBLE 44 | bool init(SDFPtr _sdf); 45 | 46 | /// \brief Initialize the SDF interface using a file 47 | SDFORMAT_VISIBLE 48 | bool initFile(const std::string &_filename, SDFPtr _sdf); 49 | 50 | /// \brief Initialize an SDFElement interface using a file 51 | SDFORMAT_VISIBLE 52 | bool initFile(const std::string &_filename, ElementPtr _sdf); 53 | 54 | /// \brief Initialize the SDF interface using a string 55 | SDFORMAT_VISIBLE 56 | bool initString(const std::string &_xmlString, SDFPtr _sdf); 57 | 58 | /// \brief Populate the SDF values from a file 59 | /// \param[in] _filename Name of the SDF file 60 | /// \return Populated SDF pointer. 61 | SDFORMAT_VISIBLE 62 | sdf::SDFPtr readFile(const std::string &_filename); 63 | 64 | /// \brief Populate the SDF values from a file 65 | /// \param[in] _filename Name of the SDF file 66 | /// \param[out] _errors Parsing errors will be appended to this variable. 67 | /// \return Populated SDF pointer. 68 | SDFORMAT_VISIBLE 69 | sdf::SDFPtr readFile(const std::string &_filename, Errors &_errors); 70 | 71 | /// \brief Populate the SDF values from a file 72 | /// 73 | /// This populates the given sdf pointer from a file. If the file is a URDF 74 | /// file it is converted to SDF first. All files are converted to the latest 75 | /// SDF version 76 | /// \param[in] _filename Name of the SDF file 77 | /// \param[in] _sdf Pointer to an SDF object. 78 | /// \param[out] _errors Parsing errors will be appended to this variable. 79 | /// \return True if successful. 80 | SDFORMAT_VISIBLE 81 | bool readFile(const std::string &_filename, SDFPtr _sdf, Errors &_errors); 82 | 83 | /// \brief Populate the SDF values from a file 84 | /// 85 | /// This populates the given sdf pointer from a file. If the file is a URDF 86 | /// file it is converted to SDF first. All files are converted to the latest 87 | /// SDF version 88 | /// \param[in] _filename Name of the SDF file 89 | /// \param[in] _sdf Pointer to an SDF object. 90 | /// \return True if successful. 91 | SDFORMAT_VISIBLE 92 | bool readFile(const std::string &_filename, SDFPtr _sdf); 93 | 94 | /// \brief Populate the SDF values from a string 95 | /// 96 | /// This populates the sdf pointer from a string. If the string is a URDF 97 | /// string it is converted to SDF first. All string are converted to the 98 | /// latest SDF version 99 | /// \param[out] _errors Parsing errors will be appended to this variable. 100 | SDFORMAT_VISIBLE 101 | bool readString(const std::string &_xmlString, SDFPtr _sdf, Errors &_errors); 102 | 103 | /// \brief Populate the SDF values from a string 104 | /// 105 | /// This populates the sdf pointer from a string. If the string is a URDF 106 | /// string it is converted to SDF first. All string are converted to the 107 | /// latest SDF version 108 | SDFORMAT_VISIBLE 109 | bool readString(const std::string &_xmlString, SDFPtr _sdf); 110 | 111 | /// \brief Populate the SDF values from a string 112 | /// 113 | /// This populates the sdf pointer from a string. If the string is a URDF 114 | /// string it is converted to SDF first. All strings are converted to the 115 | /// latest SDF version 116 | /// \param[out] _errors Parsing errors will be appended to this variable. 117 | SDFORMAT_VISIBLE 118 | bool readString(const std::string &_xmlString, ElementPtr _sdf, 119 | Errors &_errors); 120 | 121 | /// \brief Populate the SDF values from a string 122 | /// 123 | /// This populates the sdf pointer from a string. If the string is a URDF 124 | /// string it is converted to SDF first. All strings are converted to the 125 | /// latest SDF version 126 | SDFORMAT_VISIBLE 127 | bool readString(const std::string &_xmlString, ElementPtr _sdf); 128 | 129 | /// \brief Get the file path to the model file 130 | /// \param[in] _modelDirPath directory system path of the model 131 | /// \return string with the full filesystem path to the best version (greater 132 | /// SDF protocol supported by this sdformat version) of the .sdf 133 | /// model files hosted by _modelDirPath. 134 | SDFORMAT_VISIBLE 135 | std::string getModelFilePath(const std::string &_modelDirPath); 136 | 137 | SDFORMAT_VISIBLE 138 | void addNestedModel(ElementPtr _sdf, ElementPtr _includeSDF); 139 | 140 | /// \brief Convert an SDF file to a specific SDF version. 141 | /// \param[in] _filename Name of the SDF file to convert. 142 | /// \param[in] _version Version to convert _filename to. 143 | /// \param[out] _sdf Pointer to the converted SDF document. 144 | /// \return True on success. 145 | SDFORMAT_VISIBLE 146 | bool convertFile(const std::string &_filename, const std::string &_version, 147 | SDFPtr _sdf); 148 | 149 | /// \brief Convert an SDF string to a specific SDF version. 150 | /// \param[in] _sdfString The SDF string to convert. 151 | /// \param[in] _version Version to convert _filename to. 152 | /// \param[out] _sdf Pointer to the converted SDF document. 153 | /// \return True on success. 154 | SDFORMAT_VISIBLE 155 | bool convertString(const std::string &_sdfString, 156 | const std::string &_version, SDFPtr _sdf); 157 | } 158 | } 159 | #endif 160 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Types.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Nate Koenig 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDFORMAT_TYPES_HH_ 18 | #define SDFORMAT_TYPES_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include "sdf/system_util.hh" 29 | #include "sdf/Error.hh" 30 | 31 | #if defined(__GNUC__) 32 | #define SDF_DEPRECATED(version) __attribute__((deprecated)) 33 | #define SDF_FORCEINLINE __attribute__((always_inline)) 34 | #elif defined(MSVC) 35 | #define SDF_DEPRECATED(version) 36 | #define SDF_FORCEINLINE __forceinline 37 | #else 38 | #define SDF_DEPRECATED(version) 39 | #define SDF_FORCEINLINE 40 | #endif 41 | 42 | namespace sdf 43 | { 44 | // Inline bracket to help doxygen filtering. 45 | inline namespace SDF_VERSION_NAMESPACE { 46 | // 47 | 48 | /// \brief Split a string using the delimiter in splitter. 49 | /// \param[in] str The string to split. 50 | /// \param[in] splitter The delimiter to use. 51 | /// \return A vector of strings containing the split tokens. 52 | SDFORMAT_VISIBLE 53 | std::vector split(const std::string &_str, 54 | const std::string &_splitter); 55 | 56 | /// \brief Trim leading and trailing whitespace from a string. 57 | /// \param[in] _in The string to trim. 58 | /// \return A string containing the trimmed value. 59 | SDFORMAT_VISIBLE 60 | std::string trim(const char *_in); 61 | 62 | /// \brief check if two values are equal, within a tolerance 63 | /// \param[in] _a the first value 64 | /// \param[in] _b the second value 65 | /// \param[in] _epsilon the tolerance 66 | template 67 | inline bool equal(const T &_a, const T &_b, 68 | const T &_epsilon = 1e-6f) 69 | { 70 | return std::fabs(_a - _b) <= _epsilon; 71 | } 72 | 73 | /// \brief A vector of Error. 74 | using Errors = std::vector; 75 | 76 | /// \brief Defines a color 77 | class SDFORMAT_VISIBLE Color 78 | { 79 | /// \brief Constructor 80 | /// \param[in] _r Red value (range 0 to 1) 81 | /// \param[in] _g Green value (range 0 to 1 82 | /// \param[in] _b Blue value (range 0 to 1 83 | /// \param[in] _a Alpha value (0=transparent, 1=opaque) 84 | /// \deprecated Use ignition::math::Color 85 | public: Color(float _r = 0.0f, float _g = 0.0f, 86 | float _b = 0.0f, float _a = 1.0f) SDF_DEPRECATED(6.0) 87 | : r(_r), g(_g), b(_b), a(_a) 88 | {} 89 | 90 | /// \brief Stream insertion operator 91 | /// \param[in] _out the output stream 92 | /// \param[in] _pt the color 93 | /// \return the output stream 94 | public: friend std::ostream &operator<< (std::ostream &_out, 95 | const Color &_pt) 96 | { 97 | _out << _pt.r << " " << _pt.g << " " << _pt.b << " " << _pt.a; 98 | return _out; 99 | } 100 | 101 | /// \brief Stream insertion operator 102 | /// \param[in] _in the input stream 103 | /// \param[in] _pt 104 | public: friend std::istream &operator>> (std::istream &_in, Color &_pt) 105 | { 106 | // Skip white spaces 107 | _in.setf(std::ios_base::skipws); 108 | _in >> _pt.r >> _pt.g >> _pt.b >> _pt.a; 109 | return _in; 110 | } 111 | 112 | /// \brief Equality operator 113 | /// \param[in] _clr The color to check for equality 114 | /// \return True if the this color equals _clf 115 | public: bool operator ==(const Color &_clr) const 116 | { 117 | return equal(this->r, _clr.r) && 118 | equal(this->g, _clr.g) && 119 | equal(this->b, _clr.b) && 120 | equal(this->a, _clr.a); 121 | } 122 | 123 | /// \brief Red value 124 | public: float r; 125 | 126 | /// \brief Green value 127 | public: float g; 128 | 129 | /// \brief Blue value 130 | public: float b; 131 | 132 | /// \brief Alpha value 133 | public: float a; 134 | }; 135 | 136 | /// \brief A Time class, can be used to hold wall- or sim-time. 137 | /// stored as sec and nano-sec. 138 | class SDFORMAT_VISIBLE Time 139 | { 140 | /// \brief Constructor 141 | public: Time() 142 | : sec(0), nsec(0) 143 | { 144 | } 145 | 146 | /// \brief Constructor 147 | /// \param[in] _sec Seconds 148 | /// \param[in] _nsec Nanoseconds 149 | public: Time(int32_t _sec, int32_t _nsec) 150 | : sec(_sec), nsec(_nsec) 151 | { 152 | } 153 | 154 | /// \brief Stream insertion operator 155 | /// \param[in] _out the output stream 156 | /// \param[in] _time time to write to the stream 157 | /// \return the output stream 158 | public: friend std::ostream &operator<<(std::ostream &_out, 159 | const Time &_time) 160 | { 161 | _out << _time.sec << " " << _time.nsec; 162 | return _out; 163 | } 164 | 165 | /// \brief Stream extraction operator 166 | /// \param[in] _in the input stream 167 | /// \param[in] _time time to read from to the stream 168 | /// \return the input stream 169 | public: friend std::istream &operator>>(std::istream &_in, 170 | Time &_time) 171 | { 172 | // Skip white spaces 173 | _in.setf(std::ios_base::skipws); 174 | _in >> _time.sec >> _time.nsec; 175 | return _in; 176 | } 177 | 178 | /// \brief Equal to operator. 179 | /// \param[in] _time the time to compare to. 180 | /// \return true if values are the same, false otherwise. 181 | public: bool operator ==(const Time &_time) const 182 | { 183 | return this->sec == _time.sec && this->nsec == _time.nsec; 184 | } 185 | 186 | /// \brief Seconds. 187 | public: int32_t sec; 188 | 189 | /// \brief Nanoseconds. 190 | public: int32_t nsec; 191 | }; 192 | 193 | /// \brief A class for inertial information about a link. 194 | class SDFORMAT_VISIBLE Inertia 195 | { 196 | public: double mass; 197 | }; 198 | 199 | /// \brief Transforms a string to its lowercase equivalent 200 | /// \param[in] _in String to convert to lowercase 201 | /// \return Lowercase equilvalent of _in. 202 | std::string SDFORMAT_VISIBLE lowercase(const std::string &_in); 203 | } 204 | } 205 | #endif 206 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Material.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_MATERIAL_HH_ 18 | #define SDF_MATERIAL_HH_ 19 | 20 | #include 21 | #include "sdf/Element.hh" 22 | #include "sdf/Types.hh" 23 | #include "sdf/sdf_config.h" 24 | #include "sdf/system_util.hh" 25 | 26 | namespace sdf 27 | { 28 | // Inline bracke to help doxygen filtering. 29 | inline namespace SDF_VERSION_NAMESPACE { 30 | // 31 | 32 | // Forward declarations. 33 | class MaterialPrivate; 34 | class Pbr; 35 | 36 | enum class ShaderType : int 37 | { 38 | PIXEL = 0, 39 | VERTEX = 1, 40 | NORMAL_MAP_OBJECTSPACE = 2, 41 | NORMAL_MAP_TANGENTSPACE = 3, 42 | }; 43 | 44 | /// \brief This class contains visual material properties. 45 | class SDFORMAT_VISIBLE Material 46 | { 47 | /// \brief Default constructor 48 | public: Material(); 49 | 50 | /// \brief Copy constructor 51 | /// \param[in] _material Material to copy. 52 | public: Material(const Material &_material); 53 | 54 | /// \brief Move constructor 55 | /// \param[in] _material Material to move. 56 | public: Material(Material &&_material) noexcept; 57 | 58 | /// \brief Destructor 59 | public: ~Material(); 60 | 61 | /// \brief Assignment operator. 62 | /// \param[in] _material The material to set values from. 63 | /// \return *this 64 | public: Material &operator=(const Material &_material); 65 | 66 | /// \brief Move assignment operator. 67 | /// \param[in] _material The material to move from. 68 | /// \return *this 69 | public: Material &operator=(Material &&_material); 70 | 71 | /// \brief Load the material based on a element pointer. This is *not* the 72 | /// usual entry point. Typical usage of the SDF DOM is through the Root 73 | /// object. 74 | /// \param[in] _sdf The SDF Element pointer 75 | /// \return Errors, which is a vector of Error objects. Each Error includes 76 | /// an error code and message. An empty vector indicates no error. 77 | public: Errors Load(ElementPtr _sdf); 78 | 79 | /// \brief Get the ambient color. The ambient color is 80 | /// specified by a set of three numbers representing red/green/blue, 81 | /// each in the range of [0,1]. 82 | /// \return Ambient color. 83 | public: ignition::math::Color Ambient() const; 84 | 85 | /// \brief Set the ambient color. The ambient color is 86 | /// specified by a set of three numbers representing red/green/blue, 87 | /// each in the range of [0,1]. 88 | /// \param[in] _color Ambient color. 89 | public: void SetAmbient(const ignition::math::Color &_color) const; 90 | 91 | /// \brief Get the diffuse color. The diffuse color is 92 | /// specified by a set of three numbers representing red/green/blue, 93 | /// each in the range of [0,1]. 94 | /// \return Diffuse color. 95 | public: ignition::math::Color Diffuse() const; 96 | 97 | /// \brief Set the diffuse color. The diffuse color is 98 | /// specified by a set of three numbers representing red/green/blue, 99 | /// each in the range of [0,1]. 100 | /// \param[in] _color Diffuse color. 101 | public: void SetDiffuse(const ignition::math::Color &_color) const; 102 | 103 | /// \brief Get the specular color. The specular color is 104 | /// specified by a set of three numbers representing red/green/blue, 105 | /// each in the range of [0,1]. 106 | /// \return Specular color. 107 | public: ignition::math::Color Specular() const; 108 | 109 | /// \brief Set the specular color. The specular color is 110 | /// specified by a set of three numbers representing red/green/blue, 111 | /// each in the range of [0,1]. 112 | /// \param[in] _color Specular color. 113 | public: void SetSpecular(const ignition::math::Color &_color) const; 114 | 115 | /// \brief Get the emissive color. The emissive color is 116 | /// specified by a set of three numbers representing red/green/blue, 117 | /// each in the range of [0,1]. 118 | /// \return Emissive color. 119 | public: ignition::math::Color Emissive() const; 120 | 121 | /// \brief Set the emissive color. The emissive color is 122 | /// specified by a set of three numbers representing red/green/blue, 123 | /// each in the range of [0,1]. 124 | /// \param[in] _color Emissive color. 125 | public: void SetEmissive(const ignition::math::Color &_color) const; 126 | 127 | /// \brief Get whether dynamic lighting is enabled. The default 128 | /// value is true. 129 | /// \return False if dynamic lighting should be disabled. 130 | public: bool Lighting() const; 131 | 132 | /// \brief Set whether dynamic lighting is enabled. 133 | /// \param[in] _lighting False disables dynamic lighting. 134 | public: void SetLighting(const bool _lighting); 135 | 136 | /// \brief Get a pointer to the SDF element that was used during 137 | /// load. 138 | /// \return SDF element pointer. The value will be nullptr if Load has 139 | /// not been called. 140 | public: sdf::ElementPtr Element() const; 141 | 142 | /// \brief Get the URI of the material script, if one has been set. 143 | /// \return The URI of the material script, or empty string if one has 144 | /// not been set. 145 | public: std::string ScriptUri() const; 146 | 147 | /// \brief Set the URI of the material script. 148 | /// \param[in] _uri The URI of the material script. 149 | public: void SetScriptUri(const std::string &_uri); 150 | 151 | /// \brief Get the name of the material script, or empty if one has not 152 | /// been specified. The name should match an 153 | /// script element in the script located at the ScriptUri(). 154 | /// \return The name of the material script, or empty string if one has 155 | /// not been set. 156 | public: std::string ScriptName() const; 157 | 158 | /// \brief Set the name of the material script. The name should match an 159 | /// script element in the script located at the ScriptUri(). 160 | /// \param[in] _name The name of the material script. 161 | public: void SetScriptName(const std::string &_name); 162 | 163 | /// \brief Get the type of shader. 164 | /// \return Shader type. 165 | public: ShaderType Shader() const; 166 | 167 | /// \brief Set the type of shader. 168 | /// \param[in] _type Shader type. 169 | public: void SetShader(const ShaderType &_type); 170 | 171 | /// \brief Get the normal map filename. This will be an empty string if 172 | /// a normal map has not been set. 173 | /// \return Filename of the normal map, or empty string if a normal map 174 | /// has not been specified. 175 | public: std::string NormalMap() const; 176 | 177 | /// \brief Set the normal map filename. 178 | /// \param[in] _map Filename of the normal map. 179 | public: void SetNormalMap(const std::string &_map); 180 | 181 | /// \brief Set the Physically Based Rendering (PBR) material 182 | /// \return The PBR material to set to. 183 | public: void SetPbrMaterial(const Pbr &_pbr); 184 | 185 | /// \brief Get the Physically Based Rendering (PBR) material 186 | /// \return Pointer to the PBR material. Null if it does not exist. 187 | public: Pbr *PbrMaterial() const; 188 | 189 | /// \brief Private data pointer. 190 | private: MaterialPrivate *dataPtr = nullptr; 191 | }; 192 | } 193 | } 194 | #endif 195 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Joint.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_JOINT_HH_ 18 | #define SDF_JOINT_HH_ 19 | 20 | #include 21 | #include 22 | #include "sdf/Element.hh" 23 | #include "sdf/Types.hh" 24 | #include "sdf/sdf_config.h" 25 | #include "sdf/system_util.hh" 26 | 27 | namespace sdf 28 | { 29 | // Inline bracke to help doxygen filtering. 30 | inline namespace SDF_VERSION_NAMESPACE { 31 | // 32 | 33 | // Forward declarations. 34 | class JointAxis; 35 | class JointPrivate; 36 | 37 | /// \enum JointType 38 | /// \brief The set of joint types. INVALID indicates that joint type has 39 | /// not been set, or has not been set correctly. 40 | enum class JointType 41 | { 42 | /// \brief An invalid joint. This indicates an error since a joint type 43 | /// is required to fully specify a joint. 44 | INVALID = 0, 45 | 46 | /// \brief A ball and socket joint 47 | BALL = 1, 48 | 49 | /// \brief A hinge joint that rotates on a single axis with a 50 | /// continuous range of motion 51 | CONTINUOUS = 2, 52 | 53 | /// \brief A joint with zero degrees of freedom that rigidly connects two 54 | /// links. 55 | FIXED = 3, 56 | 57 | /// \brief Geared revolute joint 58 | GEARBOX = 4, 59 | 60 | /// \brief A sliding joint that slides along an axis with a limited range 61 | /// specified by upper and lower limits 62 | PRISMATIC = 5, 63 | 64 | /// \brief A hinge joint that rotates on a single axis with a fixed range 65 | /// of motion 66 | REVOLUTE = 6, 67 | 68 | /// \brief Same as two revolute joints connected in series 69 | REVOLUTE2 = 7, 70 | 71 | /// \brief A single degree of freedom joint with coupled sliding and 72 | /// rotational motion 73 | SCREW = 8, 74 | 75 | /// \brief Similar to a ball joint, but constrains one degree of freedom 76 | UNIVERSAL = 9 77 | }; 78 | 79 | class SDFORMAT_VISIBLE Joint 80 | { 81 | /// \brief Default constructor 82 | public: Joint(); 83 | 84 | /// \brief Copy constructor 85 | /// \param[in] _joint Joint to copy. 86 | public: Joint(const Joint &_joint); 87 | 88 | /// \brief Move constructor 89 | /// \param[in] _joint Joint to move. 90 | public: Joint(Joint &&_joint) noexcept; 91 | 92 | /// \brief Move assignment operator. 93 | /// \param[in] _joint Joint to move. 94 | /// \return Reference to this. 95 | public: Joint &operator=(Joint &&_joint); 96 | 97 | /// \brief Copy assignment operator. 98 | /// \param[in] _joint Joint to copy. 99 | /// \return Reference to this. 100 | public: Joint &operator=(const Joint &_joint); 101 | 102 | /// \brief Destructor 103 | public: ~Joint(); 104 | 105 | /// \brief Load the joint based on a element pointer. This is *not* the 106 | /// usual entry point. Typical usage of the SDF DOM is through the Root 107 | /// object. 108 | /// \param[in] _sdf The SDF Element pointer 109 | /// \return Errors, which is a vector of Error objects. Each Error includes 110 | /// an error code and message. An empty vector indicates no error. 111 | public: Errors Load(ElementPtr _sdf); 112 | 113 | /// \brief Get the name of the joint. 114 | /// The name of the joint must be unique within the scope of a Model. 115 | /// \return Name of the joint. 116 | public: const std::string &Name() const; 117 | 118 | /// \brief Set the name of the joint. 119 | /// The name of the joint must be unique within the scope of a Model. 120 | /// \param[in] _name Name of the joint. 121 | public: void SetName(const std::string &_name); 122 | 123 | /// \brief Get the joint type 124 | /// \return Type of joint. 125 | public: JointType Type() const; 126 | 127 | /// \brief Set the joint type 128 | /// \param[in] _jointType The type of joint. 129 | public: void SetType(const JointType _jointType); 130 | 131 | /// \brief Get the name of this joint's parent link. 132 | /// \return The name of the parent link. 133 | public: const std::string &ParentLinkName() const; 134 | 135 | /// \brief Set the name of the parent link. 136 | /// \param[in] _name Name of the parent link. 137 | public: void SetParentLinkName(const std::string &_name); 138 | 139 | /// \brief Get the name of this joint's child link. 140 | /// \return The name of the child link. 141 | public: const std::string &ChildLinkName() const; 142 | 143 | /// \brief Set the name of the child link. 144 | /// \param[in] _name Name of the child link. 145 | public: void SetChildLinkName(const std::string &_name); 146 | 147 | /// \brief Get a joint axis. 148 | /// \param[in] _index This value specifies which axis to get. A value of 149 | /// zero corresponds to the first axis, which is the SDF 150 | /// element. Any other value will return the second axis, which is the 151 | /// SDF element. 152 | /// \return A JointAxis for either the first or second joint axis. A 153 | /// return value of nullptr indicates that the axis is not 154 | /// specified. 155 | public: const JointAxis *Axis(const unsigned int _index = 0) const; 156 | 157 | /// \brief Set a joint axis. 158 | /// \param[in] _index This value specifies which axis to set. A value of 159 | /// zero corresponds to the first axis, which is the SDF 160 | /// element. Any other value will set the second axis, which is the 161 | /// SDF element. 162 | /// \param[in] _axis The JointAxis of the joint 163 | public: void SetAxis(const unsigned int _index, const JointAxis &_axis); 164 | 165 | /// \brief Get the pose of the joint. This is the pose of the joint 166 | /// as specified in SDF ( ... ). 167 | /// Transformations have not been applied to the return value. 168 | /// \return The pose of the joint. This is the raw pose value, as set in 169 | /// the SDF file. 170 | public: const ignition::math::Pose3d &Pose() const; 171 | 172 | /// \brief Set the pose of the joint. 173 | /// \sa const ignition::math::Pose3d &Pose() const; 174 | /// \param[in] _pose The pose of the joint. 175 | public: void SetPose(const ignition::math::Pose3d &_pose); 176 | 177 | /// \brief Get the name of the coordinate frame in which this joint's 178 | /// pose is expressed. A empty value indicates that the frame is the 179 | /// child link frame. 180 | /// \return The name of the pose frame. 181 | public: const std::string &PoseFrame() const; 182 | 183 | /// \brief Set the name of the coordinate frame in which this joint's 184 | /// pose is expressed. A empty value indicates that the frame is the 185 | /// child link frame. 186 | /// \param[in] _frame The name of the pose frame. 187 | public: void SetPoseFrame(const std::string &_frame); 188 | 189 | /// \brief Get the thread pitch (only valid for screw joints) 190 | /// \return The thread pitch 191 | public: double ThreadPitch() const; 192 | 193 | /// \brief Set the thread pitch (only valid for screw joints) 194 | /// \param[in] _threadPitch The thread pitch of the joint 195 | public: void SetThreadPitch(double _threadPitch); 196 | 197 | /// \brief Get a pointer to the SDF element that was used during 198 | /// load. 199 | /// \return SDF element pointer. The value will be nullptr if Load has 200 | /// not been called. 201 | public: sdf::ElementPtr Element() const; 202 | 203 | /// \brief Private data pointer. 204 | private: JointPrivate *dataPtr = nullptr; 205 | }; 206 | } 207 | } 208 | #endif 209 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Noise.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_NOISE_HH_ 18 | #define SDF_NOISE_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace sdf 25 | { 26 | // Inline bracke to help doxygen filtering. 27 | inline namespace SDF_VERSION_NAMESPACE { 28 | // Forward declare private data class. 29 | class NoisePrivate; 30 | 31 | /// \enum NoiseType 32 | /// \brief The set of noise types. 33 | enum class NoiseType 34 | { 35 | /// \brief No noise model. 36 | NONE = 0, 37 | 38 | /// \brief Draw noise values independently for each measurement from a 39 | /// Gaussian distribution 40 | GAUSSIAN = 1, 41 | 42 | /// \brief Gaussian noise plus quantization of outputs (ie. rounding). 43 | GAUSSIAN_QUANTIZED = 2, 44 | }; 45 | 46 | /// \brief The Noise class contains information about a noise 47 | /// model, such as a Gaussian distribution. A Noise DOM object is 48 | /// typically available from a Sensor. 49 | class SDFORMAT_VISIBLE Noise 50 | { 51 | /// \brief Default constructor 52 | public: Noise(); 53 | 54 | /// \brief Copy constructor 55 | /// \param[in] _noise Noise to copy. 56 | public: Noise(const Noise &_noise); 57 | 58 | /// \brief Move constructor 59 | /// \param[in] _noise Noise to move. 60 | public: Noise(Noise &&_noise) noexcept; 61 | 62 | /// \brief Destructor 63 | public: ~Noise(); 64 | 65 | /// \brief Assignment operator. 66 | /// \param[in] _noise The noise to set values from. 67 | /// \return *this 68 | public: Noise &operator=(const Noise &_noise); 69 | 70 | /// \brief Move assignment operator. 71 | /// \param[in] _noise The noise to set values from. 72 | /// \return *this 73 | public: Noise &operator=(Noise &&_noise); 74 | 75 | /// \brief Return true if both Noise objects contain the same values. 76 | /// \param[_in] _noise Noise value to compare. 77 | /// \return True if 'this' == _noise. 78 | public: bool operator==(const Noise &_noise) const; 79 | 80 | /// \brief Return true the Noise objects do not contain the same values. 81 | /// \param[_in] _noise Noise value to compare. 82 | /// \returen True if 'this' != _noise. 83 | public: bool operator!=(const Noise &_noise) const; 84 | 85 | /// \brief Load the noise based on a element pointer. This is *not* 86 | /// the usual entry point. Typical usage of the SDF DOM is through the Root 87 | /// object. 88 | /// \param[in] _sdf The SDF Element pointer 89 | /// \return Errors, which is a vector of Error objects. Each Error includes 90 | /// an error code and message. An empty vector indicates no error. 91 | public: Errors Load(ElementPtr _sdf); 92 | 93 | /// \brief Get the type of noise. 94 | /// \return The noise type. 95 | public: NoiseType Type() const; 96 | 97 | /// \brief Set the type of noise. 98 | /// \param[in] _type The noise type. 99 | public: void SetType(NoiseType _type); 100 | 101 | /// \brief Get the mean of the Gaussian distribution 102 | /// from which noise values are drawn. This is applicable to "gaussian*" 103 | /// noise types. 104 | /// \return The mean of the Guassian distribution. 105 | public: double Mean() const; 106 | 107 | /// \brief Set the mean of the Gaussian distribution 108 | /// from which noise values are drawn. This is applicable to "gaussian*" 109 | /// noise types. 110 | /// \param[in] _mean The mean of the Guassian distribution. 111 | public: void SetMean(double _mean); 112 | 113 | /// \brief Get the standard deviation of the Gaussian distribution 114 | /// from which noise values are drawn. This is applicable to "gaussian*" 115 | /// noise types. 116 | /// \return The standard deviation of the Guassian distribution. 117 | public: double StdDev() const; 118 | 119 | /// \brief Set the standard deviation of the Gaussian distribution 120 | /// from which noise values are drawn. This is applicable to "gaussian*" 121 | /// noise types. 122 | /// \param[in] _stddev The standard deviation of the Guassian distribution. 123 | public: void SetStdDev(double _stddev); 124 | 125 | /// \brief Get the mean of the Gaussian distribution 126 | /// from which bias values are drawn. This is applicable to "gaussian*" 127 | /// noise types. 128 | /// \return The mean of the bias Guassian distribution. 129 | public: double BiasMean() const; 130 | 131 | /// \brief Set the mean of the Gaussian distribution 132 | /// from which bias values are drawn. This is applicable to "gaussian*" 133 | /// noise types. 134 | /// \param[in] _bias The mean of the bias Guassian distribution. 135 | public: void SetBiasMean(double _bias); 136 | 137 | /// \brief Get the standard deviation of the Gaussian distribution 138 | /// from which bias values are drawn. This is applicable to "gaussian*" 139 | /// noise types. 140 | /// \return The standard deviation of the bias Guassian distribution. 141 | public: double BiasStdDev() const; 142 | 143 | /// \brief Set the standard deviation of the Gaussian distribution 144 | /// from which bias values are drawn. This is applicable to "gaussian*" 145 | /// noise types. 146 | /// \param[in] _bias The standard deviation of the bias Guassian 147 | /// distribution. 148 | public: void SetBiasStdDev(double _bias); 149 | 150 | /// \brief For type "gaussian_quantized", get the precision of output 151 | /// signals. A value of zero implies infinite precision / no quantization. 152 | /// \return Precision of output signals. 153 | public: double Precision() const; 154 | 155 | /// \brief For type "gaussian_quantized", set the precision of output 156 | /// signals. A value of zero implies infinite precision / no quantization. 157 | /// \param[in] _precision Precision of output signals. 158 | public: void SetPrecision(double _precision); 159 | 160 | /// \brief For type "gaussian*", get the standard deviation of the noise 161 | /// used to drive a process to model slow variations in a sensor bias. 162 | /// \return The dynamic bias standard deviation. 163 | public: double DynamicBiasStdDev() const; 164 | 165 | /// \brief For type "gaussian*", set the standard deviation of the noise 166 | /// used to drive a process to model slow variations in a sensor bias. 167 | /// \param[in] _stddev The dynamic bias standard deviation. 168 | public: void SetDynamicBiasStdDev(double _stddev); 169 | 170 | /// \brief For type "gaussian*", get the correlation time of the noise 171 | /// used to drive a process to model slow variations in a sensor bias. 172 | /// \return The dynamic bias correlation time. 173 | public: double DynamicBiasCorrelationTime() const; 174 | 175 | /// \brief For type "gaussian*", set the correlation time in seconds of 176 | /// the noise used to drive a process to model slow variations in a sensor 177 | /// bias.A typical value, when used, would be on the order of 178 | /// 3600 seconds (1 hour). 179 | /// \param[in] _time The dynamic bias correlation time. 180 | public: void SetDynamicBiasCorrelationTime(double _time); 181 | 182 | /// \brief Get a pointer to the SDF element that was used during 183 | /// load. 184 | /// \return SDF element pointer. The value will be nullptr if Load has 185 | /// not been called. 186 | public: sdf::ElementPtr Element() const; 187 | 188 | /// \brief Private data pointer. 189 | private: NoisePrivate *dataPtr; 190 | }; 191 | } 192 | } 193 | #endif 194 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Model.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_MODEL_HH_ 18 | #define SDF_MODEL_HH_ 19 | 20 | #include 21 | #include 22 | #include "sdf/Element.hh" 23 | #include "sdf/Types.hh" 24 | #include "sdf/sdf_config.h" 25 | #include "sdf/system_util.hh" 26 | 27 | namespace sdf 28 | { 29 | // Inline bracket to help doxygen filtering. 30 | inline namespace SDF_VERSION_NAMESPACE { 31 | // 32 | 33 | // Forward declarations. 34 | class Joint; 35 | class Link; 36 | class ModelPrivate; 37 | 38 | class SDFORMAT_VISIBLE Model 39 | { 40 | /// \brief Default constructor 41 | public: Model(); 42 | 43 | /// \brief Copy constructor 44 | /// \param[in] _model Model to copy. 45 | public: Model(const Model &_model); 46 | 47 | /// \brief Move constructor 48 | /// \param[in] _model Model to move. 49 | public: Model(Model &&_model) noexcept; 50 | 51 | /// \brief Move assignment operator. 52 | /// \param[in] _model Model to move. 53 | /// \return Reference to this. 54 | public: Model &operator=(Model &&_model); 55 | 56 | /// \brief Copy assignment operator. 57 | /// \param[in] _model Model to copy. 58 | /// \return Reference to this. 59 | public: Model &operator=(const Model &_model); 60 | 61 | /// \brief Destructor 62 | public: ~Model(); 63 | 64 | /// \brief Load the model based on a element pointer. This is *not* the 65 | /// usual entry point. Typical usage of the SDF DOM is through the Root 66 | /// object. 67 | /// \param[in] _sdf The SDF Element pointer 68 | /// \return Errors, which is a vector of Error objects. Each Error includes 69 | /// an error code and message. An empty vector indicates no error. 70 | public: Errors Load(ElementPtr _sdf); 71 | 72 | /// \brief Get the name of the model. 73 | /// The name of the model should be unique within the scope of a World. 74 | /// \return Name of the model. 75 | public: std::string Name() const; 76 | 77 | /// \brief Set the name of the model. 78 | /// The name of the model should be unique within the scope of a World. 79 | /// \param[in] _name Name of the model. 80 | public: void SetName(const std::string &_name); 81 | 82 | /// \brief Check if this model should be static. 83 | /// A static model is one that is not subject to physical forces (in other 84 | /// words, it's purely kinematic instead of dynamic). 85 | /// \return true if the model should be static, false if it is dynamic. 86 | public: bool Static() const; 87 | 88 | /// \brief Set this model to be static or not static. 89 | /// \param[in] _static True or false depending on whether the model should 90 | /// be static. 91 | /// \sa Static() 92 | public: void SetStatic(bool _static); 93 | 94 | /// \brief Check if this model should self-collide. 95 | /// A self-colliding model is a model whose links will collide if they come 96 | /// into contact. If a model is not self-colliding, its links will pass 97 | /// through each other. 98 | /// \return true if the model should self-collide, false otherwise. 99 | public: bool SelfCollide() const; 100 | 101 | /// \brief Set this model to self-collide or not self-collide. 102 | /// \param[in] _selfCollide True or false depending on whether the model 103 | /// should self-collide. 104 | /// \sa SelfCollide() 105 | public: void SetSelfCollide(bool _selfCollide); 106 | 107 | /// \brief Check if this model should be allowed to auto-disable. 108 | /// If auto-disable is allowed, a model that is at rest can choose to not 109 | /// update its dynamics. 110 | /// \return true if auto-disable is allowed for this model 111 | public: bool AllowAutoDisable() const; 112 | 113 | /// \brief Set this model to allow auto-disabling. 114 | /// \param[in] _allowAutoDisable True or false depending on whether the 115 | /// model should be allowed to auto-disable. 116 | /// \sa AllowAutoDisable() 117 | public: void SetAllowAutoDisable(bool _allowAutoDisable); 118 | 119 | /// \brief Check if this model should be subject to wind. 120 | /// If true, all links in the model should be affected by the wind. This can 121 | /// be overridden per link. 122 | /// \return true if the model should be subject to wind, false otherwise. 123 | public: bool EnableWind() const; 124 | 125 | /// \brief Set whether this model should be subject to wind. 126 | /// \param[in] _enableWind True or false depending on whether the model 127 | /// should be subject to wind. 128 | public: void SetEnableWind(bool _enableWind); 129 | 130 | /// \brief Get the number of links. 131 | /// \return Number of links contained in this Model object. 132 | public: uint64_t LinkCount() const; 133 | 134 | /// \brief Get a link based on an index. 135 | /// \param[in] _index Index of the link. The index should be in the 136 | /// range [0..LinkCount()). 137 | /// \return Pointer to the link. Nullptr if the index does not exist. 138 | /// \sa uint64_t LinkCount() const 139 | public: const Link *LinkByIndex(const uint64_t _index) const; 140 | 141 | /// \brief Get a link based on a name. 142 | /// \param[in] _name Name of the link. 143 | /// \return Pointer to the link. Nullptr if the name does not exist. 144 | public: const Link *LinkByName(const std::string &_name) const; 145 | 146 | /// \brief Get whether a link name exists. 147 | /// \param[in] _name Name of the link to check. 148 | /// \return True if there exists a link with the given name. 149 | public: bool LinkNameExists(const std::string &_name) const; 150 | 151 | /// \brief Get the number of joints. 152 | /// \return Number of joints contained in this Model object. 153 | public: uint64_t JointCount() const; 154 | 155 | /// \brief Get a joint based on an index. 156 | /// \param[in] _index Index of the joint. The index should be in the 157 | /// range [0..JointCount()). 158 | /// \return Pointer to the joint. Nullptr if the index does not exist. 159 | /// \sa uint64_t JointCount() const 160 | public: const Joint *JointByIndex(const uint64_t _index) const; 161 | 162 | /// \brief Get whether a joint name exists. 163 | /// \param[in] _name Name of the joint to check. 164 | /// \return True if there exists a joint with the given name. 165 | public: bool JointNameExists(const std::string &_name) const; 166 | 167 | /// \brief Get a joint based on a name. 168 | /// \param[in] _name Name of the joint. 169 | /// \return Pointer to the joint. Nullptr if a joint with the given name 170 | /// does not exist. 171 | /// \sa bool JointNameExists(const std::string &_name) const 172 | public: const Joint *JointByName(const std::string &_name) const; 173 | 174 | /// \brief Get the pose of the model. This is the pose of the model 175 | /// as specified in SDF ( ... ), and is 176 | /// typically used to express the position and rotation of a model in a 177 | /// global coordinate frame. 178 | /// \return The pose of the model. 179 | public: const ignition::math::Pose3d &Pose() const; 180 | 181 | /// \brief Set the pose of the model. 182 | /// \sa const ignition::math::Pose3d &Pose() const 183 | /// \param[in] _pose The new model pose. 184 | public: void SetPose(const ignition::math::Pose3d &_pose); 185 | 186 | /// \brief Get the name of the coordinate frame in which this model's 187 | /// pose is expressed. A empty value indicates that the frame is the 188 | /// global/world coordinate frame. 189 | /// \return The name of the pose frame. 190 | public: const std::string &PoseFrame() const; 191 | 192 | /// \brief Set the name of the coordinate frame in which this model's 193 | /// pose is expressed. A empty value indicates that the frame is the 194 | /// global/world coordinate frame. 195 | /// \param[in] _frame The name of the pose frame. 196 | public: void SetPoseFrame(const std::string &_frame); 197 | 198 | /// \brief Get a pointer to the SDF element that was used during 199 | /// load. 200 | /// \return SDF element pointer. The value will be nullptr if Load has 201 | /// not been called. 202 | public: sdf::ElementPtr Element() const; 203 | 204 | /// \brief Private data pointer. 205 | private: ModelPrivate *dataPtr = nullptr; 206 | }; 207 | } 208 | } 209 | #endif 210 | -------------------------------------------------------------------------------- /src/auto_abi_checker/test/files/usr/include/sdformat-8.3/sdf/Lidar.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Open Source Robotics Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | #ifndef SDF_LIDAR_HH_ 18 | #define SDF_LIDAR_HH_ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | using namespace ignition; 28 | 29 | namespace sdf 30 | { 31 | // Inline bracket to help doxygen filtering. 32 | inline namespace SDF_VERSION_NAMESPACE { 33 | // 34 | class LidarPrivate; 35 | 36 | /// \brief Lidar contains information about a Lidar sensor. 37 | /// This sensor can be attached to a link. The Lidar sensor can be defined 38 | /// SDF XML using either the "ray" or "lidar" types. The "lidar" type is 39 | /// preffered as "ray" is considered legacy. 40 | /// 41 | /// # Example SDF XML using lidar type: 42 | /// 43 | /// ~~~{.xml} 44 | /// 45 | /// 1 2 3 0 0 0 46 | /// 47 | /// 48 | /// 49 | /// 320 50 | /// 0.9 51 | /// 1.75 52 | /// 2.94 53 | /// 54 | /// 55 | /// 240 56 | /// 0.8 57 | /// 2.75 58 | /// 3.94 59 | /// 60 | /// 61 | /// 62 | /// 1.23 63 | /// 4.56 64 | /// 7.89 65 | /// 66 | /// 67 | /// 0.98 68 | /// 0.76 69 | /// 70 | /// 71 | /// 72 | /// ~~~ 73 | /// 74 | /// # Example SDF XML using ray type: 75 | /// 76 | /// ~~~{.xml} 77 | /// 78 | /// 1 2 3 0 0 0 79 | /// 80 | /// 81 | /// 82 | /// 320 83 | /// 0.9 84 | /// 1.75 85 | /// 2.94 86 | /// 87 | /// 88 | /// 240 89 | /// 0.8 90 | /// 2.75 91 | /// 3.94 92 | /// 93 | /// 94 | /// 95 | /// 1.23 96 | /// 4.56 97 | /// 7.89 98 | /// 99 | /// 100 | /// 0.98 101 | /// 0.76 102 | /// 103 | /// 104 | /// 105 | /// ~~~ 106 | class SDFORMAT_VISIBLE Lidar 107 | { 108 | /// \brief Default constructor 109 | public: Lidar(); 110 | 111 | /// \brief Copy constructor 112 | /// \param[in] _lidar Lidar to copy. 113 | public: Lidar(const Lidar &_lidar); 114 | 115 | /// \brief Move constructor 116 | /// \param[in] _lidar Lidar to move. 117 | public: Lidar(Lidar &&_lidar) noexcept; 118 | 119 | /// \brief Destructor 120 | public: ~Lidar(); 121 | 122 | /// \brief Assignment operator 123 | /// \param[in] _lidar The lidar to set values from. 124 | /// \return *this 125 | public: Lidar &operator=(const Lidar &_lidar); 126 | 127 | /// \brief Move assignment operator 128 | /// \param[in] _lidar The lidar to set values from. 129 | /// \return *this 130 | public: Lidar &operator=(Lidar &&_lidar) noexcept; 131 | 132 | /// \brief Load the lidar based on an element pointer. This is *not* 133 | /// the usual entry point. Typical usage of the SDF DOM is through the Root 134 | /// object. 135 | /// \param[in] _sdf The SDF Element pointer 136 | /// \return Errors, which is a vector of Error objects. Each Error includes 137 | /// an error code and message. An empty vector indicates no error. 138 | public: Errors Load(ElementPtr _sdf); 139 | 140 | /// \brief Get a pointer to the SDF element that was used during 141 | /// load. 142 | /// \return SDF element pointer. The value will be nullptr if Load has 143 | /// not been called. 144 | public: sdf::ElementPtr Element() const; 145 | 146 | /// \brief Get the number of lidar rays horizontally to generate per laser 147 | /// sweep. 148 | /// \return Number of lidar rays horizontally per laser sweep. 149 | public: unsigned int HorizontalScanSamples() const; 150 | 151 | /// \brief Set the number of lidar rays horizontally to generate per laser 152 | /// sweep. 153 | /// \param[in] Number of lidar rays horizontally per laser sweep. 154 | public: void SetHorizontalScanSamples(unsigned int _samples); 155 | 156 | /// \brief Get the resolution for horizontal scan. 157 | /// \return Resolution for horizontal scan. 158 | public: double HorizontalScanResolution() const; 159 | 160 | /// \brief Set the resolution for horizontal scan. 161 | /// \param[in] Resolution for horizontal scan. 162 | public: void SetHorizontalScanResolution(double _res); 163 | 164 | /// \brief Get the minimum angle for horizontal scan. 165 | /// \return Minimum angle for horizontal scan. 166 | public: math::Angle HorizontalScanMinAngle() const; 167 | 168 | /// \brief Set the minimum angle for horizontal scan. 169 | /// \param[in] Minimum angle for horizontal scan. 170 | public: void SetHorizontalScanMinAngle(const math::Angle &_min); 171 | 172 | /// \brief Get the maximum angle for horizontal scan. 173 | /// \return Maximum angle for horizontal scan. 174 | public: math::Angle HorizontalScanMaxAngle() const; 175 | 176 | /// \brief Set the maximum angle for horizontal scan. 177 | /// \param[in] Maximum angle for horizontal scan. 178 | public: void SetHorizontalScanMaxAngle(const math::Angle &_max); 179 | 180 | /// \brief Get the number of lidar rays vertically to generate per laser 181 | /// sweep. 182 | /// \return Number of lidar rays vertically per laser sweep. 183 | public: unsigned int VerticalScanSamples() const; 184 | 185 | /// \brief Set the number of lidar rays vertically to generate per laser 186 | /// sweep. 187 | /// \param[in] Number of lidar rays vertically per laser sweep. 188 | public: void SetVerticalScanSamples(unsigned int _samples); 189 | 190 | /// \brief Get the resolution for vertical scan. 191 | /// \return Resolution for vertical scan. 192 | public: double VerticalScanResolution() const; 193 | 194 | /// \brief Set the resolution for vertical scan. 195 | /// \param[in] Resolution for vertical scan. 196 | public: void SetVerticalScanResolution(double _res); 197 | 198 | /// \brief Get the minimum angle for vertical scan. 199 | /// \return Minimum angle for vertical scan. 200 | public: math::Angle VerticalScanMinAngle() const; 201 | 202 | /// \brief Set the minimum angle for vertical scan. 203 | /// \param[in] Minimum angle for vertical scan. 204 | public: void SetVerticalScanMinAngle(const math::Angle &_min); 205 | 206 | /// \brief Get the maximum angle for vertical scan. 207 | /// \return Maximum angle for vertical scan. 208 | public: math::Angle VerticalScanMaxAngle() const; 209 | 210 | /// \brief Set the maximum angle for vertical scan. 211 | /// \param[in] Maximum angle for vertical scan. 212 | public: void SetVerticalScanMaxAngle(const math::Angle &_max); 213 | 214 | /// \brief Get minimum distance for each lidar ray. 215 | /// \return Minimum distance for each lidar ray. 216 | public: double RangeMin() const; 217 | 218 | /// \brief Set minimum distance for each lidar ray. 219 | /// \param[in] Minimum distance for each lidar ray. 220 | public: void SetRangeMin(double _min); 221 | 222 | /// \brief Get maximum distance for each lidar ray. 223 | /// \return Maximum distance for each lidar ray. 224 | public: double RangeMax() const; 225 | 226 | /// \brief Set maximum distance for each lidar ray. 227 | /// \param[in] Maximum distance for each lidar ray. 228 | public: void SetRangeMax(double _max); 229 | 230 | /// \brief Get linear resolution of each lidar ray. 231 | /// \return Linear resolution for each lidar ray. 232 | public: double RangeResolution() const; 233 | 234 | /// \brief Set linear resolution of each lidar ray. 235 | /// \param[in] Linear resolution for each lidar ray. 236 | public: void SetRangeResolution(double _range); 237 | 238 | /// \brief Get the noise values for the lidar sensor. 239 | /// \return Noise values for the lidar sensor. 240 | public: const Noise &LidarNoise() const; 241 | 242 | /// \biref Set the noise values for the lidar sensor. 243 | /// \param[in] _noise Noise values for the lidar sensor. 244 | public: void SetLidarNoise(const Noise &_noise); 245 | 246 | /// \brief Return true if both Lidar objects contain the same values. 247 | /// \param[_in] _lidar Lidar value to compare. 248 | /// \return True if 'this' == _lidar. 249 | public: bool operator==(const Lidar &_lidar) const; 250 | 251 | /// \brief Return true this Lidar object does not contain the same 252 | /// values as the passed in parameter. 253 | /// \param[_in] _lidar Lidar value to compare. 254 | /// \return True if 'this' != _lidar. 255 | public: bool operator!=(const Lidar &_lidar) const; 256 | 257 | /// \brief Private data pointer. 258 | private: LidarPrivate *dataPtr; 259 | }; 260 | } 261 | } 262 | #endif 263 | --------------------------------------------------------------------------------