├── .github
└── workflows
│ └── colcon-build.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── autoware_reference_system
├── CMakeLists.txt
├── README.md
├── autoware_reference_system.dot
├── cmake
│ ├── generate_report.cmake
│ ├── generate_summary_report.cmake
│ ├── generate_traces.cmake
│ └── test_requirements.cmake
├── include
│ └── autoware_reference_system
│ │ ├── autoware_system_builder.hpp
│ │ └── system
│ │ ├── priority
│ │ └── default.hpp
│ │ └── timing
│ │ ├── benchmark.hpp
│ │ └── default.hpp
├── package.xml
├── scripts
│ ├── benchmark_all.sh
│ ├── benchmark_one.sh
│ └── utils.sh
├── src
│ └── ros2
│ │ ├── executor
│ │ ├── autoware_default_multithreaded.cpp
│ │ ├── autoware_default_singlethreaded.cpp
│ │ ├── autoware_default_singlethreaded_picas_multi_executors.cpp
│ │ ├── autoware_default_singlethreaded_picas_single_executor.cpp
│ │ └── autoware_default_staticsinglethreaded.cpp
│ │ └── number_cruncher_benchmark.cpp
└── test
│ ├── callback_duration.py
│ ├── constants.py
│ ├── dropped_messages.py
│ ├── generate_callback_traces.py
│ ├── generate_graph.sh
│ ├── generate_reports.py
│ ├── generate_std_traces.py
│ ├── generate_summary_reports.py
│ ├── memory_usage.py
│ ├── std_latency.py
│ ├── test_autoware_reference_system.cpp
│ ├── test_platform.py
│ ├── test_requirements.py
│ ├── trace_utils.py
│ └── utils.py
├── content
└── img
│ └── autoware_reference_system.svg
├── rclcpp
├── .gitignore
├── CHANGELOG.rst
├── CMakeLists.txt
├── Doxyfile
├── QUALITY_DECLARATION.md
├── README.md
├── doc
│ ├── api_review_march_2020.md
│ └── notes_on_statically_typed_parameters.md
├── include
│ └── rclcpp
│ │ ├── allocator
│ │ ├── allocator_common.hpp
│ │ └── allocator_deleter.hpp
│ │ ├── any_executable.hpp
│ │ ├── any_service_callback.hpp
│ │ ├── any_subscription_callback.hpp
│ │ ├── callback_group.hpp
│ │ ├── cb_sched.hpp
│ │ ├── client.hpp
│ │ ├── clock.hpp
│ │ ├── context.hpp
│ │ ├── contexts
│ │ └── default_context.hpp
│ │ ├── create_client.hpp
│ │ ├── create_generic_publisher.hpp
│ │ ├── create_generic_subscription.hpp
│ │ ├── create_publisher.hpp
│ │ ├── create_service.hpp
│ │ ├── create_subscription.hpp
│ │ ├── create_timer.hpp
│ │ ├── detail
│ │ ├── README.md
│ │ ├── mutex_two_priorities.hpp
│ │ ├── qos_parameters.hpp
│ │ ├── resolve_enable_topic_statistics.hpp
│ │ ├── resolve_intra_process_buffer_type.hpp
│ │ ├── resolve_use_intra_process.hpp
│ │ ├── rmw_implementation_specific_payload.hpp
│ │ ├── rmw_implementation_specific_publisher_payload.hpp
│ │ ├── rmw_implementation_specific_subscription_payload.hpp
│ │ ├── subscription_callback_type_helper.hpp
│ │ └── utilities.hpp
│ │ ├── duration.hpp
│ │ ├── event.hpp
│ │ ├── exceptions.hpp
│ │ ├── exceptions
│ │ └── exceptions.hpp
│ │ ├── executor.hpp
│ │ ├── executor_options.hpp
│ │ ├── executors.hpp
│ │ ├── executors
│ │ ├── multi_threaded_executor.hpp
│ │ ├── single_threaded_executor.hpp
│ │ ├── static_executor_entities_collector.hpp
│ │ └── static_single_threaded_executor.hpp
│ │ ├── expand_topic_or_service_name.hpp
│ │ ├── experimental
│ │ ├── README.md
│ │ ├── buffers
│ │ │ ├── buffer_implementation_base.hpp
│ │ │ ├── intra_process_buffer.hpp
│ │ │ └── ring_buffer_implementation.hpp
│ │ ├── create_intra_process_buffer.hpp
│ │ ├── executable_list.hpp
│ │ ├── intra_process_manager.hpp
│ │ ├── subscription_intra_process.hpp
│ │ └── subscription_intra_process_base.hpp
│ │ ├── function_traits.hpp
│ │ ├── future_return_code.hpp
│ │ ├── generic_publisher.hpp
│ │ ├── generic_subscription.hpp
│ │ ├── graph_listener.hpp
│ │ ├── guard_condition.hpp
│ │ ├── init_options.hpp
│ │ ├── intra_process_buffer_type.hpp
│ │ ├── intra_process_setting.hpp
│ │ ├── loaned_message.hpp
│ │ ├── logger.hpp
│ │ ├── macros.hpp
│ │ ├── memory_strategies.hpp
│ │ ├── memory_strategy.hpp
│ │ ├── message_info.hpp
│ │ ├── message_memory_strategy.hpp
│ │ ├── network_flow_endpoint.hpp
│ │ ├── node.hpp
│ │ ├── node_impl.hpp
│ │ ├── node_interfaces
│ │ ├── node_base.hpp
│ │ ├── node_base_interface.hpp
│ │ ├── node_clock.hpp
│ │ ├── node_clock_interface.hpp
│ │ ├── node_graph.hpp
│ │ ├── node_graph_interface.hpp
│ │ ├── node_logging.hpp
│ │ ├── node_logging_interface.hpp
│ │ ├── node_parameters.hpp
│ │ ├── node_parameters_interface.hpp
│ │ ├── node_services.hpp
│ │ ├── node_services_interface.hpp
│ │ ├── node_time_source.hpp
│ │ ├── node_time_source_interface.hpp
│ │ ├── node_timers.hpp
│ │ ├── node_timers_interface.hpp
│ │ ├── node_topics.hpp
│ │ ├── node_topics_interface.hpp
│ │ ├── node_waitables.hpp
│ │ └── node_waitables_interface.hpp
│ │ ├── node_options.hpp
│ │ ├── parameter.hpp
│ │ ├── parameter_client.hpp
│ │ ├── parameter_event_handler.hpp
│ │ ├── parameter_events_filter.hpp
│ │ ├── parameter_map.hpp
│ │ ├── parameter_service.hpp
│ │ ├── parameter_value.hpp
│ │ ├── publisher.hpp
│ │ ├── publisher_base.hpp
│ │ ├── publisher_factory.hpp
│ │ ├── publisher_options.hpp
│ │ ├── qos.hpp
│ │ ├── qos_event.hpp
│ │ ├── qos_overriding_options.hpp
│ │ ├── rate.hpp
│ │ ├── rclcpp.hpp
│ │ ├── scope_exit.hpp
│ │ ├── serialization.hpp
│ │ ├── serialized_message.hpp
│ │ ├── service.hpp
│ │ ├── strategies
│ │ ├── allocator_memory_strategy.hpp
│ │ └── message_pool_memory_strategy.hpp
│ │ ├── subscription.hpp
│ │ ├── subscription_base.hpp
│ │ ├── subscription_factory.hpp
│ │ ├── subscription_options.hpp
│ │ ├── subscription_traits.hpp
│ │ ├── subscription_wait_set_mask.hpp
│ │ ├── time.hpp
│ │ ├── time_source.hpp
│ │ ├── timer.hpp
│ │ ├── topic_statistics
│ │ └── subscription_topic_statistics.hpp
│ │ ├── topic_statistics_state.hpp
│ │ ├── type_support_decl.hpp
│ │ ├── typesupport_helpers.hpp
│ │ ├── utilities.hpp
│ │ ├── visibility_control.hpp
│ │ ├── wait_for_message.hpp
│ │ ├── wait_result.hpp
│ │ ├── wait_result_kind.hpp
│ │ ├── wait_set.hpp
│ │ ├── wait_set_policies
│ │ ├── detail
│ │ │ ├── storage_policy_common.hpp
│ │ │ ├── synchronization_policy_common.hpp
│ │ │ └── write_preferring_read_write_lock.hpp
│ │ ├── dynamic_storage.hpp
│ │ ├── sequential_synchronization.hpp
│ │ ├── static_storage.hpp
│ │ └── thread_safe_synchronization.hpp
│ │ ├── wait_set_template.hpp
│ │ └── waitable.hpp
├── package.xml
├── resource
│ ├── get_interface.hpp.em
│ ├── interface_traits.hpp.em
│ └── logging.hpp.em
└── src
│ └── rclcpp
│ ├── any_executable.cpp
│ ├── callback_group.cpp
│ ├── client.cpp
│ ├── clock.cpp
│ ├── context.cpp
│ ├── contexts
│ └── default_context.cpp
│ ├── detail
│ ├── mutex_two_priorities.cpp
│ ├── resolve_parameter_overrides.cpp
│ ├── resolve_parameter_overrides.hpp
│ ├── rmw_implementation_specific_payload.cpp
│ ├── rmw_implementation_specific_publisher_payload.cpp
│ ├── rmw_implementation_specific_subscription_payload.cpp
│ └── utilities.cpp
│ ├── duration.cpp
│ ├── event.cpp
│ ├── exceptions
│ └── exceptions.cpp
│ ├── executable_list.cpp
│ ├── executor.cpp
│ ├── executors.cpp
│ ├── executors
│ ├── multi_threaded_executor.cpp
│ ├── single_threaded_executor.cpp
│ ├── static_executor_entities_collector.cpp
│ └── static_single_threaded_executor.cpp
│ ├── expand_topic_or_service_name.cpp
│ ├── future_return_code.cpp
│ ├── generic_publisher.cpp
│ ├── generic_subscription.cpp
│ ├── graph_listener.cpp
│ ├── guard_condition.cpp
│ ├── init_options.cpp
│ ├── intra_process_manager.cpp
│ ├── logger.cpp
│ ├── logging_mutex.cpp
│ ├── logging_mutex.hpp
│ ├── memory_strategies.cpp
│ ├── memory_strategy.cpp
│ ├── message_info.cpp
│ ├── network_flow_endpoint.cpp
│ ├── node.cpp
│ ├── node_interfaces
│ ├── node_base.cpp
│ ├── node_clock.cpp
│ ├── node_graph.cpp
│ ├── node_logging.cpp
│ ├── node_parameters.cpp
│ ├── node_services.cpp
│ ├── node_time_source.cpp
│ ├── node_timers.cpp
│ ├── node_topics.cpp
│ └── node_waitables.cpp
│ ├── node_options.cpp
│ ├── parameter.cpp
│ ├── parameter_client.cpp
│ ├── parameter_event_handler.cpp
│ ├── parameter_events_filter.cpp
│ ├── parameter_map.cpp
│ ├── parameter_service.cpp
│ ├── parameter_service_names.hpp
│ ├── parameter_value.cpp
│ ├── publisher_base.cpp
│ ├── qos.cpp
│ ├── qos_event.cpp
│ ├── qos_overriding_options.cpp
│ ├── serialization.cpp
│ ├── serialized_message.cpp
│ ├── service.cpp
│ ├── signal_handler.cpp
│ ├── signal_handler.hpp
│ ├── subscription_base.cpp
│ ├── subscription_intra_process_base.cpp
│ ├── time.cpp
│ ├── time_source.cpp
│ ├── timer.cpp
│ ├── type_support.cpp
│ ├── typesupport_helpers.cpp
│ ├── utilities.cpp
│ ├── wait_set_policies
│ └── detail
│ │ └── write_preferring_read_write_lock.cpp
│ └── waitable.cpp
├── reference_interfaces
├── CMakeLists.txt
├── msg
│ ├── Message4kb.idl
│ └── TransmissionStats.idl
└── package.xml
└── reference_system
├── CMakeLists.txt
├── README.md
├── include
└── reference_system
│ ├── msg_types.hpp
│ ├── nodes
│ ├── rclcpp
│ │ ├── command.hpp
│ │ ├── cyclic.hpp
│ │ ├── fusion.hpp
│ │ ├── intersection.hpp
│ │ ├── sensor.hpp
│ │ └── transform.hpp
│ └── settings.hpp
│ ├── number_cruncher.hpp
│ ├── sample_management.hpp
│ └── system
│ ├── systems.hpp
│ └── type
│ └── rclcpp_system.hpp
└── package.xml
/.github/workflows/colcon-build.yml:
--------------------------------------------------------------------------------
1 | # This is a basic workflow to help you get started with Actions
2 |
3 | name: CI
4 |
5 | # Controls when the workflow will run
6 | on:
7 | # Triggers the workflow on push or pull request events but only for the main branch
8 | push:
9 | branches: [ main ]
10 | pull_request:
11 | branches: [ main ]
12 |
13 | # Allows you to run this workflow manually from the Actions tab
14 | workflow_dispatch:
15 |
16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel
17 | jobs:
18 | # This workflow contains a single job called "build"
19 | build:
20 | # The type of runner that the job will run on
21 | runs-on: [ubuntu-latest]
22 | strategy:
23 | fail-fast: false
24 | matrix:
25 | ros_distribution:
26 | - foxy
27 | - galactic
28 | - rolling
29 | include:
30 | # Foxy Fitzroy (June 2020 - May 2023)
31 | - ros_distribution: foxy
32 | docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-foxy-ros-base-latest
33 | # Galactic Geochelone (May 2021 - November 2022)
34 | - ros_distribution: galactic
35 | docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-galactic-ros-base-latest
36 | # Rolling Ridley (June 2020 - Present)
37 | - ros_distribution: rolling
38 | docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-rolling-ros-base-latest
39 | container:
40 | image: ${{ matrix.docker_image }}
41 | # Steps represent a sequence of tasks that will be executed as part of the job
42 | steps:
43 | - name: setup workspace
44 | run: mkdir -p ros2_ws/src
45 | - name: checkout
46 | uses: actions/checkout@v2
47 | with:
48 | path: ros2_ws/src
49 | - name: build and test
50 | uses: ros-tooling/action-ros-ci@v0.2
51 | with:
52 | package-name: autoware_reference_system
53 | target-ros2-distro: ${{ matrix.ros_distribution }}
54 | vcs-repo-file-url: ""
55 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | **__pycache__
2 | .vscode/
3 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | Any contribution that you make to this repository will
2 | be under the Apache 2 License, as dictated by that
3 | [license](http://www.apache.org/licenses/LICENSE-2.0.html):
4 |
5 | ~~~
6 | 5. Submission of Contributions. Unless You explicitly state otherwise,
7 | any Contribution intentionally submitted for inclusion in the Work
8 | by You to the Licensor shall be under the terms and conditions of
9 | this License, without any additional terms or conditions.
10 | Notwithstanding the above, nothing herein shall supersede or modify
11 | the terms of any separate license agreement you may have executed
12 | with Licensor regarding such Contributions.
13 | ~~~
14 |
--------------------------------------------------------------------------------
/autoware_reference_system/cmake/generate_report.cmake:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Apex.AI, Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | # generate report from traces
16 | function(generate_report target trace_type runtime)
17 | if(${trace_type} MATCHES "memory")
18 | set(TRACE_DIR "${ROS_HOME}/${trace_type}/${target}_${rmw_implementation}_${runtime}s.txt")
19 | add_test(
20 | NAME generate_${trace_type}_report_${target}_${rmw_implementation}_${runtime}s
21 | COMMAND bash -c "python3 ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/test/generate_reports.py ${TRACE_DIR}"
22 | COMMENT "Generate CPU and Memory Usage report from psrecord data"
23 | )
24 | set_tests_properties(generate_${trace_type}_report_${target}_${rmw_implementation}_${runtime}s
25 | PROPERTIES TIMEOUT ${DEFAULT_TIMEOUT})
26 | elseif(${trace_type} MATCHES "std")
27 | add_test(
28 | NAME generate_${trace_type}_report_${target}_${rmw_implementation}_${runtime}s
29 | COMMAND bash -c "python3 ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/test/generate_reports.py ${ROS_LOG_DIR}"
30 | COMMENT "Generate Latency and Dropped Message reports from the std print log files"
31 | )
32 | else()
33 | set(TRACE_DIR "${ROS_HOME}/tracing/${trace_type}_${target}_${rmw_implementation}_${runtime}s")
34 | # future note: this will fail on windows
35 | add_test(
36 | NAME convert_${trace_type}_trace_${target}_${rmw_implementation}_${runtime}s
37 | COMMAND bash -c "ros2 run tracetools_analysis convert ${TRACE_DIR}"
38 | )
39 | set_tests_properties(convert_${trace_type}_trace_${target}_${rmw_implementation}_${runtime}s
40 | PROPERTIES TIMEOUT ${DEFAULT_TIMEOUT})
41 | add_test(
42 | NAME process_${trace_type}_trace_${target}_${rmw_implementation}_${runtime}s
43 | COMMAND bash -c "ros2 run tracetools_analysis process ${TRACE_DIR}"
44 | )
45 | set_tests_properties(process_${trace_type}_trace_${target}_${rmw_implementation}_${runtime}s
46 | PROPERTIES TIMEOUT ${DEFAULT_TIMEOUT})
47 | add_test(
48 | NAME generate_${trace_type}_report_${target}_${rmw_implementation}_${runtime}s
49 | COMMAND bash -c "python3 ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/test/generate_reports.py ${TRACE_DIR}"
50 | COMMENT "Process converted traces to create data model"
51 | )
52 | set_tests_properties(generate_${trace_type}_report_${target}_${rmw_implementation}_${runtime}s
53 | PROPERTIES TIMEOUT ${DEFAULT_TIMEOUT})
54 | endif()
55 | endfunction()
--------------------------------------------------------------------------------
/autoware_reference_system/cmake/generate_summary_report.cmake:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Apex.AI, Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | # generate summary report from all trace data
16 | function(generate_summary_report trace_type run_time)
17 | if(${trace_type} MATCHES "memory")
18 | set(TRACE_DIR "${ROS_HOME}/${trace_type}")
19 | elseif(${trace_type} MATCHES "std")
20 | set(TRACE_DIR "${ROS_LOG_DIR}")
21 | else()
22 | set(TRACE_DIR "${ROS_HOME}/tracing")
23 | endif()
24 |
25 | add_test(
26 | NAME generate_summary_report_${trace_type}_${run_time}s
27 | COMMAND bash -c "python3 ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/test/generate_summary_reports.py ${TRACE_DIR} ${run_time}"
28 | COMMENT "Generate Summary Report"
29 | )
30 | set_tests_properties(generate_summary_report_${trace_type}_${run_time}s
31 | PROPERTIES TIMEOUT ${DEFAULT_TIMEOUT})
32 | endfunction()
--------------------------------------------------------------------------------
/autoware_reference_system/cmake/generate_traces.cmake:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Apex.AI, Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | # run target for n seconds
16 | function(generate_traces target trace_type runtime)
17 | set(TEST_EXECUTABLE ${target})
18 | set(TEST_EXECUTABLE_NAME ${target}_${rmw_implementation})
19 | set(TRACE_TYPE ${trace_type})
20 | set(RUNTIME ${runtime})
21 | set(RMW_IMPLEMENTATION ${rmw_implementation})
22 | # ensure timeout is longer than the test runtime
23 | math(EXPR timeout "${runtime} + 5")
24 | if(${trace_type} MATCHES "memory")
25 | set(MEMRECORD_PATH "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/scripts/benchmark_one.sh")
26 | set(MEMRECORD_LOG "${ROS_HOME}/${trace_type}")
27 | set(MEMRECORD_LOG_NAME "${target}_${rmw_implementation}_${runtime}s.txt")
28 | set(MEMRECORD_EXE "$(ros2 pkg prefix ${PROJECT_NAME})/lib/${PROJECT_NAME}/${target}")
29 | # run psrecord script instead of ros2_tracing for memory usage plots
30 | add_test(
31 | NAME generate_${trace_type}_trace_${target}_${rmw_implementation}_${runtime}s
32 | COMMAND
33 | bash -c
34 | "chmod u+x ${MEMRECORD_PATH};
35 | RMW_IMPLEMENTATION=${rmw_implementation} \
36 | ${MEMRECORD_PATH} \
37 | ${MEMRECORD_EXE} \
38 | ${runtime} \
39 | ${MEMRECORD_LOG} \
40 | ${MEMRECORD_LOG_NAME}"
41 | )
42 | set_tests_properties(generate_${trace_type}_trace_${target}_${rmw_implementation}_${runtime}s
43 | PROPERTIES TIMEOUT ${DEFAULT_TIMEOUT})
44 | else()
45 | # callback and std trace types run ros_tests
46 | # replaces all @var@ and ${var} within input file
47 | configure_file(
48 | test/generate_${trace_type}_traces.py
49 | generate_${trace_type}_traces_${target}_${rmw_implementation}_${runtime}s.py
50 | @ONLY
51 | )
52 | add_ros_test(
53 | ${CMAKE_CURRENT_BINARY_DIR}/generate_${trace_type}_traces_${target}_${rmw_implementation}_${runtime}s.py
54 | TIMEOUT ${timeout} # seconds
55 | )
56 | endif()
57 | if(TARGET ${target})
58 | ament_target_dependencies(${target}
59 | "rclcpp" "reference_interfaces" "reference_system")
60 | endif()
61 | endfunction()
--------------------------------------------------------------------------------
/autoware_reference_system/cmake/test_requirements.cmake:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Apex.AI, Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | # make sure executable matches system requirements
16 | function(test_requirements target)
17 | set(TEST_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/${target})
18 | set(TEST_EXECUTABLE_NAME test_requirements_${target})
19 | # replaces all @var@ and ${var} within input file
20 | configure_file(
21 | test/test_requirements.py
22 | test_requirements_${target}.py
23 | @ONLY
24 | )
25 | add_ros_test(
26 | ${CMAKE_CURRENT_BINARY_DIR}/test_requirements_${target}.py
27 | TIMEOUT ${DEFAULT_TIMEOUT} # seconds
28 | )
29 | if(TARGET ${target})
30 | ament_target_dependencies(${target}
31 | "rclcpp" "reference_interfaces" "reference_system")
32 | endif()
33 | endfunction()
--------------------------------------------------------------------------------
/autoware_reference_system/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | autoware_reference_system
5 | 0.1.1
6 | Autoware Reference System for the ROScon workshop
7 | Evan Flynn
8 | Apache License 2.0
9 |
10 | Christian Eltzschig
11 |
12 | ament_cmake
13 | ament_cmake_auto
14 |
15 | reference_system
16 |
17 | rclcpp
18 | reference_interfaces
19 | rcl_interfaces
20 |
21 | ament_cmake_pytest
22 | ament_cmake_gtest
23 | ament_lint_auto
24 | ament_lint_common
25 | ros_testing
26 | launch
27 | launch_ros
28 | tracetools_analysis
29 | tracetools_launch
30 | tracetools_trace
31 | python3-bokeh-pip
32 | python3-selenium
33 |
34 |
35 | ament_cmake
36 |
37 |
38 |
--------------------------------------------------------------------------------
/autoware_reference_system/scripts/benchmark_all.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # arg1: duration to run test in seconds
3 | source $(dirname "$0")/utils.sh
4 |
5 | check_psrecord
6 |
7 | for FILE in $(find build/autoware_reference_system/ -maxdepth 1 -type f -executable); do
8 | generate_memory_data $FILE $1
9 | done
10 |
--------------------------------------------------------------------------------
/autoware_reference_system/scripts/benchmark_one.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # arg1: duration to run test in seconds
3 | # arg2: name of target to test
4 | # arg3: path to store log data (directory only)
5 | # arg4: log filename (including filetype extension, e.g. .txt)
6 | source $(dirname "$0")/utils.sh
7 |
8 | check_psrecord
9 |
10 | generate_memory_data $1 $2 $3 $4
11 |
--------------------------------------------------------------------------------
/autoware_reference_system/scripts/utils.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function check_psrecord {
4 | if ! [ -x "$(command -v psrecord)" ]; then
5 | echo psrecord is not installed, please install it with pip install -U psrecord
6 | exit 1
7 | fi
8 | }
9 |
10 | function generate_memory_data {
11 | [ ! -d ${3} ] && mkdir -p ${3}/
12 | full_log_name="${3}"
13 | [ ! "${full_log_name: -1}" == "/" ] && full_log_name+="/"
14 | full_log_name+="${4}"
15 | plot_name="${3}"
16 | plot_name="${4:-4}"
17 | plot_name+=".png"
18 | echo "Benchmarking: $1"
19 | echo "Duration: $2"
20 | echo "writing logs to: ${full_log_name}"
21 | psrecord $1 --include-children --log ${full_log_name} --plot ${plot_name} --duration $2
22 | killall $1
23 | }
--------------------------------------------------------------------------------
/autoware_reference_system/src/ros2/executor/autoware_default_multithreaded.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2021 Apex.AI, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include "rclcpp/rclcpp.hpp"
16 |
17 | #include "reference_system/system/systems.hpp"
18 |
19 | #include "autoware_reference_system/autoware_system_builder.hpp"
20 | #include "autoware_reference_system/system/timing/benchmark.hpp"
21 | #include "autoware_reference_system/system/timing/default.hpp"
22 |
23 | int main(int argc, char * argv[])
24 | {
25 | rclcpp::init(argc, argv);
26 |
27 | using TimeConfig = nodes::timing::Default;
28 | // uncomment for benchmarking
29 | // using TimeConfig = nodes::timing::BenchmarkCPUUsage;
30 | // set_benchmark_mode(true);
31 |
32 | auto nodes = create_autoware_nodes();
33 |
34 | rclcpp::executors::MultiThreadedExecutor executor;
35 | for (auto & node : nodes) {
36 | executor.add_node(node);
37 | }
38 | executor.spin();
39 |
40 | nodes.clear();
41 | rclcpp::shutdown();
42 |
43 | return 0;
44 | }
45 |
--------------------------------------------------------------------------------
/autoware_reference_system/src/ros2/executor/autoware_default_singlethreaded.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2021 Apex.AI, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include "rclcpp/rclcpp.hpp"
16 |
17 | #include "reference_system/system/systems.hpp"
18 |
19 | #include "autoware_reference_system/autoware_system_builder.hpp"
20 | #include "autoware_reference_system/system/timing/benchmark.hpp"
21 | #include "autoware_reference_system/system/timing/default.hpp"
22 |
23 | int main(int argc, char * argv[])
24 | {
25 | rclcpp::init(argc, argv);
26 |
27 | using TimeConfig = nodes::timing::Default;
28 | // uncomment for benchmarking
29 | // using TimeConfig = nodes::timing::BenchmarkCPUUsage;
30 | // set_benchmark_mode(true);
31 |
32 | auto nodes = create_autoware_nodes();
33 |
34 | rclcpp::executors::SingleThreadedExecutor executor;
35 | for (auto & node : nodes) {
36 | executor.add_node(node);
37 | }
38 | executor.spin();
39 |
40 | nodes.clear();
41 | rclcpp::shutdown();
42 |
43 | return 0;
44 | }
45 |
--------------------------------------------------------------------------------
/autoware_reference_system/src/ros2/executor/autoware_default_singlethreaded_picas_single_executor.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2021 Apex.AI, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include "rclcpp/rclcpp.hpp"
16 |
17 | #include "reference_system/system/systems.hpp"
18 |
19 | #include "autoware_reference_system/autoware_system_builder.hpp"
20 | #include "autoware_reference_system/system/timing/benchmark.hpp"
21 | #include "autoware_reference_system/system/timing/default.hpp"
22 |
23 | int main(int argc, char * argv[])
24 | {
25 | rclcpp::init(argc, argv);
26 |
27 | using TimeConfig = nodes::timing::Default;
28 | // uncomment for benchmarking
29 | //using TimeConfig = nodes::timing::BenchmarkCPUUsage;
30 | // set_benchmark_mode(true);
31 |
32 | auto nodes = create_autoware_nodes();
33 |
34 | rclcpp::executors::SingleThreadedExecutor executor;
35 |
36 | executor.enable_callback_priority();
37 | RCLCPP_INFO(rclcpp::get_logger("rclcpp"), "PiCAS priority-based callback scheduling: %s", executor.callback_priority_enabled ? "Enabled" : "Disabled");
38 |
39 | executor.set_executor_priority_cpu(90, 0);
40 | RCLCPP_INFO(rclcpp::get_logger("rclcpp"), "PiCAS executor 1's rt-priority %d and CPU %d", executor.executor_priority, executor.executor_cpu);
41 |
42 | for (auto & node : nodes) {
43 | executor.add_node(node);
44 | }
45 | executor.spin_rt();
46 |
47 | nodes.clear();
48 | rclcpp::shutdown();
49 |
50 | return 0;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/autoware_reference_system/src/ros2/executor/autoware_default_staticsinglethreaded.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2021 Apex.AI, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include "rclcpp/rclcpp.hpp"
16 |
17 | #include "reference_system/system/systems.hpp"
18 |
19 | #include "autoware_reference_system/autoware_system_builder.hpp"
20 | #include "autoware_reference_system/system/timing/benchmark.hpp"
21 | #include "autoware_reference_system/system/timing/default.hpp"
22 |
23 | int main(int argc, char * argv[])
24 | {
25 | rclcpp::init(argc, argv);
26 |
27 | using TimeConfig = nodes::timing::Default;
28 | // uncomment for benchmarking
29 | // using TimeConfig = nodes::timing::BenchmarkCPUUsage;
30 | // set_benchmark_mode(true);
31 |
32 | auto nodes = create_autoware_nodes();
33 |
34 | rclcpp::executors::StaticSingleThreadedExecutor executor;
35 | for (auto & node : nodes) {
36 | executor.add_node(node);
37 | }
38 | executor.spin();
39 |
40 | nodes.clear();
41 | rclcpp::shutdown();
42 |
43 | return 0;
44 | }
45 |
--------------------------------------------------------------------------------
/autoware_reference_system/src/ros2/number_cruncher_benchmark.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2021 Apex.AI, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 | //
15 | #include "reference_system/number_cruncher.hpp"
16 |
17 | #include
18 | #include
19 |
20 | long double get_crunch_time_in_ms(const uint64_t maximum_number)
21 | {
22 | auto start = std::chrono::system_clock::now();
23 | number_cruncher(maximum_number);
24 | auto stop = std::chrono::system_clock::now();
25 | return static_cast(
26 | std::chrono::nanoseconds(stop - start).count() / 1000000.0);
27 | }
28 | int main()
29 | {
30 | long double crunch_time = 0.0;
31 | std::cout << "maximum_number run time" << std::endl;
32 | for (uint64_t i = 64; crunch_time < 1000.0; i *= 2) {
33 | crunch_time = get_crunch_time_in_ms(i);
34 | std::cout << std::setfill(' ') << std::setw(12) << i << " " <<
35 | crunch_time << "ms" << std::endl;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/autoware_reference_system/test/constants.py:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Apex.AI, Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | TRACE_CALLBACK = 'tracing'
16 | TRACE_MEMORY = 'memory'
17 | TRACE_STD = 'log'
18 | TRACE_UNSUPPORTED = 'unsupported'
19 | # TODO(flynneva): support path as just the `tracing` directory and loop over
20 | # all subdirectories that have tracing data in them
21 | TRACE_DIRECTORY = 'tracing'
22 |
23 | SIZE_SUMMARY = 800
24 | SIZE_SUBPLOT = 500
25 |
--------------------------------------------------------------------------------
/autoware_reference_system/test/generate_graph.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if ! [ -x "$(command -v psrecord)" ]
4 | then
5 | echo Please install psrecord and make it available via the PATH variable.
6 | echo \# pip install psrecord
7 | echo \# export PATH=\${PATH}:\${HOME}/.local/bin/
8 | exit -1
9 | fi
10 |
11 | psrecord "ros2 run reference_system_autoware $1" --log $2 --plot $3 --duration $4
--------------------------------------------------------------------------------
/autoware_reference_system/test/generate_std_traces.py:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Apex.AI, Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | import time
15 | import unittest
16 |
17 | from launch import LaunchDescription
18 | from launch.actions import SetEnvironmentVariable
19 | from launch_ros.actions import Node
20 |
21 | import launch_testing
22 | import launch_testing.actions
23 |
24 | # Generate traces for specified executables and RMWs
25 |
26 | # this file has @variables@ that are meant to be automatically replaced
27 | # by values using the `configure_file` CMake function during the build
28 | RUNTIME = int('@RUNTIME@')
29 |
30 |
31 | def generate_test_description():
32 | # replaced with cmake `configure_file` function
33 | rmw_impl = '@RMW_IMPLEMENTATION@'
34 | test_exe = '@TEST_EXECUTABLE@'
35 | test_exe_name = '@TEST_EXECUTABLE_NAME@'
36 | trace_type = '@TRACE_TYPE@'
37 |
38 | launch_description = LaunchDescription()
39 |
40 | # see https://github.com/ros2/launch/issues/417
41 | # have to use `SetEnvironmentVariable` to set env vars in launch description
42 | envvar_rcutils_action = SetEnvironmentVariable(
43 | 'RCUTILS_CONSOLE_OUTPUT_FORMAT', '[{severity}] [{name}]: {message}')
44 | envvar_rmw_action = SetEnvironmentVariable(
45 | 'RMW_IMPLEMENTATION', rmw_impl)
46 | envvar_rclassert_rmw_action = SetEnvironmentVariable(
47 | 'RCL_ASSERT_RMW_ID_MATCHES', rmw_impl)
48 |
49 | node_under_test = Node(
50 | package='autoware_reference_system',
51 | executable=test_exe,
52 | output='screen'
53 | )
54 |
55 | launch_description.add_action(envvar_rcutils_action)
56 | launch_description.add_action(envvar_rclassert_rmw_action)
57 | launch_description.add_action(envvar_rmw_action)
58 | launch_description.add_action(node_under_test)
59 | launch_description.add_action(
60 | launch_testing.actions.ReadyToTest()
61 | )
62 | return launch_description, locals()
63 |
64 |
65 | class TestGenerateTracesAutowareReferenceSystem(unittest.TestCase):
66 |
67 | def test_generate_traces(self):
68 | global RUNTIME
69 | start_time = time.time()
70 | end_time = start_time + RUNTIME
71 |
72 | while time.time() < end_time:
73 | print('generating traces...')
74 | time.sleep(0.25) # seconds
75 |
76 | self.assertTrue(True)
77 |
--------------------------------------------------------------------------------
/autoware_reference_system/test/test_autoware_reference_system.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2021 Apex.AI, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include "gtest/gtest.h"
16 |
17 | TEST(TestReferenceSystemAutoware, DummyTest) {
18 | EXPECT_EQ(1, 1);
19 | }
20 |
--------------------------------------------------------------------------------
/autoware_reference_system/test/test_platform.py:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Apex.AI, Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | import multiprocessing
16 | import platform
17 |
18 | # this file has @variables@ that are meant to be automatically replaced
19 | # by values using the `configure_file` CMake function during the build
20 |
21 | platforms = {}
22 |
23 | # TODO(flynneva): move this to its own file for portability
24 | # can add more supported platforms here
25 | platforms['rpi4-linux-rt'] = {
26 | 'common-name': 'raspberrypi4',
27 | 'machine': 'aarch64',
28 | 'processor': 'aarch64',
29 | 'system': 'Linux',
30 | 'flavor': 'ubuntu',
31 | 'cores': 4,
32 | 'realtime': True
33 | }
34 |
35 |
36 | def test_platform():
37 | # get current system information
38 | system, node, release, version, machine, processor = platform.uname()
39 | platform_supported = False
40 | for pform in platforms:
41 | if(platforms[pform]['system'] == system):
42 | if(platforms[pform]['processor'] == processor):
43 | platform_supported = True
44 | assert multiprocessing.cpu_count() == platforms[pform]['cores']
45 | if(platforms[pform]['realtime']):
46 | assert version.find('PREEMPT_RT') != -1
47 | if platform_supported:
48 | print('platform supported')
49 | assert True
50 | else:
51 | print('platform unsupported')
52 | assert False
53 |
--------------------------------------------------------------------------------
/autoware_reference_system/test/trace_utils.py:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Apex.AI, Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | from tracetools_analysis.loading import load_file
15 | from tracetools_analysis.processor.ros2 import Ros2Handler
16 | from tracetools_analysis.utils.ros2 import Ros2DataModelUtil
17 |
18 |
19 | def initDataModel(path):
20 | events = load_file(path)
21 | handler = Ros2Handler.process(events)
22 | # handler.data.print_data()
23 |
24 | return Ros2DataModelUtil(handler.data)
25 |
--------------------------------------------------------------------------------
/autoware_reference_system/test/utils.py:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Apex.AI, Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | import os
16 | import sys
17 |
18 | from constants import TRACE_CALLBACK, TRACE_MEMORY, TRACE_STD, TRACE_UNSUPPORTED
19 |
20 |
21 | def checkPath(path: str):
22 | # make sure directory exists
23 | if not os.path.isdir(path):
24 | # make sure given path isnt a file
25 | if not os.path.isfile(path):
26 | print('Given path does not exist: ' + path)
27 | sys.exit()
28 | # make sure path ends in a `/`
29 | if (path[-1] != '/'):
30 | if not (path.find('.txt') >= 0):
31 | path += '/'
32 | return path
33 |
34 |
35 | def getTraceType(path):
36 | # check if given path is a callback trace
37 | if path.find(TRACE_CALLBACK) >= 0:
38 | return TRACE_CALLBACK
39 | elif path.find(TRACE_MEMORY) >= 0:
40 | return TRACE_MEMORY
41 | elif path.find(TRACE_STD) >= 0:
42 | return TRACE_STD
43 | else:
44 | return TRACE_UNSUPPORTED
45 |
46 |
47 | def getPWD(path):
48 | return os.path.basename(os.path.normpath(path))
49 |
50 |
51 | def getDirPath(path):
52 | # given path is a filename, remove filename but keep rest of path
53 | return os.path.dirname(path) + '/'
54 |
55 |
56 | def getFileName(path):
57 | return os.path.splitext(os.path.basename(path))[0]
58 |
--------------------------------------------------------------------------------
/rclcpp/.gitignore:
--------------------------------------------------------------------------------
1 | doc_output
2 |
--------------------------------------------------------------------------------
/rclcpp/Doxyfile:
--------------------------------------------------------------------------------
1 | # All settings not listed here will use the Doxygen default values.
2 |
3 | PROJECT_NAME = "rclcpp"
4 | PROJECT_NUMBER = master
5 | PROJECT_BRIEF = "C++ ROS Client Library API"
6 |
7 | # Use these lines to include the generated logging.hpp (update install path if needed)
8 | #INPUT = ../../../../install_isolated/rclcpp/include
9 | #STRIP_FROM_PATH = /Users/william/ros2_ws/install_isolated/rclcpp/include
10 | # Otherwise just generate for the local (non-generated header files)
11 | INPUT = ./include
12 |
13 | RECURSIVE = YES
14 | OUTPUT_DIRECTORY = doc_output
15 |
16 | EXTRACT_ALL = YES
17 | SORT_MEMBER_DOCS = NO
18 |
19 | GENERATE_LATEX = NO
20 |
21 | ENABLE_PREPROCESSING = YES
22 | MACRO_EXPANSION = YES
23 | EXPAND_ONLY_PREDEF = YES
24 | PREDEFINED = RCLCPP_PUBLIC=
25 |
26 | # Tag files that do not exist will produce a warning and cross-project linking will not work.
27 | TAGFILES += "../../../../doxygen_tag_files/cppreference-doxygen-web.tag.xml=http://en.cppreference.com/w/"
28 | # Consider changing "latest" to the version you want to reference (e.g. beta1 or 1.0.0)
29 | TAGFILES += "../../../../doxygen_tag_files/rcl.tag=http://docs.ros2.org/latest/api/rcl/"
30 | TAGFILES += "../../../../doxygen_tag_files/rmw.tag=http://docs.ros2.org/latest/api/rmw/"
31 | TAGFILES += "../../../../doxygen_tag_files/rcutils.tag=http://docs.ros2.org/latest/api/rcutils/"
32 | # Uncomment to generate tag files for cross-project linking.
33 | #GENERATE_TAGFILE = "../../../../doxygen_tag_files/rclcpp.tag"
34 |
--------------------------------------------------------------------------------
/rclcpp/README.md:
--------------------------------------------------------------------------------
1 | # `rclcpp`
2 |
3 | The ROS client library in C++.
4 |
5 | Visit the [rclcpp API documentation](http://docs.ros2.org/latest/api/rclcpp/) for a complete list of its main components and features.
6 |
7 | ## Quality Declaration
8 |
9 | This package claims to be in the **Quality Level 1** category, see the [Quality Declaration](QUALITY_DECLARATION.md) for more details.
10 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/any_executable.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__ANY_EXECUTABLE_HPP_
16 | #define RCLCPP__ANY_EXECUTABLE_HPP_
17 |
18 | #include
19 |
20 | #include "rclcpp/callback_group.hpp"
21 | #include "rclcpp/client.hpp"
22 | #include "rclcpp/macros.hpp"
23 | #include "rclcpp/node_interfaces/node_base_interface.hpp"
24 | #include "rclcpp/service.hpp"
25 | #include "rclcpp/subscription.hpp"
26 | #include "rclcpp/timer.hpp"
27 | #include "rclcpp/visibility_control.hpp"
28 | #include "rclcpp/waitable.hpp"
29 |
30 | namespace rclcpp
31 | {
32 |
33 | struct AnyExecutable
34 | {
35 | RCLCPP_PUBLIC
36 | AnyExecutable();
37 |
38 | RCLCPP_PUBLIC
39 | virtual ~AnyExecutable();
40 |
41 | // Only one of the following pointers will be set.
42 | rclcpp::SubscriptionBase::SharedPtr subscription;
43 | rclcpp::TimerBase::SharedPtr timer;
44 | rclcpp::ServiceBase::SharedPtr service;
45 | rclcpp::ClientBase::SharedPtr client;
46 | rclcpp::Waitable::SharedPtr waitable;
47 | // These are used to keep the scope on the containing items
48 | rclcpp::CallbackGroup::SharedPtr callback_group;
49 | rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base;
50 | std::shared_ptr data;
51 | };
52 |
53 | } // namespace rclcpp
54 |
55 | #endif // RCLCPP__ANY_EXECUTABLE_HPP_
56 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/cb_sched.hpp:
--------------------------------------------------------------------------------
1 | #ifndef RCLCPP__CB_SCHED_HPP_
2 | #define RCLCPP__CB_SCHED_HPP_
3 |
4 | //#define PICAS_DEBUG // comment this out for non-debug mode
5 |
6 | #ifdef PICAS_DEBUG
7 | #include
8 | #include
9 | #include
10 |
11 | static inline void print_stacktrace() // from https://panthema.net/
12 | {
13 | RCLCPP_INFO(rclcpp::get_logger("stack"), "trace start");
14 |
15 | // storage array for stack trace address data
16 | void* addrlist[20];
17 |
18 | // retrieve current stack addresses
19 | int addrlen = backtrace(addrlist, sizeof(addrlist) / sizeof(void*));
20 |
21 | if (addrlen == 0) {
22 | RCLCPP_INFO(rclcpp::get_logger("stack"), "");
23 | return;
24 | }
25 |
26 | // resolve addresses into strings containing "filename(function+address)",
27 | // this array must be free()-ed
28 | char** symbollist = backtrace_symbols(addrlist, addrlen);
29 |
30 | // allocate string which will be filled with the demangled function name
31 | size_t funcnamesize = 256;
32 | char* funcname = (char*)malloc(funcnamesize);
33 |
34 | // iterate over the returned symbol lines. skip the first, it is the
35 | // address of this function.
36 | for (int i = 1; i < addrlen; i++)
37 | {
38 | char *begin_name = 0, *begin_offset = 0, *end_offset = 0;
39 |
40 | // find parentheses and +address offset surrounding the mangled name:
41 | // ./module(function+0x15c) [0x8048a6d]
42 | for (char *p = symbollist[i]; *p; ++p)
43 | {
44 | if (*p == '(')
45 | begin_name = p;
46 | else if (*p == '+')
47 | begin_offset = p;
48 | else if (*p == ')' && begin_offset) {
49 | end_offset = p;
50 | break;
51 | }
52 | }
53 |
54 | if (begin_name && begin_offset && end_offset
55 | && begin_name < begin_offset)
56 | {
57 | *begin_name++ = '\0';
58 | *begin_offset++ = '\0';
59 | *end_offset = '\0';
60 |
61 | // mangled name is now in [begin_name, begin_offset) and caller
62 | // offset in [begin_offset, end_offset). now apply
63 | // __cxa_demangle():
64 |
65 | int status;
66 | char* ret = abi::__cxa_demangle(begin_name, funcname, &funcnamesize, &status);
67 | if (status == 0) {
68 | funcname = ret; // use possibly realloc()-ed string
69 | RCLCPP_INFO(rclcpp::get_logger("stack"), " %s : %s+%s", symbollist[i], funcname, begin_offset);
70 | }
71 | else {
72 | // demangling failed. Output function name as a C function with
73 | // no arguments.
74 | RCLCPP_INFO(rclcpp::get_logger("stack"), " %s : %s()+%s", symbollist[i], begin_name, begin_offset);
75 | }
76 | }
77 | else
78 | {
79 | // couldn't parse the line? print the whole line.
80 | RCLCPP_INFO(rclcpp::get_logger("stack"), " %s", symbollist[i]);
81 | }
82 | }
83 | free(funcname);
84 | free(symbollist);
85 | }
86 |
87 | #endif
88 |
89 | #endif
90 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/contexts/default_context.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__CONTEXTS__DEFAULT_CONTEXT_HPP_
16 | #define RCLCPP__CONTEXTS__DEFAULT_CONTEXT_HPP_
17 |
18 | #include "rclcpp/context.hpp"
19 | #include "rclcpp/visibility_control.hpp"
20 |
21 | namespace rclcpp
22 | {
23 | namespace contexts
24 | {
25 |
26 | class DefaultContext : public rclcpp::Context
27 | {
28 | public:
29 | RCLCPP_SMART_PTR_DEFINITIONS(DefaultContext)
30 |
31 | RCLCPP_PUBLIC
32 | DefaultContext();
33 | };
34 |
35 | RCLCPP_PUBLIC
36 | DefaultContext::SharedPtr
37 | get_global_default_context();
38 |
39 | } // namespace contexts
40 | } // namespace rclcpp
41 |
42 | #endif // RCLCPP__CONTEXTS__DEFAULT_CONTEXT_HPP_
43 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/create_client.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__CREATE_CLIENT_HPP_
16 | #define RCLCPP__CREATE_CLIENT_HPP_
17 |
18 | #include
19 | #include
20 |
21 | #include "rclcpp/node_interfaces/node_base_interface.hpp"
22 | #include "rclcpp/node_interfaces/node_services_interface.hpp"
23 | #include "rmw/rmw.h"
24 |
25 | namespace rclcpp
26 | {
27 |
28 | /// Create a service client with a given type.
29 | /// \internal
30 | template
31 | typename rclcpp::Client::SharedPtr
32 | create_client(
33 | std::shared_ptr node_base,
34 | std::shared_ptr node_graph,
35 | std::shared_ptr node_services,
36 | const std::string & service_name,
37 | const rmw_qos_profile_t & qos_profile,
38 | rclcpp::CallbackGroup::SharedPtr group)
39 | {
40 | rcl_client_options_t options = rcl_client_get_default_options();
41 | options.qos = qos_profile;
42 |
43 | auto cli = rclcpp::Client::make_shared(
44 | node_base.get(),
45 | node_graph,
46 | service_name,
47 | options);
48 |
49 | auto cli_base_ptr = std::dynamic_pointer_cast(cli);
50 | node_services->add_client(cli_base_ptr, group);
51 | return cli;
52 | }
53 |
54 | } // namespace rclcpp
55 |
56 | #endif // RCLCPP__CREATE_CLIENT_HPP_
57 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/create_generic_publisher.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2020, Apex.AI Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__CREATE_GENERIC_PUBLISHER_HPP_
16 | #define RCLCPP__CREATE_GENERIC_PUBLISHER_HPP_
17 |
18 | #include
19 | #include
20 | #include
21 |
22 | #include "rclcpp/generic_publisher.hpp"
23 | #include "rclcpp/node_interfaces/node_topics_interface.hpp"
24 | #include "rclcpp/publisher_options.hpp"
25 | #include "rclcpp/qos.hpp"
26 | #include "rclcpp/typesupport_helpers.hpp"
27 |
28 | namespace rclcpp
29 | {
30 |
31 | /// Create and return a GenericPublisher.
32 | /**
33 | * The returned pointer will never be empty, but this function can throw various exceptions, for
34 | * instance when the message's package can not be found on the AMENT_PREFIX_PATH.
35 | *
36 | * \param topics_interface NodeTopicsInterface pointer used in parts of the setup
37 | * \param topic_name Topic name
38 | * \param topic_type Topic type
39 | * \param qos %QoS settings
40 | * \param options %Publisher options.
41 | * Not all publisher options are currently respected, the only relevant options for this
42 | * publisher are `event_callbacks`, `use_default_callbacks`, and `%callback_group`.
43 | */
44 | template>
45 | std::shared_ptr create_generic_publisher(
46 | rclcpp::node_interfaces::NodeTopicsInterface::SharedPtr topics_interface,
47 | const std::string & topic_name,
48 | const std::string & topic_type,
49 | const rclcpp::QoS & qos,
50 | const rclcpp::PublisherOptionsWithAllocator & options = (
51 | rclcpp::PublisherOptionsWithAllocator()
52 | )
53 | )
54 | {
55 | auto ts_lib = rclcpp::get_typesupport_library(topic_type, "rosidl_typesupport_cpp");
56 | auto pub = std::make_shared(
57 | topics_interface->get_node_base_interface(),
58 | std::move(ts_lib),
59 | topic_name,
60 | topic_type,
61 | qos,
62 | options);
63 | topics_interface->add_publisher(pub, options.callback_group);
64 | return pub;
65 | }
66 |
67 | } // namespace rclcpp
68 |
69 | #endif // RCLCPP__CREATE_GENERIC_PUBLISHER_HPP_
70 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/create_service.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2018 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__CREATE_SERVICE_HPP_
16 | #define RCLCPP__CREATE_SERVICE_HPP_
17 |
18 | #include
19 | #include
20 | #include
21 |
22 | #include "rclcpp/node_interfaces/node_base_interface.hpp"
23 | #include "rclcpp/node_interfaces/node_services_interface.hpp"
24 | #include "rclcpp/visibility_control.hpp"
25 | #include "rmw/rmw.h"
26 |
27 | namespace rclcpp
28 | {
29 |
30 | /// Create a service with a given type.
31 | /// \internal
32 | template
33 | typename rclcpp::Service::SharedPtr
34 | create_service(
35 | std::shared_ptr node_base,
36 | std::shared_ptr node_services,
37 | const std::string & service_name,
38 | CallbackT && callback,
39 | const rmw_qos_profile_t & qos_profile,
40 | rclcpp::CallbackGroup::SharedPtr group)
41 | {
42 | rclcpp::AnyServiceCallback any_service_callback;
43 | any_service_callback.set(std::forward(callback));
44 |
45 | rcl_service_options_t service_options = rcl_service_get_default_options();
46 | service_options.qos = qos_profile;
47 |
48 | auto serv = Service::make_shared(
49 | node_base->get_shared_rcl_node_handle(),
50 | service_name, any_service_callback, service_options);
51 | auto serv_base_ptr = std::dynamic_pointer_cast(serv);
52 | node_services->add_service(serv_base_ptr, group);
53 | return serv;
54 | }
55 |
56 | } // namespace rclcpp
57 |
58 | #endif // RCLCPP__CREATE_SERVICE_HPP_
59 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/detail/README.md:
--------------------------------------------------------------------------------
1 | Notice that headers in this folder should only provide symbols in the rclcpp::detail namespace.
2 |
3 | Also that these headers are not considered part of the public API and are subject to change without notice.
4 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/detail/mutex_two_priorities.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2021 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__DETAIL__MUTEX_TWO_PRIORITIES_HPP_
16 | #define RCLCPP__DETAIL__MUTEX_TWO_PRIORITIES_HPP_
17 |
18 | #include
19 | #include
20 |
21 | namespace rclcpp
22 | {
23 | namespace detail
24 | {
25 | /// \internal A mutex that has two locking mechanism, one with higher priority than the other.
26 | /**
27 | * After the current mutex owner release the lock, a thread that used the high
28 | * priority mechanism will have priority over threads that used the low priority mechanism.
29 | */
30 | class MutexTwoPriorities
31 | {
32 | public:
33 | class HighPriorityLockable
34 | {
35 | public:
36 | explicit HighPriorityLockable(MutexTwoPriorities & parent);
37 |
38 | void lock();
39 |
40 | void unlock();
41 |
42 | private:
43 | MutexTwoPriorities & parent_;
44 | };
45 |
46 | class LowPriorityLockable
47 | {
48 | public:
49 | explicit LowPriorityLockable(MutexTwoPriorities & parent);
50 |
51 | void lock();
52 |
53 | void unlock();
54 |
55 | private:
56 | MutexTwoPriorities & parent_;
57 | };
58 |
59 | HighPriorityLockable
60 | get_high_priority_lockable();
61 |
62 | LowPriorityLockable
63 | get_low_priority_lockable();
64 |
65 | private:
66 | std::condition_variable hp_cv_;
67 | std::condition_variable lp_cv_;
68 | std::mutex cv_mutex_;
69 | size_t hp_waiting_count_{0u};
70 | bool data_taken_{false};
71 | };
72 |
73 | } // namespace detail
74 | } // namespace rclcpp
75 |
76 | #endif // RCLCPP__DETAIL__MUTEX_TWO_PRIORITIES_HPP_
77 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/detail/resolve_enable_topic_statistics.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__DETAIL__RESOLVE_ENABLE_TOPIC_STATISTICS_HPP_
16 | #define RCLCPP__DETAIL__RESOLVE_ENABLE_TOPIC_STATISTICS_HPP_
17 |
18 | #include
19 |
20 | #include "rclcpp/topic_statistics_state.hpp"
21 |
22 | namespace rclcpp
23 | {
24 | namespace detail
25 | {
26 |
27 | /// Return whether or not topic statistics is enabled, resolving "NodeDefault" if needed.
28 | template
29 | bool
30 | resolve_enable_topic_statistics(const OptionsT & options, const NodeBaseT & node_base)
31 | {
32 | bool topic_stats_enabled;
33 | switch (options.topic_stats_options.state) {
34 | case TopicStatisticsState::Enable:
35 | topic_stats_enabled = true;
36 | break;
37 | case TopicStatisticsState::Disable:
38 | topic_stats_enabled = false;
39 | break;
40 | case TopicStatisticsState::NodeDefault:
41 | topic_stats_enabled = node_base.get_enable_topic_statistics_default();
42 | break;
43 | default:
44 | throw std::runtime_error("Unrecognized EnableTopicStatistics value");
45 | }
46 |
47 | return topic_stats_enabled;
48 | }
49 |
50 | } // namespace detail
51 | } // namespace rclcpp
52 |
53 | #endif // RCLCPP__DETAIL__RESOLVE_ENABLE_TOPIC_STATISTICS_HPP_
54 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/detail/resolve_intra_process_buffer_type.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__DETAIL__RESOLVE_INTRA_PROCESS_BUFFER_TYPE_HPP_
16 | #define RCLCPP__DETAIL__RESOLVE_INTRA_PROCESS_BUFFER_TYPE_HPP_
17 |
18 | #include
19 |
20 | #include "rclcpp/any_subscription_callback.hpp"
21 | #include "rclcpp/intra_process_buffer_type.hpp"
22 |
23 | namespace rclcpp
24 | {
25 |
26 | namespace detail
27 | {
28 |
29 | /// Return the buffer type, resolving the "CallbackDefault" type to an actual type if needed.
30 | template
31 | rclcpp::IntraProcessBufferType
32 | resolve_intra_process_buffer_type(
33 | const rclcpp::IntraProcessBufferType buffer_type,
34 | const rclcpp::AnySubscriptionCallback & any_subscription_callback)
35 | {
36 | rclcpp::IntraProcessBufferType resolved_buffer_type = buffer_type;
37 |
38 | // If the user has not specified a type for the intra-process buffer, use the callback's type.
39 | if (resolved_buffer_type == IntraProcessBufferType::CallbackDefault) {
40 | if (any_subscription_callback.use_take_shared_method()) {
41 | resolved_buffer_type = IntraProcessBufferType::SharedPtr;
42 | } else {
43 | resolved_buffer_type = IntraProcessBufferType::UniquePtr;
44 | }
45 | }
46 |
47 | return resolved_buffer_type;
48 | }
49 |
50 | } // namespace detail
51 |
52 | } // namespace rclcpp
53 |
54 | #endif // RCLCPP__DETAIL__RESOLVE_INTRA_PROCESS_BUFFER_TYPE_HPP_
55 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/detail/resolve_use_intra_process.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__DETAIL__RESOLVE_USE_INTRA_PROCESS_HPP_
16 | #define RCLCPP__DETAIL__RESOLVE_USE_INTRA_PROCESS_HPP_
17 |
18 | #include
19 |
20 | #include "rclcpp/intra_process_setting.hpp"
21 |
22 | namespace rclcpp
23 | {
24 |
25 | namespace detail
26 | {
27 |
28 | /// Return whether or not intra process is enabled, resolving "NodeDefault" if needed.
29 | template
30 | bool
31 | resolve_use_intra_process(const OptionsT & options, const NodeBaseT & node_base)
32 | {
33 | bool use_intra_process;
34 | switch (options.use_intra_process_comm) {
35 | case IntraProcessSetting::Enable:
36 | use_intra_process = true;
37 | break;
38 | case IntraProcessSetting::Disable:
39 | use_intra_process = false;
40 | break;
41 | case IntraProcessSetting::NodeDefault:
42 | use_intra_process = node_base.get_use_intra_process_default();
43 | break;
44 | default:
45 | throw std::runtime_error("Unrecognized IntraProcessSetting value");
46 | break;
47 | }
48 |
49 | return use_intra_process;
50 | }
51 |
52 | } // namespace detail
53 |
54 | } // namespace rclcpp
55 |
56 | #endif // RCLCPP__DETAIL__RESOLVE_USE_INTRA_PROCESS_HPP_
57 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/detail/rmw_implementation_specific_payload.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_PAYLOAD_HPP_
16 | #define RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_PAYLOAD_HPP_
17 |
18 | #include "rclcpp/visibility_control.hpp"
19 |
20 | namespace rclcpp
21 | {
22 | namespace detail
23 | {
24 |
25 | /// Mechanism for passing rmw implementation specific settings through the ROS interfaces.
26 | class RCLCPP_PUBLIC RMWImplementationSpecificPayload
27 | {
28 | public:
29 | virtual
30 | ~RMWImplementationSpecificPayload() = default;
31 |
32 | /// Return false if this class has not been customized, otherwise true.
33 | /**
34 | * It does this based on the value of the rmw implementation identifier that
35 | * this class reports, and so it is important for a specialization of this
36 | * class to override the get_rmw_implementation_identifier() method to return
37 | * something other than nullptr.
38 | */
39 | bool
40 | has_been_customized() const;
41 |
42 | /// Derrived classes should override this and return the identifier of its rmw implementation.
43 | virtual
44 | const char *
45 | get_implementation_identifier() const;
46 | };
47 |
48 | } // namespace detail
49 | } // namespace rclcpp
50 |
51 | #endif // RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_PAYLOAD_HPP_
52 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_PUBLISHER_PAYLOAD_HPP_
16 | #define RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_PUBLISHER_PAYLOAD_HPP_
17 |
18 | #include "rcl/publisher.h"
19 |
20 | #include "rclcpp/detail/rmw_implementation_specific_payload.hpp"
21 | #include "rclcpp/visibility_control.hpp"
22 |
23 | namespace rclcpp
24 | {
25 | namespace detail
26 | {
27 |
28 | class RCLCPP_PUBLIC RMWImplementationSpecificPublisherPayload
29 | : public RMWImplementationSpecificPayload
30 | {
31 | public:
32 | ~RMWImplementationSpecificPublisherPayload() override = default;
33 |
34 | /// Opportunity for a derived class to inject information into the rcl options.
35 | /**
36 | * This is called after the rcl_publisher_options_t has been prepared by
37 | * rclcpp, but before rcl_publisher_init() is called.
38 | *
39 | * The passed option is the rmw_publisher_options field of the
40 | * rcl_publisher_options_t that will be passed to rcl_publisher_init().
41 | *
42 | * By default the options are unmodified.
43 | */
44 | virtual
45 | void
46 | modify_rmw_publisher_options(rmw_publisher_options_t & rmw_publisher_options) const;
47 | };
48 |
49 | } // namespace detail
50 | } // namespace rclcpp
51 |
52 | #endif // RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_PUBLISHER_PAYLOAD_HPP_
53 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_SUBSCRIPTION_PAYLOAD_HPP_
16 | #define RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_SUBSCRIPTION_PAYLOAD_HPP_
17 |
18 | #include "rcl/subscription.h"
19 |
20 | #include "rclcpp/detail/rmw_implementation_specific_payload.hpp"
21 | #include "rclcpp/visibility_control.hpp"
22 |
23 | namespace rclcpp
24 | {
25 | namespace detail
26 | {
27 |
28 | /// Subscription payload that may be rmw implementation specific.
29 | class RCLCPP_PUBLIC RMWImplementationSpecificSubscriptionPayload
30 | : public RMWImplementationSpecificPayload
31 | {
32 | public:
33 | ~RMWImplementationSpecificSubscriptionPayload() override = default;
34 |
35 | /// Opportunity for a derived class to inject information into the rcl options.
36 | /**
37 | * This is called after the rcl_subscription_options_t has been prepared by
38 | * rclcpp, but before rcl_subscription_init() is called.
39 | *
40 | * The passed option is the rmw_subscription_options field of the
41 | * rcl_subscription_options_t that will be passed to rcl_subscription_init().
42 | *
43 | * By default the options are unmodified.
44 | */
45 | virtual
46 | void
47 | modify_rmw_subscription_options(rmw_subscription_options_t & rmw_subscription_options) const;
48 | };
49 |
50 | } // namespace detail
51 | } // namespace rclcpp
52 |
53 | #endif // RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_SUBSCRIPTION_PAYLOAD_HPP_
54 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/detail/utilities.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__DETAIL__UTILITIES_HPP_
16 | #define RCLCPP__DETAIL__UTILITIES_HPP_
17 |
18 | #include "rclcpp/detail/utilities.hpp"
19 |
20 | #include
21 | #include
22 |
23 | #include "rcl/allocator.h"
24 | #include "rcl/arguments.h"
25 |
26 | namespace rclcpp
27 | {
28 | namespace detail
29 | {
30 |
31 | std::vector
32 | get_unparsed_ros_arguments(
33 | int argc, char const * const argv[],
34 | rcl_arguments_t * arguments,
35 | rcl_allocator_t allocator);
36 |
37 | } // namespace detail
38 | } // namespace rclcpp
39 |
40 | #endif // RCLCPP__DETAIL__UTILITIES_HPP_
41 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/event.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2016 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__EVENT_HPP_
16 | #define RCLCPP__EVENT_HPP_
17 |
18 | #include
19 | #include
20 |
21 | #include "rclcpp/macros.hpp"
22 | #include "rclcpp/visibility_control.hpp"
23 |
24 | namespace rclcpp
25 | {
26 |
27 | class Event
28 | {
29 | public:
30 | RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(Event)
31 |
32 | /// Default construct
33 | /**
34 | * Set the default value to false
35 | */
36 | RCLCPP_PUBLIC
37 | Event();
38 |
39 | /// Set the Event state value to true
40 | /**
41 | * \return The state value before the call.
42 | */
43 | RCLCPP_PUBLIC
44 | bool
45 | set();
46 |
47 | /// Get the state value of the Event
48 | /**
49 | * \return the Event state value
50 | */
51 | RCLCPP_PUBLIC
52 | bool
53 | check();
54 |
55 | /// Get the state value of the Event and set to false
56 | /**
57 | * \return the Event state value
58 | */
59 | RCLCPP_PUBLIC
60 | bool
61 | check_and_clear();
62 |
63 | private:
64 | RCLCPP_DISABLE_COPY(Event)
65 |
66 | std::atomic_bool state_;
67 | };
68 |
69 | } // namespace rclcpp
70 |
71 | #endif // RCLCPP__EVENT_HPP_
72 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/exceptions.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2016 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__EXCEPTIONS_HPP_
16 | #define RCLCPP__EXCEPTIONS_HPP_
17 |
18 | #include "rclcpp/exceptions/exceptions.hpp"
19 |
20 | #endif // RCLCPP__EXCEPTIONS_HPP_
21 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/executor_options.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2014-2020 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__EXECUTOR_OPTIONS_HPP_
16 | #define RCLCPP__EXECUTOR_OPTIONS_HPP_
17 |
18 | #include "rclcpp/context.hpp"
19 | #include "rclcpp/contexts/default_context.hpp"
20 | #include "rclcpp/memory_strategies.hpp"
21 | #include "rclcpp/memory_strategy.hpp"
22 | #include "rclcpp/visibility_control.hpp"
23 |
24 | namespace rclcpp
25 | {
26 |
27 | /// Options to be passed to the executor constructor.
28 | struct ExecutorOptions
29 | {
30 | ExecutorOptions()
31 | : memory_strategy(rclcpp::memory_strategies::create_default_strategy()),
32 | context(rclcpp::contexts::get_global_default_context()),
33 | max_conditions(0)
34 | {}
35 |
36 | rclcpp::memory_strategy::MemoryStrategy::SharedPtr memory_strategy;
37 | rclcpp::Context::SharedPtr context;
38 | size_t max_conditions;
39 | };
40 |
41 | } // namespace rclcpp
42 |
43 | #endif // RCLCPP__EXECUTOR_OPTIONS_HPP_
44 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/executors/single_threaded_executor.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__EXECUTORS__SINGLE_THREADED_EXECUTOR_HPP_
16 | #define RCLCPP__EXECUTORS__SINGLE_THREADED_EXECUTOR_HPP_
17 |
18 | #include
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | #include "rclcpp/executor.hpp"
26 | #include "rclcpp/macros.hpp"
27 | #include "rclcpp/memory_strategies.hpp"
28 | #include "rclcpp/node.hpp"
29 | #include "rclcpp/utilities.hpp"
30 | #include "rclcpp/rate.hpp"
31 | #include "rclcpp/visibility_control.hpp"
32 |
33 | namespace rclcpp
34 | {
35 | namespace executors
36 | {
37 |
38 | /// Single-threaded executor implementation.
39 | /**
40 | * This is the default executor created by rclcpp::spin.
41 | */
42 | class SingleThreadedExecutor : public rclcpp::Executor
43 | {
44 | public:
45 | RCLCPP_SMART_PTR_DEFINITIONS(SingleThreadedExecutor)
46 |
47 | /// Default constructor. See the default constructor for Executor.
48 | RCLCPP_PUBLIC
49 | explicit SingleThreadedExecutor(
50 | const rclcpp::ExecutorOptions & options = rclcpp::ExecutorOptions());
51 |
52 | /// Default destructor.
53 | RCLCPP_PUBLIC
54 | virtual ~SingleThreadedExecutor();
55 |
56 | /// Single-threaded implementation of spin.
57 | /**
58 | * This function will block until work comes in, execute it, and then repeat
59 | * the process until canceled.
60 | * It may be interrupt by a call to rclcpp::Executor::cancel() or by ctrl-c
61 | * if the associated context is configured to shutdown on SIGINT.
62 | * \throws std::runtime_error when spin() called while already spinning
63 | */
64 | RCLCPP_PUBLIC
65 | void
66 | spin() override;
67 |
68 | #ifdef PICAS
69 | RCLCPP_PUBLIC
70 | void
71 | spin_rt();
72 |
73 | RCLCPP_PUBLIC
74 | void
75 | spin_cpu(int c);
76 |
77 | RCLCPP_PUBLIC
78 | void
79 | spin_deadline(int p, int T, int budget);
80 | #endif
81 |
82 | private:
83 | RCLCPP_DISABLE_COPY(SingleThreadedExecutor)
84 | };
85 |
86 | } // namespace executors
87 | } // namespace rclcpp
88 |
89 | #endif // RCLCPP__EXECUTORS__SINGLE_THREADED_EXECUTOR_HPP_
90 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/expand_topic_or_service_name.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__EXPAND_TOPIC_OR_SERVICE_NAME_HPP_
16 | #define RCLCPP__EXPAND_TOPIC_OR_SERVICE_NAME_HPP_
17 |
18 | #include
19 |
20 | #include "rclcpp/visibility_control.hpp"
21 |
22 | namespace rclcpp
23 | {
24 |
25 | /// Expand a topic or service name and throw if it is not valid.
26 | /**
27 | * This function can be used to "just" validate a topic or service name too,
28 | * since expanding the topic name is required to fully validate a name.
29 | *
30 | * If the name is invalid, then InvalidTopicNameError is thrown or
31 | * InvalidServiceNameError if is_service is true.
32 | *
33 | * This function can take any form of a topic or service name, i.e. it does not
34 | * have to be a fully qualified name.
35 | * The node name and namespace are used to expand it if necessary while
36 | * validating it.
37 | *
38 | * Expansion is done with rcl_expand_topic_name.
39 | * The validation is doen with rcl_validate_topic_name and
40 | * rmw_validate_full_topic_name, so details about failures can be found in the
41 | * documentation for those functions.
42 | *
43 | * \param name the topic or service name to be validated
44 | * \param node_name the name of the node associated with the name
45 | * \param namespace_ the namespace of the node associated with the name
46 | * \param is_service if true InvalidServiceNameError is thrown instead
47 | * \returns expanded (and validated) topic name
48 | * \throws InvalidTopicNameError if name is invalid and is_service is false
49 | * \throws InvalidServiceNameError if name is invalid and is_service is true
50 | * \throws std::bad_alloc if memory cannot be allocated
51 | * \throws RCLError if an unexpect error occurs
52 | * \throws std::runtime_error if the topic name is unexpectedly valid or,
53 | * if the rcl name is invalid or if the rcl namespace is invalid
54 | */
55 | RCLCPP_PUBLIC
56 | std::string
57 | expand_topic_or_service_name(
58 | const std::string & name,
59 | const std::string & node_name,
60 | const std::string & namespace_,
61 | bool is_service = false);
62 |
63 | } // namespace rclcpp
64 |
65 | #endif // RCLCPP__EXPAND_TOPIC_OR_SERVICE_NAME_HPP_
66 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/experimental/README.md:
--------------------------------------------------------------------------------
1 | Notice that headers in this folder should only provide symbols in the rclcpp::experimental namespace.
2 |
3 | Also notice that these headers are not considered part of the public API as they have not yet been stabilized.
4 | And therefore they are subject to change without notice.
5 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/experimental/buffers/buffer_implementation_base.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__EXPERIMENTAL__BUFFERS__BUFFER_IMPLEMENTATION_BASE_HPP_
16 | #define RCLCPP__EXPERIMENTAL__BUFFERS__BUFFER_IMPLEMENTATION_BASE_HPP_
17 |
18 | namespace rclcpp
19 | {
20 | namespace experimental
21 | {
22 | namespace buffers
23 | {
24 |
25 | template
26 | class BufferImplementationBase
27 | {
28 | public:
29 | virtual ~BufferImplementationBase() {}
30 |
31 | virtual BufferT dequeue() = 0;
32 | virtual void enqueue(BufferT request) = 0;
33 |
34 | virtual void clear() = 0;
35 | virtual bool has_data() const = 0;
36 | };
37 |
38 | } // namespace buffers
39 | } // namespace experimental
40 | } // namespace rclcpp
41 |
42 | #endif // RCLCPP__EXPERIMENTAL__BUFFERS__BUFFER_IMPLEMENTATION_BASE_HPP_
43 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/experimental/subscription_intra_process_base.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__EXPERIMENTAL__SUBSCRIPTION_INTRA_PROCESS_BASE_HPP_
16 | #define RCLCPP__EXPERIMENTAL__SUBSCRIPTION_INTRA_PROCESS_BASE_HPP_
17 |
18 | #include
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | #include "rcl/error_handling.h"
27 |
28 | #include "rclcpp/type_support_decl.hpp"
29 | #include "rclcpp/waitable.hpp"
30 |
31 | namespace rclcpp
32 | {
33 | namespace experimental
34 | {
35 |
36 | class SubscriptionIntraProcessBase : public rclcpp::Waitable
37 | {
38 | public:
39 | RCLCPP_SMART_PTR_ALIASES_ONLY(SubscriptionIntraProcessBase)
40 |
41 | RCLCPP_PUBLIC
42 | SubscriptionIntraProcessBase(const std::string & topic_name, rmw_qos_profile_t qos_profile)
43 | : topic_name_(topic_name), qos_profile_(qos_profile)
44 | {}
45 |
46 | virtual ~SubscriptionIntraProcessBase() = default;
47 |
48 | RCLCPP_PUBLIC
49 | size_t
50 | get_number_of_ready_guard_conditions() {return 1;}
51 |
52 | RCLCPP_PUBLIC
53 | bool
54 | add_to_wait_set(rcl_wait_set_t * wait_set);
55 |
56 | virtual bool
57 | is_ready(rcl_wait_set_t * wait_set) = 0;
58 |
59 | virtual
60 | std::shared_ptr
61 | take_data() = 0;
62 |
63 | virtual void
64 | execute(std::shared_ptr & data) = 0;
65 |
66 | virtual bool
67 | use_take_shared_method() const = 0;
68 |
69 | RCLCPP_PUBLIC
70 | const char *
71 | get_topic_name() const;
72 |
73 | RCLCPP_PUBLIC
74 | rmw_qos_profile_t
75 | get_actual_qos() const;
76 |
77 | protected:
78 | std::recursive_mutex reentrant_mutex_;
79 | rcl_guard_condition_t gc_;
80 |
81 | private:
82 | virtual void
83 | trigger_guard_condition() = 0;
84 |
85 | std::string topic_name_;
86 | rmw_qos_profile_t qos_profile_;
87 | };
88 |
89 | } // namespace experimental
90 | } // namespace rclcpp
91 |
92 | #endif // RCLCPP__EXPERIMENTAL__SUBSCRIPTION_INTRA_PROCESS_BASE_HPP_
93 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/future_return_code.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__FUTURE_RETURN_CODE_HPP_
16 | #define RCLCPP__FUTURE_RETURN_CODE_HPP_
17 |
18 | #include
19 | #include
20 |
21 | #include "rclcpp/visibility_control.hpp"
22 |
23 | namespace rclcpp
24 | {
25 |
26 | /// Return codes to be used with spin_until_future_complete.
27 | /**
28 | * SUCCESS: The future is complete and can be accessed with "get" without blocking.
29 | * This does not indicate that the operation succeeded; "get" may still throw an exception.
30 | * INTERRUPTED: The future is not complete, spinning was interrupted by Ctrl-C or another error.
31 | * TIMEOUT: Spinning timed out.
32 | */
33 | enum class FutureReturnCode {SUCCESS, INTERRUPTED, TIMEOUT};
34 |
35 | /// Stream operator for FutureReturnCode.
36 | RCLCPP_PUBLIC
37 | std::ostream &
38 | operator<<(std::ostream & os, const FutureReturnCode & future_return_code);
39 |
40 | /// String conversion function for FutureReturnCode.
41 | RCLCPP_PUBLIC
42 | std::string
43 | to_string(const FutureReturnCode & future_return_code);
44 |
45 | } // namespace rclcpp
46 |
47 | #endif // RCLCPP__FUTURE_RETURN_CODE_HPP_
48 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/intra_process_buffer_type.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__INTRA_PROCESS_BUFFER_TYPE_HPP_
16 | #define RCLCPP__INTRA_PROCESS_BUFFER_TYPE_HPP_
17 |
18 | namespace rclcpp
19 | {
20 |
21 | /// Used as argument in create_publisher and create_subscriber
22 | /// when intra-process communication is enabled
23 | enum class IntraProcessBufferType
24 | {
25 | /// Set the data type used in the intra-process buffer as std::shared_ptr
26 | SharedPtr,
27 | /// Set the data type used in the intra-process buffer as std::unique_ptr
28 | UniquePtr,
29 | /// Set the data type used in the intra-process buffer as the same used in the callback
30 | CallbackDefault
31 | };
32 |
33 | } // namespace rclcpp
34 |
35 | #endif // RCLCPP__INTRA_PROCESS_BUFFER_TYPE_HPP_
36 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/intra_process_setting.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__INTRA_PROCESS_SETTING_HPP_
16 | #define RCLCPP__INTRA_PROCESS_SETTING_HPP_
17 |
18 | namespace rclcpp
19 | {
20 |
21 | /// Used as argument in create_publisher and create_subscriber.
22 | enum class IntraProcessSetting
23 | {
24 | /// Explicitly enable intraprocess comm at publisher/subscription level.
25 | Enable,
26 | /// Explicitly disable intraprocess comm at publisher/subscription level.
27 | Disable,
28 | /// Take intraprocess configuration from the node.
29 | NodeDefault
30 | };
31 |
32 | } // namespace rclcpp
33 |
34 | #endif // RCLCPP__INTRA_PROCESS_SETTING_HPP_
35 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/memory_strategies.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__MEMORY_STRATEGIES_HPP_
16 | #define RCLCPP__MEMORY_STRATEGIES_HPP_
17 |
18 | #include "rclcpp/memory_strategy.hpp"
19 | #include "rclcpp/visibility_control.hpp"
20 |
21 | namespace rclcpp
22 | {
23 | namespace memory_strategies
24 | {
25 |
26 | /// Create a MemoryStrategy sharedPtr
27 | /**
28 | * \return a MemoryStrategy sharedPtr
29 | */
30 | RCLCPP_PUBLIC
31 | memory_strategy::MemoryStrategy::SharedPtr
32 | create_default_strategy();
33 |
34 | } // namespace memory_strategies
35 | } // namespace rclcpp
36 |
37 | #endif // RCLCPP__MEMORY_STRATEGIES_HPP_
38 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/message_info.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2020 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__MESSAGE_INFO_HPP_
16 | #define RCLCPP__MESSAGE_INFO_HPP_
17 |
18 | #include "rmw/types.h"
19 |
20 | #include "rclcpp/visibility_control.hpp"
21 |
22 | namespace rclcpp
23 | {
24 |
25 | /// Additional meta data about messages taken from subscriptions.
26 | class RCLCPP_PUBLIC MessageInfo
27 | {
28 | public:
29 | /// Default empty constructor.
30 | MessageInfo() = default;
31 |
32 | /// Conversion constructor, which is intentionally not marked as explicit.
33 | /**
34 | * \param[in] rmw_message_info message info to initialize the class
35 | */
36 | // cppcheck-suppress noExplicitConstructor
37 | MessageInfo(const rmw_message_info_t & rmw_message_info); // NOLINT(runtime/explicit)
38 |
39 | virtual ~MessageInfo();
40 |
41 | /// Return the message info as the underlying rmw message info type.
42 | const rmw_message_info_t &
43 | get_rmw_message_info() const;
44 |
45 | /// Return the message info as the underlying rmw message info type.
46 | rmw_message_info_t &
47 | get_rmw_message_info();
48 |
49 | private:
50 | rmw_message_info_t rmw_message_info_;
51 | };
52 |
53 | } // namespace rclcpp
54 |
55 | #endif // RCLCPP__MESSAGE_INFO_HPP_
56 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/node_interfaces/node_clock.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__NODE_INTERFACES__NODE_CLOCK_HPP_
16 | #define RCLCPP__NODE_INTERFACES__NODE_CLOCK_HPP_
17 |
18 | #include "rclcpp/clock.hpp"
19 | #include "rclcpp/macros.hpp"
20 | #include "rclcpp/node_interfaces/node_base_interface.hpp"
21 | #include "rclcpp/node_interfaces/node_clock_interface.hpp"
22 | #include "rclcpp/node_interfaces/node_graph_interface.hpp"
23 | #include "rclcpp/node_interfaces/node_logging_interface.hpp"
24 | #include "rclcpp/node_interfaces/node_services_interface.hpp"
25 | #include "rclcpp/node_interfaces/node_topics_interface.hpp"
26 | #include "rclcpp/visibility_control.hpp"
27 |
28 | namespace rclcpp
29 | {
30 | namespace node_interfaces
31 | {
32 |
33 | /// Implementation of the NodeClock part of the Node API.
34 | class NodeClock : public NodeClockInterface
35 | {
36 | public:
37 | RCLCPP_SMART_PTR_ALIASES_ONLY(NodeClock)
38 |
39 | RCLCPP_PUBLIC
40 | explicit NodeClock(
41 | rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base,
42 | rclcpp::node_interfaces::NodeTopicsInterface::SharedPtr node_topics,
43 | rclcpp::node_interfaces::NodeGraphInterface::SharedPtr node_graph,
44 | rclcpp::node_interfaces::NodeServicesInterface::SharedPtr node_services,
45 | rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr node_logging);
46 |
47 | RCLCPP_PUBLIC
48 | virtual
49 | ~NodeClock();
50 |
51 | /// Get a clock which will be kept up to date by the node.
52 | RCLCPP_PUBLIC
53 | rclcpp::Clock::SharedPtr
54 | get_clock() override;
55 |
56 | /// Get a clock which will be kept up to date by the node.
57 | RCLCPP_PUBLIC
58 | rclcpp::Clock::ConstSharedPtr
59 | get_clock() const override;
60 |
61 | private:
62 | RCLCPP_DISABLE_COPY(NodeClock)
63 |
64 | rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base_;
65 | rclcpp::node_interfaces::NodeTopicsInterface::SharedPtr node_topics_;
66 | rclcpp::node_interfaces::NodeGraphInterface::SharedPtr node_graph_;
67 | rclcpp::node_interfaces::NodeServicesInterface::SharedPtr node_services_;
68 | rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr node_logging_;
69 |
70 | rclcpp::Clock::SharedPtr ros_clock_;
71 | };
72 |
73 | } // namespace node_interfaces
74 | } // namespace rclcpp
75 |
76 | #endif // RCLCPP__NODE_INTERFACES__NODE_CLOCK_HPP_
77 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/node_interfaces/node_clock_interface.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__NODE_INTERFACES__NODE_CLOCK_INTERFACE_HPP_
16 | #define RCLCPP__NODE_INTERFACES__NODE_CLOCK_INTERFACE_HPP_
17 |
18 | #include "rclcpp/clock.hpp"
19 | #include "rclcpp/macros.hpp"
20 | #include "rclcpp/visibility_control.hpp"
21 |
22 | namespace rclcpp
23 | {
24 | namespace node_interfaces
25 | {
26 |
27 | /// Pure virtual interface class for the NodeClock part of the Node API.
28 | class NodeClockInterface
29 | {
30 | public:
31 | RCLCPP_SMART_PTR_ALIASES_ONLY(NodeClockInterface)
32 |
33 | RCLCPP_PUBLIC
34 | virtual
35 | ~NodeClockInterface() = default;
36 |
37 | /// Get a ROS clock which will be kept up to date by the node.
38 | RCLCPP_PUBLIC
39 | virtual
40 | rclcpp::Clock::SharedPtr
41 | get_clock() = 0;
42 |
43 | /// Get a const ROS clock which will be kept up to date by the node.
44 | RCLCPP_PUBLIC
45 | virtual
46 | rclcpp::Clock::ConstSharedPtr
47 | get_clock() const = 0;
48 | };
49 |
50 | } // namespace node_interfaces
51 | } // namespace rclcpp
52 |
53 | #endif // RCLCPP__NODE_INTERFACES__NODE_CLOCK_INTERFACE_HPP_
54 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/node_interfaces/node_logging.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__NODE_INTERFACES__NODE_LOGGING_HPP_
16 | #define RCLCPP__NODE_INTERFACES__NODE_LOGGING_HPP_
17 |
18 | #include
19 |
20 | #include "rclcpp/logger.hpp"
21 | #include "rclcpp/macros.hpp"
22 | #include "rclcpp/node_interfaces/node_base_interface.hpp"
23 | #include "rclcpp/node_interfaces/node_logging_interface.hpp"
24 | #include "rclcpp/visibility_control.hpp"
25 |
26 | namespace rclcpp
27 | {
28 | namespace node_interfaces
29 | {
30 |
31 | /// Implementation of the NodeLogging part of the Node API.
32 | class NodeLogging : public NodeLoggingInterface
33 | {
34 | public:
35 | RCLCPP_SMART_PTR_ALIASES_ONLY(NodeLoggingInterface)
36 |
37 | RCLCPP_PUBLIC
38 | explicit NodeLogging(rclcpp::node_interfaces::NodeBaseInterface * node_base);
39 |
40 | RCLCPP_PUBLIC
41 | virtual
42 | ~NodeLogging();
43 |
44 | RCLCPP_PUBLIC
45 | rclcpp::Logger
46 | get_logger() const override;
47 |
48 | RCLCPP_PUBLIC
49 | const char *
50 | get_logger_name() const override;
51 |
52 | private:
53 | RCLCPP_DISABLE_COPY(NodeLogging)
54 |
55 | /// Handle to the NodeBaseInterface given in the constructor.
56 | rclcpp::node_interfaces::NodeBaseInterface * node_base_;
57 |
58 | rclcpp::Logger logger_;
59 | };
60 |
61 | } // namespace node_interfaces
62 | } // namespace rclcpp
63 |
64 | #endif // RCLCPP__NODE_INTERFACES__NODE_LOGGING_HPP_
65 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/node_interfaces/node_logging_interface.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__NODE_INTERFACES__NODE_LOGGING_INTERFACE_HPP_
16 | #define RCLCPP__NODE_INTERFACES__NODE_LOGGING_INTERFACE_HPP_
17 |
18 | #include
19 |
20 | #include "rclcpp/logger.hpp"
21 | #include "rclcpp/macros.hpp"
22 | #include "rclcpp/visibility_control.hpp"
23 |
24 | namespace rclcpp
25 | {
26 | namespace node_interfaces
27 | {
28 |
29 | /// Pure virtual interface class for the NodeLogging part of the Node API.
30 | class NodeLoggingInterface
31 | {
32 | public:
33 | RCLCPP_SMART_PTR_ALIASES_ONLY(NodeLoggingInterface)
34 |
35 | RCLCPP_PUBLIC
36 | virtual
37 | ~NodeLoggingInterface() = default;
38 |
39 | /// Return the logger of the node.
40 | /** \return The logger of the node. */
41 | RCLCPP_PUBLIC
42 | virtual
43 | rclcpp::Logger
44 | get_logger() const = 0;
45 |
46 | /// Return the logger name associated with the node.
47 | /** \return The logger name associated with the node. */
48 | RCLCPP_PUBLIC
49 | virtual
50 | const char *
51 | get_logger_name() const = 0;
52 | };
53 |
54 | } // namespace node_interfaces
55 | } // namespace rclcpp
56 |
57 | #endif // RCLCPP__NODE_INTERFACES__NODE_LOGGING_INTERFACE_HPP_
58 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/node_interfaces/node_services.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2016 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__NODE_INTERFACES__NODE_SERVICES_HPP_
16 | #define RCLCPP__NODE_INTERFACES__NODE_SERVICES_HPP_
17 |
18 | #include
19 |
20 | #include "rclcpp/callback_group.hpp"
21 | #include "rclcpp/client.hpp"
22 | #include "rclcpp/macros.hpp"
23 | #include "rclcpp/node_interfaces/node_base_interface.hpp"
24 | #include "rclcpp/node_interfaces/node_services_interface.hpp"
25 | #include "rclcpp/service.hpp"
26 | #include "rclcpp/visibility_control.hpp"
27 |
28 | namespace rclcpp
29 | {
30 | namespace node_interfaces
31 | {
32 |
33 | /// Implementation of the NodeServices part of the Node API.
34 | class NodeServices : public NodeServicesInterface
35 | {
36 | public:
37 | RCLCPP_SMART_PTR_ALIASES_ONLY(NodeServices)
38 |
39 | RCLCPP_PUBLIC
40 | explicit NodeServices(rclcpp::node_interfaces::NodeBaseInterface * node_base);
41 |
42 | RCLCPP_PUBLIC
43 | virtual
44 | ~NodeServices();
45 |
46 | RCLCPP_PUBLIC
47 | void
48 | add_client(
49 | rclcpp::ClientBase::SharedPtr client_base_ptr,
50 | rclcpp::CallbackGroup::SharedPtr group) override;
51 |
52 | RCLCPP_PUBLIC
53 | void
54 | add_service(
55 | rclcpp::ServiceBase::SharedPtr service_base_ptr,
56 | rclcpp::CallbackGroup::SharedPtr group) override;
57 |
58 | RCLCPP_PUBLIC
59 | std::string
60 | resolve_service_name(const std::string & name, bool only_expand = false) const override;
61 |
62 | private:
63 | RCLCPP_DISABLE_COPY(NodeServices)
64 |
65 | rclcpp::node_interfaces::NodeBaseInterface * node_base_;
66 | };
67 |
68 | } // namespace node_interfaces
69 | } // namespace rclcpp
70 |
71 | #endif // RCLCPP__NODE_INTERFACES__NODE_SERVICES_HPP_
72 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/node_interfaces/node_services_interface.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2016 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__NODE_INTERFACES__NODE_SERVICES_INTERFACE_HPP_
16 | #define RCLCPP__NODE_INTERFACES__NODE_SERVICES_INTERFACE_HPP_
17 |
18 | #include
19 |
20 | #include "rclcpp/callback_group.hpp"
21 | #include "rclcpp/client.hpp"
22 | #include "rclcpp/macros.hpp"
23 | #include "rclcpp/service.hpp"
24 | #include "rclcpp/visibility_control.hpp"
25 |
26 | namespace rclcpp
27 | {
28 | namespace node_interfaces
29 | {
30 |
31 | /// Pure virtual interface class for the NodeServices part of the Node API.
32 | class NodeServicesInterface
33 | {
34 | public:
35 | RCLCPP_SMART_PTR_ALIASES_ONLY(NodeServicesInterface)
36 |
37 | RCLCPP_PUBLIC
38 | virtual
39 | ~NodeServicesInterface() = default;
40 |
41 | RCLCPP_PUBLIC
42 | virtual
43 | void
44 | add_client(
45 | rclcpp::ClientBase::SharedPtr client_base_ptr,
46 | rclcpp::CallbackGroup::SharedPtr group) = 0;
47 |
48 | RCLCPP_PUBLIC
49 | virtual
50 | void
51 | add_service(
52 | rclcpp::ServiceBase::SharedPtr service_base_ptr,
53 | rclcpp::CallbackGroup::SharedPtr group) = 0;
54 |
55 | /// Get the remapped and expanded service name given a input name.
56 | RCLCPP_PUBLIC
57 | virtual
58 | std::string
59 | resolve_service_name(const std::string & name, bool only_expand = false) const = 0;
60 | };
61 |
62 | } // namespace node_interfaces
63 | } // namespace rclcpp
64 |
65 | #endif // RCLCPP__NODE_INTERFACES__NODE_SERVICES_INTERFACE_HPP_
66 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/node_interfaces/node_time_source_interface.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2018 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__NODE_INTERFACES__NODE_TIME_SOURCE_INTERFACE_HPP_
16 | #define RCLCPP__NODE_INTERFACES__NODE_TIME_SOURCE_INTERFACE_HPP_
17 |
18 | #include "rclcpp/macros.hpp"
19 | #include "rclcpp/visibility_control.hpp"
20 |
21 | namespace rclcpp
22 | {
23 | namespace node_interfaces
24 | {
25 |
26 | /// Pure virtual interface class for the NodeTimeSource part of the Node API.
27 | class NodeTimeSourceInterface
28 | {
29 | public:
30 | RCLCPP_SMART_PTR_ALIASES_ONLY(NodeTimeSourceInterface)
31 |
32 | RCLCPP_PUBLIC
33 | virtual
34 | ~NodeTimeSourceInterface() = default;
35 | };
36 |
37 | } // namespace node_interfaces
38 | } // namespace rclcpp
39 |
40 | #endif // RCLCPP__NODE_INTERFACES__NODE_TIME_SOURCE_INTERFACE_HPP_
41 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/node_interfaces/node_timers.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2016 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__NODE_INTERFACES__NODE_TIMERS_HPP_
16 | #define RCLCPP__NODE_INTERFACES__NODE_TIMERS_HPP_
17 |
18 | #include "rclcpp/callback_group.hpp"
19 | #include "rclcpp/macros.hpp"
20 | #include "rclcpp/node_interfaces/node_base_interface.hpp"
21 | #include "rclcpp/node_interfaces/node_timers_interface.hpp"
22 | #include "rclcpp/timer.hpp"
23 | #include "rclcpp/visibility_control.hpp"
24 |
25 | namespace rclcpp
26 | {
27 | namespace node_interfaces
28 | {
29 |
30 | /// Implementation of the NodeTimers part of the Node API.
31 | class NodeTimers : public NodeTimersInterface
32 | {
33 | public:
34 | RCLCPP_SMART_PTR_ALIASES_ONLY(NodeTimers)
35 |
36 | RCLCPP_PUBLIC
37 | explicit NodeTimers(rclcpp::node_interfaces::NodeBaseInterface * node_base);
38 |
39 | RCLCPP_PUBLIC
40 | virtual
41 | ~NodeTimers();
42 |
43 | /// Add a timer to the node.
44 | RCLCPP_PUBLIC
45 | void
46 | add_timer(
47 | rclcpp::TimerBase::SharedPtr timer,
48 | rclcpp::CallbackGroup::SharedPtr callback_group) override;
49 |
50 | private:
51 | RCLCPP_DISABLE_COPY(NodeTimers)
52 |
53 | rclcpp::node_interfaces::NodeBaseInterface * node_base_;
54 | };
55 |
56 | } // namespace node_interfaces
57 | } // namespace rclcpp
58 |
59 | #endif // RCLCPP__NODE_INTERFACES__NODE_TIMERS_HPP_
60 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/node_interfaces/node_timers_interface.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2016 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__NODE_INTERFACES__NODE_TIMERS_INTERFACE_HPP_
16 | #define RCLCPP__NODE_INTERFACES__NODE_TIMERS_INTERFACE_HPP_
17 |
18 | #include "rclcpp/callback_group.hpp"
19 | #include "rclcpp/macros.hpp"
20 | #include "rclcpp/timer.hpp"
21 | #include "rclcpp/visibility_control.hpp"
22 |
23 | namespace rclcpp
24 | {
25 | namespace node_interfaces
26 | {
27 |
28 | /// Pure virtual interface class for the NodeTimers part of the Node API.
29 | class NodeTimersInterface
30 | {
31 | public:
32 | RCLCPP_SMART_PTR_ALIASES_ONLY(NodeTimersInterface)
33 |
34 | RCLCPP_PUBLIC
35 | virtual
36 | ~NodeTimersInterface() = default;
37 |
38 | /// Add a timer to the node.
39 | RCLCPP_PUBLIC
40 | virtual
41 | void
42 | add_timer(
43 | rclcpp::TimerBase::SharedPtr timer,
44 | rclcpp::CallbackGroup::SharedPtr callback_group) = 0;
45 | };
46 |
47 | } // namespace node_interfaces
48 | } // namespace rclcpp
49 |
50 | #endif // RCLCPP__NODE_INTERFACES__NODE_TIMERS_INTERFACE_HPP_
51 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/node_interfaces/node_waitables.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2018 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__NODE_INTERFACES__NODE_WAITABLES_HPP_
16 | #define RCLCPP__NODE_INTERFACES__NODE_WAITABLES_HPP_
17 |
18 | #include "rclcpp/callback_group.hpp"
19 | #include "rclcpp/macros.hpp"
20 | #include "rclcpp/node_interfaces/node_base_interface.hpp"
21 | #include "rclcpp/node_interfaces/node_waitables_interface.hpp"
22 | #include "rclcpp/waitable.hpp"
23 | #include "rclcpp/visibility_control.hpp"
24 |
25 | namespace rclcpp
26 | {
27 | namespace node_interfaces
28 | {
29 |
30 | /// Implementation of the NodeWaitables part of the Node API.
31 | class NodeWaitables : public NodeWaitablesInterface
32 | {
33 | public:
34 | RCLCPP_SMART_PTR_ALIASES_ONLY(NodeWaitables)
35 |
36 | RCLCPP_PUBLIC
37 | explicit NodeWaitables(rclcpp::node_interfaces::NodeBaseInterface * node_base);
38 |
39 | RCLCPP_PUBLIC
40 | virtual
41 | ~NodeWaitables();
42 |
43 | RCLCPP_PUBLIC
44 | void
45 | add_waitable(
46 | rclcpp::Waitable::SharedPtr waitable_base_ptr,
47 | rclcpp::CallbackGroup::SharedPtr group) override;
48 |
49 | RCLCPP_PUBLIC
50 | void
51 | remove_waitable(
52 | rclcpp::Waitable::SharedPtr waitable_ptr,
53 | rclcpp::CallbackGroup::SharedPtr group) noexcept override;
54 |
55 | private:
56 | RCLCPP_DISABLE_COPY(NodeWaitables)
57 |
58 | rclcpp::node_interfaces::NodeBaseInterface * node_base_;
59 | };
60 |
61 | } // namespace node_interfaces
62 | } // namespace rclcpp
63 |
64 | #endif // RCLCPP__NODE_INTERFACES__NODE_WAITABLES_HPP_
65 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/node_interfaces/node_waitables_interface.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2018 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__NODE_INTERFACES__NODE_WAITABLES_INTERFACE_HPP_
16 | #define RCLCPP__NODE_INTERFACES__NODE_WAITABLES_INTERFACE_HPP_
17 |
18 | #include "rclcpp/callback_group.hpp"
19 | #include "rclcpp/macros.hpp"
20 | #include "rclcpp/visibility_control.hpp"
21 | #include "rclcpp/waitable.hpp"
22 |
23 | namespace rclcpp
24 | {
25 | namespace node_interfaces
26 | {
27 |
28 | /// Pure virtual interface class for the NodeWaitables part of the Node API.
29 | class NodeWaitablesInterface
30 | {
31 | public:
32 | RCLCPP_SMART_PTR_ALIASES_ONLY(NodeWaitablesInterface)
33 |
34 | RCLCPP_PUBLIC
35 | virtual
36 | ~NodeWaitablesInterface() = default;
37 |
38 | RCLCPP_PUBLIC
39 | virtual
40 | void
41 | add_waitable(
42 | rclcpp::Waitable::SharedPtr waitable_ptr,
43 | rclcpp::CallbackGroup::SharedPtr group) = 0;
44 |
45 | /// \note this function should not throw because it may be called in destructors
46 | RCLCPP_PUBLIC
47 | virtual
48 | void
49 | remove_waitable(
50 | rclcpp::Waitable::SharedPtr waitable_ptr,
51 | rclcpp::CallbackGroup::SharedPtr group) noexcept = 0;
52 | };
53 |
54 | } // namespace node_interfaces
55 | } // namespace rclcpp
56 |
57 | #endif // RCLCPP__NODE_INTERFACES__NODE_WAITABLES_INTERFACE_HPP_
58 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/parameter_map.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2018 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__PARAMETER_MAP_HPP_
16 | #define RCLCPP__PARAMETER_MAP_HPP_
17 |
18 | #include
19 | #include
20 |
21 | #include
22 | #include
23 | #include
24 |
25 | #include "rclcpp/exceptions.hpp"
26 | #include "rclcpp/parameter.hpp"
27 | #include "rclcpp/parameter_value.hpp"
28 | #include "rclcpp/visibility_control.hpp"
29 |
30 | namespace rclcpp
31 | {
32 |
33 | /// A map of fully qualified node names to a list of parameters
34 | using ParameterMap = std::unordered_map>;
35 |
36 | /// Convert parameters from rcl_yaml_param_parser into C++ class instances.
37 | /// \param[in] c_params C structures containing parameters for multiple nodes.
38 | /// \returns a map where the keys are fully qualified node names and values a list of parameters.
39 | /// \throws InvalidParametersException if the `rcl_params_t` is inconsistent or invalid.
40 | RCLCPP_PUBLIC
41 | ParameterMap
42 | parameter_map_from(const rcl_params_t * const c_params);
43 |
44 | /// Convert parameter value from rcl_yaml_param_parser into a C++ class instance.
45 | /// \param[in] c_value C structure containing a value of a parameter.
46 | /// \returns an instance of a parameter value
47 | /// \throws InvalidParameterValueException if the `rcl_variant_t` is inconsistent or invalid.
48 | RCLCPP_PUBLIC
49 | ParameterValue
50 | parameter_value_from(const rcl_variant_t * const c_value);
51 |
52 | /// Get the ParameterMap from a yaml file.
53 | /// \param[in] yaml_filename full name of the yaml file.
54 | /// \returns an instance of a parameter map
55 | /// \throws from rcl error of rcl_parse_yaml_file()
56 | RCLCPP_PUBLIC
57 | ParameterMap
58 | parameter_map_from_yaml_file(const std::string & yaml_filename);
59 |
60 | } // namespace rclcpp
61 |
62 | #endif // RCLCPP__PARAMETER_MAP_HPP_
63 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/parameter_service.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__PARAMETER_SERVICE_HPP_
16 | #define RCLCPP__PARAMETER_SERVICE_HPP_
17 |
18 | #include
19 | #include
20 |
21 | #include "rcl_interfaces/srv/describe_parameters.hpp"
22 | #include "rcl_interfaces/srv/get_parameter_types.hpp"
23 | #include "rcl_interfaces/srv/get_parameters.hpp"
24 | #include "rcl_interfaces/srv/list_parameters.hpp"
25 | #include "rcl_interfaces/srv/set_parameters.hpp"
26 | #include "rcl_interfaces/srv/set_parameters_atomically.hpp"
27 | #include "rclcpp/executors.hpp"
28 | #include "rclcpp/macros.hpp"
29 | #include "rclcpp/node.hpp"
30 | #include "rclcpp/parameter.hpp"
31 | #include "rclcpp/visibility_control.hpp"
32 | #include "rmw/rmw.h"
33 |
34 | namespace rclcpp
35 | {
36 |
37 | class ParameterService
38 | {
39 | public:
40 | RCLCPP_SMART_PTR_DEFINITIONS(ParameterService)
41 |
42 | RCLCPP_PUBLIC
43 | explicit ParameterService(
44 | const std::shared_ptr node_base,
45 | const std::shared_ptr node_services,
46 | rclcpp::node_interfaces::NodeParametersInterface * node_params,
47 | const rmw_qos_profile_t & qos_profile = rmw_qos_profile_parameters);
48 |
49 | private:
50 | rclcpp::Service::SharedPtr get_parameters_service_;
51 | rclcpp::Service::SharedPtr
52 | get_parameter_types_service_;
53 | rclcpp::Service::SharedPtr set_parameters_service_;
54 | rclcpp::Service::SharedPtr
55 | set_parameters_atomically_service_;
56 | rclcpp::Service::SharedPtr
57 | describe_parameters_service_;
58 | rclcpp::Service::SharedPtr list_parameters_service_;
59 | };
60 |
61 | } // namespace rclcpp
62 |
63 | #endif // RCLCPP__PARAMETER_SERVICE_HPP_
64 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/scope_exit.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | // Based on: http://the-witness.net/news/2012/11/scopeexit-in-c11/
16 | // But I changed the lambda to include by reference rather than value, see:
17 | // http://the-witness.net/news/2012/11/scopeexit-in-c11/comment-page-1/#comment-86873
18 |
19 | #ifndef RCLCPP__SCOPE_EXIT_HPP_
20 | #define RCLCPP__SCOPE_EXIT_HPP_
21 |
22 | #include
23 |
24 | #include "rclcpp/macros.hpp"
25 |
26 | namespace rclcpp
27 | {
28 |
29 | template
30 | struct ScopeExit
31 | {
32 | explicit ScopeExit(Callable callable)
33 | : callable_(callable) {}
34 | ~ScopeExit() {callable_();}
35 |
36 | private:
37 | Callable callable_;
38 | };
39 |
40 | template
41 | ScopeExit
42 | make_scope_exit(Callable callable)
43 | {
44 | return ScopeExit(callable);
45 | }
46 |
47 | } // namespace rclcpp
48 |
49 | #define RCLCPP_SCOPE_EXIT(code) \
50 | auto RCLCPP_STRING_JOIN(scope_exit_, __LINE__) = rclcpp::make_scope_exit([&]() {code;})
51 |
52 | #endif // RCLCPP__SCOPE_EXIT_HPP_
53 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/subscription_wait_set_mask.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2020 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__SUBSCRIPTION_WAIT_SET_MASK_HPP_
16 | #define RCLCPP__SUBSCRIPTION_WAIT_SET_MASK_HPP_
17 |
18 | #include "rclcpp/visibility_control.hpp"
19 |
20 | namespace rclcpp
21 | {
22 |
23 | /// Options used to determine what parts of a subscription get added to or removed from a wait set.
24 | class RCLCPP_PUBLIC SubscriptionWaitSetMask
25 | {
26 | public:
27 | /// If true, include the actual subscription.
28 | bool include_subscription = true;
29 | /// If true, include any events attached to the subscription.
30 | bool include_events = true;
31 | /// If true, include the waitable used to handle intra process communication.
32 | bool include_intra_process_waitable = true;
33 | };
34 |
35 | } // namespace rclcpp
36 |
37 | #endif // RCLCPP__SUBSCRIPTION_WAIT_SET_MASK_HPP_
38 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/topic_statistics_state.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__TOPIC_STATISTICS_STATE_HPP_
16 | #define RCLCPP__TOPIC_STATISTICS_STATE_HPP_
17 |
18 | namespace rclcpp
19 | {
20 |
21 | /// Represent the state of topic statistics collector.
22 | /// Used as argument in create_subscriber.
23 | enum class TopicStatisticsState
24 | {
25 | /// Explicitly enable topic statistics at subscription level.
26 | Enable,
27 | /// Explicitly disable topic statistics at subscription level.
28 | Disable,
29 | /// Take topic statistics state from the node.
30 | NodeDefault
31 | };
32 |
33 | } // namespace rclcpp
34 |
35 | #endif // RCLCPP__TOPIC_STATISTICS_STATE_HPP_
36 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/type_support_decl.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__TYPE_SUPPORT_DECL_HPP_
16 | #define RCLCPP__TYPE_SUPPORT_DECL_HPP_
17 |
18 | #include "rosidl_runtime_cpp/message_type_support_decl.hpp"
19 | #include "rosidl_runtime_cpp/service_type_support_decl.hpp"
20 |
21 | #include "rosidl_typesupport_cpp/message_type_support.hpp"
22 | #include "rosidl_typesupport_cpp/service_type_support.hpp"
23 |
24 | #include "rclcpp/visibility_control.hpp"
25 |
26 | namespace rclcpp
27 | {
28 | namespace type_support
29 | {
30 |
31 | RCLCPP_PUBLIC
32 | const rosidl_message_type_support_t *
33 | get_intra_process_message_msg_type_support();
34 |
35 | RCLCPP_PUBLIC
36 | const rosidl_message_type_support_t *
37 | get_parameter_event_msg_type_support();
38 |
39 | RCLCPP_PUBLIC
40 | const rosidl_message_type_support_t *
41 | get_set_parameters_result_msg_type_support();
42 |
43 | RCLCPP_PUBLIC
44 | const rosidl_message_type_support_t *
45 | get_parameter_descriptor_msg_type_support();
46 |
47 | RCLCPP_PUBLIC
48 | const rosidl_message_type_support_t *
49 | get_list_parameters_result_msg_type_support();
50 |
51 | RCLCPP_PUBLIC
52 | const rosidl_service_type_support_t *
53 | get_get_parameters_srv_type_support();
54 |
55 | RCLCPP_PUBLIC
56 | const rosidl_service_type_support_t *
57 | get_get_parameter_types_srv_type_support();
58 |
59 | RCLCPP_PUBLIC
60 | const rosidl_service_type_support_t *
61 | get_set_parameters_srv_type_support();
62 |
63 | RCLCPP_PUBLIC
64 | const rosidl_service_type_support_t *
65 | get_list_parameters_srv_type_support();
66 |
67 | RCLCPP_PUBLIC
68 | const rosidl_service_type_support_t *
69 | get_describe_parameters_srv_type_support();
70 |
71 | RCLCPP_PUBLIC
72 | const rosidl_service_type_support_t *
73 | get_set_parameters_atomically_srv_type_support();
74 |
75 | } // namespace type_support
76 | } // namespace rclcpp
77 |
78 | #endif // RCLCPP__TYPE_SUPPORT_DECL_HPP_
79 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/typesupport_helpers.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2018, Bosch Software Innovations GmbH.
2 | // Copyright 2021, Apex.AI Inc.
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 | #ifndef RCLCPP__TYPESUPPORT_HELPERS_HPP_
17 | #define RCLCPP__TYPESUPPORT_HELPERS_HPP_
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | #include "rcpputils/shared_library.hpp"
24 | #include "rosidl_runtime_cpp/message_type_support_decl.hpp"
25 |
26 | #include "rclcpp/visibility_control.hpp"
27 |
28 | namespace rclcpp
29 | {
30 | /// Load the type support library for the given type.
31 | /**
32 | * \param[in] type The topic type, e.g. "std_msgs/msg/String"
33 | * \param[in] typesupport_identifier Type support identifier, typically "rosidl_typesupport_cpp"
34 | * \return A shared library
35 | */
36 | RCLCPP_PUBLIC
37 | std::shared_ptr
38 | get_typesupport_library(const std::string & type, const std::string & typesupport_identifier);
39 |
40 | /// Extract the type support handle from the library.
41 | /**
42 | * The library needs to match the topic type. The shared library must stay loaded for the lifetime of the result.
43 | * \param[in] type The topic type, e.g. "std_msgs/msg/String"
44 | * \param[in] typesupport_identifier Type support identifier, typically "rosidl_typesupport_cpp"
45 | * \param[in] library The shared type support library
46 | * \return A type support handle
47 | */
48 | RCLCPP_PUBLIC
49 | const rosidl_message_type_support_t *
50 | get_typesupport_handle(
51 | const std::string & type,
52 | const std::string & typesupport_identifier,
53 | rcpputils::SharedLibrary & library);
54 |
55 | } // namespace rclcpp
56 |
57 | #endif // RCLCPP__TYPESUPPORT_HELPERS_HPP_
58 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/visibility_control.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | /* This header must be included by all rclcpp headers which declare symbols
16 | * which are defined in the rclcpp library. When not building the rclcpp
17 | * library, i.e. when using the headers in other package's code, the contents
18 | * of this header change the visibility of certain symbols which the rclcpp
19 | * library cannot have, but the consuming code must have inorder to link.
20 | */
21 |
22 | #ifndef RCLCPP__VISIBILITY_CONTROL_HPP_
23 | #define RCLCPP__VISIBILITY_CONTROL_HPP_
24 |
25 | // This logic was borrowed (then namespaced) from the examples on the gcc wiki:
26 | // https://gcc.gnu.org/wiki/Visibility
27 |
28 | #if defined _WIN32 || defined __CYGWIN__
29 | #ifdef __GNUC__
30 | #define RCLCPP_EXPORT __attribute__ ((dllexport))
31 | #define RCLCPP_IMPORT __attribute__ ((dllimport))
32 | #else
33 | #define RCLCPP_EXPORT __declspec(dllexport)
34 | #define RCLCPP_IMPORT __declspec(dllimport)
35 | #endif
36 | #ifdef RCLCPP_BUILDING_LIBRARY
37 | #define RCLCPP_PUBLIC RCLCPP_EXPORT
38 | #else
39 | #define RCLCPP_PUBLIC RCLCPP_IMPORT
40 | #endif
41 | #define RCLCPP_PUBLIC_TYPE RCLCPP_PUBLIC
42 | #define RCLCPP_LOCAL
43 | #else
44 | #define RCLCPP_EXPORT __attribute__ ((visibility("default")))
45 | #define RCLCPP_IMPORT
46 | #if __GNUC__ >= 4
47 | #define RCLCPP_PUBLIC __attribute__ ((visibility("default")))
48 | #define RCLCPP_LOCAL __attribute__ ((visibility("hidden")))
49 | #else
50 | #define RCLCPP_PUBLIC
51 | #define RCLCPP_LOCAL
52 | #endif
53 | #define RCLCPP_PUBLIC_TYPE
54 | #endif
55 |
56 | #endif // RCLCPP__VISIBILITY_CONTROL_HPP_
57 |
--------------------------------------------------------------------------------
/rclcpp/include/rclcpp/wait_result_kind.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2020 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__WAIT_RESULT_KIND_HPP_
16 | #define RCLCPP__WAIT_RESULT_KIND_HPP_
17 |
18 | #include "rclcpp/visibility_control.hpp"
19 |
20 | namespace rclcpp
21 | {
22 |
23 | /// Represents the various kinds of results from waiting on a wait set.
24 | enum RCLCPP_PUBLIC WaitResultKind
25 | {
26 | Ready, //
19 | #include
20 |
21 | namespace rclcpp
22 | {
23 | namespace wait_set_policies
24 | {
25 | namespace detail
26 | {
27 |
28 | /// Common structure for synchronization policies.
29 | class SynchronizationPolicyCommon
30 | {
31 | protected:
32 | SynchronizationPolicyCommon() = default;
33 | ~SynchronizationPolicyCommon() = default;
34 |
35 | std::function
36 | create_loop_predicate(
37 | std::chrono::nanoseconds time_to_wait_ns,
38 | std::chrono::steady_clock::time_point start)
39 | {
40 | if (time_to_wait_ns >= std::chrono::nanoseconds(0)) {
41 | // If time_to_wait_ns is >= 0 schedule against a deadline.
42 | auto deadline = start + time_to_wait_ns;
43 | return [deadline]() -> bool {return std::chrono::steady_clock::now() < deadline;};
44 | } else {
45 | // In the case of time_to_wait_ns < 0, just always return true to loop forever.
46 | return []() -> bool {return true;};
47 | }
48 | }
49 |
50 | std::chrono::nanoseconds
51 | calculate_time_left_to_wait(
52 | std::chrono::nanoseconds original_time_to_wait_ns,
53 | std::chrono::steady_clock::time_point start)
54 | {
55 | std::chrono::nanoseconds time_left_to_wait;
56 | if (original_time_to_wait_ns < std::chrono::nanoseconds(0)) {
57 | time_left_to_wait = original_time_to_wait_ns;
58 | } else {
59 | time_left_to_wait = original_time_to_wait_ns - (std::chrono::steady_clock::now() - start);
60 | if (time_left_to_wait < std::chrono::nanoseconds(0)) {
61 | time_left_to_wait = std::chrono::nanoseconds(0);
62 | }
63 | }
64 | return time_left_to_wait;
65 | }
66 | };
67 |
68 | } // namespace detail
69 | } // namespace wait_set_policies
70 | } // namespace rclcpp
71 |
72 | #endif // RCLCPP__WAIT_SET_POLICIES__DETAIL__SYNCHRONIZATION_POLICY_COMMON_HPP_
73 |
--------------------------------------------------------------------------------
/rclcpp/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | rclcpp
5 | 9.2.0
6 | The ROS client library in C++.
7 | Ivan Paunovic
8 | Mabel Zhang
9 | William Woodall
10 | Apache License 2.0
11 | Dirk Thomas
12 |
13 | ament_cmake_ros
14 |
15 | ament_index_cpp
16 | builtin_interfaces
17 | rcl_interfaces
18 | rosgraph_msgs
19 | rosidl_runtime_cpp
20 | rosidl_typesupport_c
21 | rosidl_typesupport_cpp
22 | ament_index_cpp
23 | builtin_interfaces
24 | rcl_interfaces
25 | rosgraph_msgs
26 | rosidl_runtime_cpp
27 | rosidl_typesupport_c
28 | rosidl_typesupport_cpp
29 |
30 | libstatistics_collector
31 | rcl
32 | rcl_yaml_param_parser
33 | rcpputils
34 | rcutils
35 | rmw
36 | statistics_msgs
37 | tracetools
38 |
39 | ament_cmake_gmock
40 | ament_cmake_gtest
41 | ament_lint_auto
42 | ament_lint_common
43 | mimick_vendor
44 | performance_test_fixture
45 | rmw
46 | rmw_implementation_cmake
47 | rosidl_default_generators
48 | test_msgs
49 |
50 |
51 | ament_cmake
52 |
53 |
54 |
--------------------------------------------------------------------------------
/rclcpp/resource/interface_traits.hpp.em:
--------------------------------------------------------------------------------
1 | // Copyright 2020 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 | @{
15 | uppercase_interface_name = interface_name.upper()
16 | interface_typename = ''.join([part.capitalize() for part in interface_name.split('_')])
17 | }@
18 |
19 | #ifndef RCLCPP__NODE_INTERFACES__@(uppercase_interface_name)_TRAITS_HPP_
20 | #define RCLCPP__NODE_INTERFACES__@(uppercase_interface_name)_TRAITS_HPP_
21 |
22 | #include
23 | #include
24 |
25 | #include "rclcpp/node_interfaces/@(interface_name).hpp"
26 |
27 | namespace rclcpp
28 | {
29 | namespace node_interfaces
30 | {
31 |
32 | template
33 | struct has_@(interface_name) : std::false_type
34 | {};
35 |
36 | template
37 | struct has_@(interface_name)<
38 | T, typename std::enable_if<
39 | std::is_same<
40 | std::shared_ptr,
41 | decltype(std::declval().get_@(interface_name)())>::value>::type> : std::true_type
42 | {};
43 |
44 | } // namespace node_interfaces
45 | } // namespace rclcpp
46 |
47 | #endif // RCLCPP__NODE_INTERFACES__@(uppercase_interface_name)_TRAITS_HPP_
48 |
--------------------------------------------------------------------------------
/rclcpp/src/rclcpp/any_executable.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include "rclcpp/any_executable.hpp"
16 |
17 | using rclcpp::AnyExecutable;
18 |
19 | AnyExecutable::AnyExecutable()
20 | : subscription(nullptr),
21 | timer(nullptr),
22 | service(nullptr),
23 | client(nullptr),
24 | callback_group(nullptr),
25 | node_base(nullptr)
26 | {}
27 |
28 | AnyExecutable::~AnyExecutable()
29 | {
30 | // Make sure that discarded (taken but not executed) AnyExecutable's have
31 | // their callback groups reset. This can happen when an executor is canceled
32 | // between taking an AnyExecutable and executing it.
33 | if (callback_group) {
34 | callback_group->can_be_taken_from().store(true);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/rclcpp/src/rclcpp/contexts/default_context.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include "rclcpp/contexts/default_context.hpp"
16 |
17 | using rclcpp::contexts::DefaultContext;
18 |
19 | DefaultContext::DefaultContext()
20 | {}
21 |
22 | DefaultContext::SharedPtr
23 | rclcpp::contexts::get_global_default_context()
24 | {
25 | static DefaultContext::SharedPtr default_context = DefaultContext::make_shared();
26 | return default_context;
27 | }
28 |
--------------------------------------------------------------------------------
/rclcpp/src/rclcpp/detail/mutex_two_priorities.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2021 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include "rclcpp/detail/mutex_two_priorities.hpp"
16 |
17 | #include
18 |
19 | namespace rclcpp
20 | {
21 | namespace detail
22 | {
23 |
24 | using LowPriorityLockable = MutexTwoPriorities::LowPriorityLockable;
25 | using HighPriorityLockable = MutexTwoPriorities::HighPriorityLockable;
26 |
27 | HighPriorityLockable::HighPriorityLockable(MutexTwoPriorities & parent)
28 | : parent_(parent)
29 | {}
30 |
31 | void
32 | HighPriorityLockable::lock()
33 | {
34 | std::unique_lock guard{parent_.cv_mutex_};
35 | if (parent_.data_taken_) {
36 | ++parent_.hp_waiting_count_;
37 | while (parent_.data_taken_) {
38 | parent_.hp_cv_.wait(guard);
39 | }
40 | --parent_.hp_waiting_count_;
41 | }
42 | parent_.data_taken_ = true;
43 | }
44 |
45 | void
46 | HighPriorityLockable::unlock()
47 | {
48 | bool notify_lp{false};
49 | {
50 | std::lock_guard guard{parent_.cv_mutex_};
51 | parent_.data_taken_ = false;
52 | notify_lp = 0u == parent_.hp_waiting_count_;
53 | }
54 | if (notify_lp) {
55 | parent_.lp_cv_.notify_one();
56 | } else {
57 | parent_.hp_cv_.notify_one();
58 | }
59 | }
60 |
61 | LowPriorityLockable::LowPriorityLockable(MutexTwoPriorities & parent)
62 | : parent_(parent)
63 | {}
64 |
65 | void
66 | LowPriorityLockable::lock()
67 | {
68 | std::unique_lock guard{parent_.cv_mutex_};
69 | while (parent_.data_taken_ || parent_.hp_waiting_count_) {
70 | parent_.lp_cv_.wait(guard);
71 | }
72 | parent_.data_taken_ = true;
73 | }
74 |
75 | void
76 | LowPriorityLockable::unlock()
77 | {
78 | bool notify_lp{false};
79 | {
80 | std::lock_guard guard{parent_.cv_mutex_};
81 | parent_.data_taken_ = false;
82 | notify_lp = 0u == parent_.hp_waiting_count_;
83 | }
84 | if (notify_lp) {
85 | parent_.lp_cv_.notify_one();
86 | } else {
87 | parent_.hp_cv_.notify_one();
88 | }
89 | }
90 |
91 | HighPriorityLockable
92 | MutexTwoPriorities::get_high_priority_lockable()
93 | {
94 | return HighPriorityLockable{*this};
95 | }
96 |
97 | LowPriorityLockable
98 | MutexTwoPriorities::get_low_priority_lockable()
99 | {
100 | return LowPriorityLockable{*this};
101 | }
102 |
103 | } // namespace detail
104 | } // namespace rclcpp
105 |
--------------------------------------------------------------------------------
/rclcpp/src/rclcpp/detail/resolve_parameter_overrides.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2021 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RCLCPP__DETAIL__RESOLVE_PARAMETER_OVERRIDES_HPP_
16 | #define RCLCPP__DETAIL__RESOLVE_PARAMETER_OVERRIDES_HPP_
17 |
18 | #include
19 | #include