├── rclcpp
├── .gitignore
├── include
│ └── rclcpp
│ │ ├── detail
│ │ ├── README.md
│ │ ├── utilities.hpp
│ │ ├── resolve_use_intra_process.hpp
│ │ ├── rmw_implementation_specific_payload.hpp
│ │ ├── resolve_enable_topic_statistics.hpp
│ │ ├── rmw_implementation_specific_publisher_payload.hpp
│ │ ├── resolve_intra_process_buffer_type.hpp
│ │ ├── rmw_implementation_specific_subscription_payload.hpp
│ │ └── mutex_two_priorities.hpp
│ │ ├── experimental
│ │ ├── README.md
│ │ ├── buffers
│ │ │ └── buffer_implementation_base.hpp
│ │ └── subscription_intra_process_base.hpp
│ │ ├── exceptions.hpp
│ │ ├── memory_strategies.hpp
│ │ ├── wait_result_kind.hpp
│ │ ├── intra_process_setting.hpp
│ │ ├── topic_statistics_state.hpp
│ │ ├── contexts
│ │ └── default_context.hpp
│ │ ├── intra_process_buffer_type.hpp
│ │ ├── node_interfaces
│ │ ├── node_time_source_interface.hpp
│ │ ├── node_timers_interface.hpp
│ │ ├── node_clock_interface.hpp
│ │ ├── node_logging_interface.hpp
│ │ ├── node_waitables_interface.hpp
│ │ ├── node_timers.hpp
│ │ ├── node_logging.hpp
│ │ ├── node_services_interface.hpp
│ │ ├── node_waitables.hpp
│ │ ├── node_services.hpp
│ │ └── node_clock.hpp
│ │ ├── subscription_wait_set_mask.hpp
│ │ ├── executor_options.hpp
│ │ ├── scope_exit.hpp
│ │ ├── future_return_code.hpp
│ │ ├── event.hpp
│ │ ├── message_info.hpp
│ │ ├── any_executable.hpp
│ │ ├── create_client.hpp
│ │ ├── create_service.hpp
│ │ ├── typesupport_helpers.hpp
│ │ ├── visibility_control.hpp
│ │ ├── type_support_decl.hpp
│ │ ├── parameter_map.hpp
│ │ ├── parameter_service.hpp
│ │ ├── create_generic_publisher.hpp
│ │ ├── wait_set_policies
│ │ └── detail
│ │ │ └── synchronization_policy_common.hpp
│ │ ├── executors
│ │ └── single_threaded_executor.hpp
│ │ ├── expand_topic_or_service_name.hpp
│ │ └── cb_sched.hpp
├── README.md
├── src
│ └── rclcpp
│ │ ├── contexts
│ │ └── default_context.cpp
│ │ ├── event.cpp
│ │ ├── logging_mutex.cpp
│ │ ├── memory_strategies.cpp
│ │ ├── detail
│ │ ├── rmw_implementation_specific_payload.cpp
│ │ ├── rmw_implementation_specific_publisher_payload.cpp
│ │ ├── rmw_implementation_specific_subscription_payload.cpp
│ │ ├── resolve_parameter_overrides.hpp
│ │ ├── utilities.cpp
│ │ └── mutex_two_priorities.cpp
│ │ ├── message_info.cpp
│ │ ├── generic_publisher.cpp
│ │ ├── node_interfaces
│ │ ├── node_logging.cpp
│ │ ├── node_clock.cpp
│ │ ├── node_timers.cpp
│ │ ├── node_time_source.cpp
│ │ └── node_waitables.cpp
│ │ ├── any_executable.cpp
│ │ ├── subscription_intra_process_base.cpp
│ │ ├── executors.cpp
│ │ ├── parameter_service_names.hpp
│ │ ├── waitable.cpp
│ │ ├── logging_mutex.hpp
│ │ ├── future_return_code.cpp
│ │ ├── generic_subscription.cpp
│ │ ├── qos_event.cpp
│ │ ├── executable_list.cpp
│ │ ├── service.cpp
│ │ ├── parameter_events_filter.cpp
│ │ ├── qos_overriding_options.cpp
│ │ ├── guard_condition.cpp
│ │ ├── logger.cpp
│ │ ├── network_flow_endpoint.cpp
│ │ └── serialization.cpp
├── Doxyfile
├── resource
│ └── interface_traits.hpp.em
└── package.xml
├── .gitignore
├── autoware_reference_system
├── scripts
│ ├── benchmark_all.sh
│ ├── benchmark_one.sh
│ └── utils.sh
├── test
│ ├── generate_graph.sh
│ ├── test_autoware_reference_system.cpp
│ ├── constants.py
│ ├── trace_utils.py
│ ├── utils.py
│ ├── test_platform.py
│ └── generate_std_traces.py
├── cmake
│ ├── test_requirements.cmake
│ ├── generate_summary_report.cmake
│ ├── generate_traces.cmake
│ └── generate_report.cmake
├── src
│ └── ros2
│ │ ├── number_cruncher_benchmark.cpp
│ │ └── executor
│ │ ├── autoware_default_multithreaded.cpp
│ │ ├── autoware_default_singlethreaded.cpp
│ │ ├── autoware_default_staticsinglethreaded.cpp
│ │ └── autoware_default_singlethreaded_picas_single_executor.cpp
└── package.xml
├── reference_interfaces
├── msg
│ ├── TransmissionStats.idl
│ └── Message4kb.idl
├── package.xml
└── CMakeLists.txt
├── reference_system
├── README.md
├── include
│ └── reference_system
│ │ ├── msg_types.hpp
│ │ ├── system
│ │ ├── systems.hpp
│ │ └── type
│ │ │ └── rclcpp_system.hpp
│ │ ├── number_cruncher.hpp
│ │ └── nodes
│ │ ├── rclcpp
│ │ ├── command.hpp
│ │ ├── sensor.hpp
│ │ └── transform.hpp
│ │ └── settings.hpp
├── package.xml
└── CMakeLists.txt
├── CONTRIBUTING.md
└── .github
└── workflows
└── colcon-build.yml
/rclcpp/.gitignore:
--------------------------------------------------------------------------------
1 | doc_output
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | **__pycache__
2 | .vscode/
3 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/reference_interfaces/msg/TransmissionStats.idl:
--------------------------------------------------------------------------------
1 | module reference_interfaces {
2 | module msg {
3 | module TransmissionStats_Constants {
4 | const uint64 NODE_NAME_LENGTH = 48;
5 | };
6 | struct TransmissionStats { // 64 bytes
7 | uint64 timestamp;
8 | uint32 sequence_number;
9 | uint32 dropped_samples;
10 | char node_name[48];
11 | };
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/reference_system/README.md:
--------------------------------------------------------------------------------
1 | # reference_system
2 |
3 | This package holds the core node definitions that can be used to build various reference systems that can end up being quite complex.
4 |
5 | These _reference systems_ can then be used to benchmark, test and evaluate various changes to the core middleware being used (e.g. executors, QoS settings, DDSs', etc.).
6 |
7 | See [autoware_reference_system](../autoware_reference_system/) as an example as to how one could use these nodes to build a simulated real-world system for benchmarking and testing purposes.
--------------------------------------------------------------------------------
/reference_interfaces/msg/Message4kb.idl:
--------------------------------------------------------------------------------
1 | #include "reference_interfaces/msg/TransmissionStats.idl"
2 |
3 | module reference_interfaces {
4 | module msg {
5 | module Message4kb_Constants {
6 | const uint64 STATS_CAPACITY = 63;
7 | };
8 | struct Message4kb {
9 | uint64 size; // 8
10 | reference_interfaces::msg::TransmissionStats stats[63]; // + 4032 = 63 * 64
11 | int64 data[7]; // + 56 = 7 * 8
12 | //-----------------
13 | // 4096
14 | };
15 | };
16 | };
17 |
--------------------------------------------------------------------------------
/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
--------------------------------------------------------------------------------
/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/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/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 |
--------------------------------------------------------------------------------
/reference_interfaces/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | reference_interfaces
5 | 0.1.1
6 | Reference system for the ROScon workshop
7 | Christian Eltzschig
8 | Apache License 2.0
9 |
10 | ament_cmake_auto
11 | rosidl_default_generators
12 |
13 | rosidl_default_runtime
14 |
15 |
16 | rosidl_interface_packages
17 |
18 |
19 | ament_cmake
20 |
21 |
22 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/reference_system/include/reference_system/msg_types.hpp:
--------------------------------------------------------------------------------
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 | #ifndef REFERENCE_SYSTEM__MSG_TYPES_HPP_
15 | #define REFERENCE_SYSTEM__MSG_TYPES_HPP_
16 |
17 | #include "reference_interfaces/msg/message4kb.hpp"
18 |
19 | using message_t = reference_interfaces::msg::Message4kb;
20 |
21 | #endif // REFERENCE_SYSTEM__MSG_TYPES_HPP_
22 |
--------------------------------------------------------------------------------
/reference_system/include/reference_system/system/systems.hpp:
--------------------------------------------------------------------------------
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 | #ifndef REFERENCE_SYSTEM__SYSTEM__SYSTEMS_HPP_
15 | #define REFERENCE_SYSTEM__SYSTEM__SYSTEMS_HPP_
16 |
17 | // Add available systems here
18 | #include "reference_system/system/type/rclcpp_system.hpp"
19 |
20 | #endif // REFERENCE_SYSTEM__SYSTEM__SYSTEMS_HPP_
21 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/reference_system/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | reference_system
5 | 0.1.1
6 | 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 | rclcpp
16 | reference_interfaces
17 | rcl_interfaces
18 |
19 | ament_lint_auto
20 | ament_lint_common
21 | ros_testing
22 |
23 |
24 | ament_cmake
25 |
26 |
27 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/event.cpp:
--------------------------------------------------------------------------------
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 | #include "rclcpp/event.hpp"
16 |
17 | namespace rclcpp
18 | {
19 |
20 | Event::Event()
21 | : state_(false) {}
22 |
23 | bool
24 | Event::set()
25 | {
26 | return state_.exchange(true);
27 | }
28 |
29 | bool
30 | Event::check()
31 | {
32 | return state_.load();
33 | }
34 |
35 | bool
36 | Event::check_and_clear()
37 | {
38 | return state_.exchange(false);
39 | }
40 |
41 | } // namespace rclcpp
42 |
--------------------------------------------------------------------------------
/rclcpp/src/rclcpp/logging_mutex.cpp:
--------------------------------------------------------------------------------
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 | #include
16 | #include
17 |
18 | #include "rcutils/macros.h"
19 |
20 | #include "./logging_mutex.hpp"
21 |
22 | std::shared_ptr
23 | get_global_logging_mutex()
24 | {
25 | static auto mutex = std::make_shared();
26 | if (RCUTILS_UNLIKELY(!mutex)) {
27 | throw std::runtime_error("rclcpp global logging mutex is a nullptr");
28 | }
29 | return mutex;
30 | }
31 |
--------------------------------------------------------------------------------
/rclcpp/src/rclcpp/memory_strategies.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/memory_strategies.hpp"
16 |
17 | #include
18 |
19 | #include "rclcpp/strategies/allocator_memory_strategy.hpp"
20 |
21 | using rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy;
22 |
23 | rclcpp::memory_strategy::MemoryStrategy::SharedPtr
24 | rclcpp::memory_strategies::create_default_strategy()
25 | {
26 | return std::make_shared>();
27 | }
28 |
--------------------------------------------------------------------------------
/rclcpp/src/rclcpp/detail/rmw_implementation_specific_payload.cpp:
--------------------------------------------------------------------------------
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 | #include
16 |
17 | namespace rclcpp
18 | {
19 | namespace detail
20 | {
21 |
22 | bool
23 | RMWImplementationSpecificPayload::has_been_customized() const
24 | {
25 | return nullptr != this->get_implementation_identifier();
26 | }
27 |
28 | const char *
29 | RMWImplementationSpecificPayload::get_implementation_identifier() const
30 | {
31 | return nullptr;
32 | }
33 |
34 | } // namespace detail
35 | } // namespace rclcpp
36 |
--------------------------------------------------------------------------------
/reference_system/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.5)
2 | project(reference_system
3 | VERSION 0.0.1
4 | )
5 |
6 | if(NOT CMAKE_CXX_STANDARD)
7 | set(CMAKE_CXX_STANDARD 17)
8 | endif()
9 |
10 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
11 | add_compile_options(-Wall -Wextra -Wpedantic)
12 | endif()
13 |
14 | find_package(ament_cmake_auto REQUIRED)
15 | ament_auto_find_build_dependencies()
16 |
17 | # Add header-only library
18 | add_library(${PROJECT_NAME} INTERFACE)
19 |
20 | target_include_directories(${PROJECT_NAME} INTERFACE
21 | $
22 | $
23 | )
24 |
25 | if(${BUILD_TESTING})
26 | find_package(ament_lint_auto REQUIRED)
27 | ament_lint_auto_find_test_dependencies()
28 | endif()
29 |
30 | # Install
31 | install(TARGETS ${PROJECT_NAME}
32 | EXPORT "export_${PROJECT_NAME}"
33 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
34 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
35 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
36 | INCLUDES DESTINATION include
37 | )
38 |
39 | ament_export_targets("export_${PROJECT_NAME}")
40 | ament_auto_package()
41 |
42 |
--------------------------------------------------------------------------------
/rclcpp/src/rclcpp/message_info.cpp:
--------------------------------------------------------------------------------
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 | #include "rclcpp/message_info.hpp"
16 |
17 | namespace rclcpp
18 | {
19 |
20 | MessageInfo::MessageInfo(const rmw_message_info_t & rmw_message_info)
21 | : rmw_message_info_(rmw_message_info)
22 | {}
23 |
24 | MessageInfo::~MessageInfo()
25 | {}
26 |
27 | const rmw_message_info_t &
28 | MessageInfo::get_rmw_message_info() const
29 | {
30 | return rmw_message_info_;
31 | }
32 |
33 | rmw_message_info_t &
34 | MessageInfo::get_rmw_message_info()
35 | {
36 | return rmw_message_info_;
37 | }
38 |
39 | } // namespace rclcpp
40 |
--------------------------------------------------------------------------------
/rclcpp/src/rclcpp/detail/rmw_implementation_specific_publisher_payload.cpp:
--------------------------------------------------------------------------------
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 | #include
16 |
17 | #include "rcl/publisher.h"
18 |
19 | namespace rclcpp
20 | {
21 | namespace detail
22 | {
23 |
24 | void
25 | RMWImplementationSpecificPublisherPayload::modify_rmw_publisher_options(
26 | rmw_publisher_options_t & rmw_publisher_options) const
27 | {
28 | // By default, do not mutate the rmw publisher options.
29 | (void)rmw_publisher_options;
30 | }
31 |
32 | } // namespace detail
33 | } // namespace rclcpp
34 |
--------------------------------------------------------------------------------
/rclcpp/src/rclcpp/detail/rmw_implementation_specific_subscription_payload.cpp:
--------------------------------------------------------------------------------
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 | #include
16 |
17 | #include "rcl/subscription.h"
18 |
19 | namespace rclcpp
20 | {
21 | namespace detail
22 | {
23 |
24 | void
25 | RMWImplementationSpecificSubscriptionPayload::modify_rmw_subscription_options(
26 | rmw_subscription_options_t & rmw_subscription_options) const
27 | {
28 | // By default, do not mutate the rmw subscription options.
29 | (void)rmw_subscription_options;
30 | }
31 |
32 | } // namespace detail
33 | } // namespace rclcpp
34 |
--------------------------------------------------------------------------------
/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/src/rclcpp/generic_publisher.cpp:
--------------------------------------------------------------------------------
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 | #include "rclcpp/generic_publisher.hpp"
17 |
18 | #include
19 | #include
20 |
21 | namespace rclcpp
22 | {
23 |
24 | void GenericPublisher::publish(const rclcpp::SerializedMessage & message)
25 | {
26 | auto return_code = rcl_publish_serialized_message(
27 | get_publisher_handle().get(), &message.get_rcl_serialized_message(), NULL);
28 |
29 | if (return_code != RCL_RET_OK) {
30 | rclcpp::exceptions::throw_from_rcl_error(return_code, "failed to publish serialized message");
31 | }
32 | }
33 |
34 | } // namespace rclcpp
35 |
--------------------------------------------------------------------------------
/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, //
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/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/src/rclcpp/node_interfaces/node_logging.cpp:
--------------------------------------------------------------------------------
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 | #include "rclcpp/node_interfaces/node_logging.hpp"
16 |
17 | using rclcpp::node_interfaces::NodeLogging;
18 |
19 | NodeLogging::NodeLogging(rclcpp::node_interfaces::NodeBaseInterface * node_base)
20 | : node_base_(node_base)
21 | {
22 | logger_ = rclcpp::get_logger(this->get_logger_name());
23 | }
24 |
25 | NodeLogging::~NodeLogging()
26 | {
27 | }
28 |
29 | rclcpp::Logger
30 | NodeLogging::get_logger() const
31 | {
32 | return logger_;
33 | }
34 |
35 | const char *
36 | NodeLogging::get_logger_name() const
37 | {
38 | return rcl_node_get_logger_name(node_base_->get_rcl_node_handle());
39 | }
40 |
--------------------------------------------------------------------------------
/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/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/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/src/rclcpp/subscription_intra_process_base.cpp:
--------------------------------------------------------------------------------
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 | #include "rclcpp/experimental/subscription_intra_process_base.hpp"
16 |
17 | using rclcpp::experimental::SubscriptionIntraProcessBase;
18 |
19 | bool
20 | SubscriptionIntraProcessBase::add_to_wait_set(rcl_wait_set_t * wait_set)
21 | {
22 | std::lock_guard lock(reentrant_mutex_);
23 |
24 | rcl_ret_t ret = rcl_wait_set_add_guard_condition(wait_set, &gc_, NULL);
25 | return RCL_RET_OK == ret;
26 | }
27 |
28 | const char *
29 | SubscriptionIntraProcessBase::get_topic_name() const
30 | {
31 | return topic_name_.c_str();
32 | }
33 |
34 | rmw_qos_profile_t
35 | SubscriptionIntraProcessBase::get_actual_qos() const
36 | {
37 | return qos_profile_;
38 | }
39 |
--------------------------------------------------------------------------------
/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()
--------------------------------------------------------------------------------
/reference_interfaces/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.5)
2 | project(reference_interfaces)
3 |
4 | # Default to C++17
5 | if(NOT CMAKE_CXX_STANDARD)
6 | set(CMAKE_CXX_STANDARD 17)
7 | endif()
8 |
9 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
10 | add_compile_options(-Wall -Wextra -Wpedantic)
11 | endif()
12 |
13 | find_package(ament_cmake_auto REQUIRED)
14 | ament_auto_find_build_dependencies()
15 |
16 | # add additional messages here
17 | set(msg_files
18 | "msg/TransmissionStats.idl"
19 | "msg/Message4kb.idl"
20 | )
21 |
22 | # add additional message dependencies here
23 | #set(msg_dependencies
24 | # "std_msgs"
25 | #)
26 |
27 | rosidl_generate_interfaces(${PROJECT_NAME}
28 | ${msg_files}
29 | DEPENDENCIES
30 | ${msg_dependencies}
31 | ADD_LINTER_TESTS
32 | )
33 |
34 | ament_auto_package()
35 |
36 | # fix rosidl_generator_py bug #143
37 | # https://github.com/ros2/rosidl_python/issues/143
38 | set(GENERATED_FILE "${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_py/${PROJECT_NAME}/msg/_transmission_stats.py")
39 |
40 | message(STATUS "checking generated file: ${GENERATED_FILE}")
41 | add_custom_command(
42 | TARGET ${PROJECT_NAME}__python
43 | POST_BUILD
44 | COMMAND sed -i "s/all(val >= 0 and val) < 256/all(ord(val) >= 0 and ord(val) < 256/" ${GENERATED_FILE}
45 | COMMENT "Check generated IDL files for extra parenthesis..."
46 | VERBATIM)
47 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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()
--------------------------------------------------------------------------------
/reference_system/include/reference_system/number_cruncher.hpp:
--------------------------------------------------------------------------------
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 | #ifndef REFERENCE_SYSTEM__NUMBER_CRUNCHER_HPP_
15 | #define REFERENCE_SYSTEM__NUMBER_CRUNCHER_HPP_
16 |
17 | #include
18 | #include
19 | #include
20 |
21 | uint64_t number_cruncher(const uint64_t maximum_number)
22 | {
23 | uint64_t number_of_primes = 0;
24 | for (uint64_t i = 3; i < maximum_number; ++i) {
25 | uint64_t rootOfI = static_cast(std::sqrt(i));
26 | bool is_prime = true;
27 | for (uint64_t n = 2; n < rootOfI; ++n) {
28 | if (i % n == 0) {
29 | is_prime = false;
30 | break;
31 | }
32 | }
33 |
34 | if (is_prime) {
35 | ++number_of_primes;
36 | }
37 | }
38 | return number_of_primes;
39 | }
40 |
41 | #endif // REFERENCE_SYSTEM__NUMBER_CRUNCHER_HPP_
42 |
--------------------------------------------------------------------------------
/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/src/rclcpp/executors.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/executors.hpp"
16 |
17 | void
18 | rclcpp::spin_some(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr)
19 | {
20 | rclcpp::executors::SingleThreadedExecutor exec;
21 | exec.spin_node_some(node_ptr);
22 | }
23 |
24 | void
25 | rclcpp::spin_some(rclcpp::Node::SharedPtr node_ptr)
26 | {
27 | rclcpp::spin_some(node_ptr->get_node_base_interface());
28 | }
29 |
30 | void
31 | rclcpp::spin(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr)
32 | {
33 | rclcpp::executors::SingleThreadedExecutor exec;
34 | exec.add_node(node_ptr);
35 | exec.spin();
36 | exec.remove_node(node_ptr);
37 | }
38 |
39 | void
40 | rclcpp::spin(rclcpp::Node::SharedPtr node_ptr)
41 | {
42 | rclcpp::spin(node_ptr->get_node_base_interface());
43 | }
44 |
--------------------------------------------------------------------------------
/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/src/rclcpp/parameter_service_names.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__PARAMETER_SERVICE_NAMES_HPP_
16 | #define RCLCPP__PARAMETER_SERVICE_NAMES_HPP_
17 |
18 | namespace rclcpp
19 | {
20 | namespace parameter_service_names
21 | {
22 |
23 | static constexpr const char * get_parameters = "get_parameters";
24 | static constexpr const char * get_parameter_types = "get_parameter_types";
25 | static constexpr const char * set_parameters = "set_parameters";
26 | static constexpr const char * set_parameters_atomically = "set_parameters_atomically";
27 | static constexpr const char * describe_parameters = "describe_parameters";
28 | static constexpr const char * list_parameters = "list_parameters";
29 |
30 | } // namespace parameter_service_names
31 | } // namespace rclcpp
32 |
33 | #endif // RCLCPP__PARAMETER_SERVICE_NAMES_HPP_
34 |
--------------------------------------------------------------------------------
/rclcpp/src/rclcpp/waitable.cpp:
--------------------------------------------------------------------------------
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 | #include "rclcpp/waitable.hpp"
16 |
17 | using rclcpp::Waitable;
18 |
19 | size_t
20 | Waitable::get_number_of_ready_subscriptions()
21 | {
22 | return 0u;
23 | }
24 |
25 | size_t
26 | Waitable::get_number_of_ready_timers()
27 | {
28 | return 0u;
29 | }
30 |
31 | size_t
32 | Waitable::get_number_of_ready_clients()
33 | {
34 | return 0u;
35 | }
36 |
37 | size_t
38 | Waitable::get_number_of_ready_events()
39 | {
40 | return 0u;
41 | }
42 |
43 | size_t
44 | Waitable::get_number_of_ready_services()
45 | {
46 | return 0u;
47 | }
48 |
49 | size_t
50 | Waitable::get_number_of_ready_guard_conditions()
51 | {
52 | return 0u;
53 | }
54 |
55 | bool
56 | Waitable::exchange_in_use_by_wait_set_state(bool in_use_state)
57 | {
58 | return in_use_by_wait_set_.exchange(in_use_state);
59 | }
60 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/rclcpp/src/rclcpp/logging_mutex.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__LOGGING_MUTEX_HPP_
16 | #define RCLCPP__LOGGING_MUTEX_HPP_
17 |
18 | #include
19 | #include
20 |
21 | #include "rclcpp/visibility_control.hpp"
22 |
23 | /// Global logging mutex
24 | /**
25 | * This mutex is locked in the following situations:
26 | * - In initialization/destruction of contexts.
27 | * - In initialization/destruction of nodes.
28 | * - In the rcl logging output handler installed by rclcpp,
29 | * i.e.: in all calls to the logger macros, including RCUTILS_* ones.
30 | */
31 | // Implementation detail:
32 | // A shared pointer to the mutex is used, so that objects that need to use
33 | // it at destruction time can hold it alive.
34 | // In that way, a destruction ordering problem between static objects is avoided.
35 | RCLCPP_LOCAL
36 | std::shared_ptr
37 | get_global_logging_mutex();
38 |
39 | #endif // RCLCPP__LOGGING_MUTEX_HPP_
40 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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