├── .gitignore
├── content
└── img
│ ├── rosgraph_autoware.auto.png
│ └── dotgraph_autoware.svg
├── 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
│ │ ├── nodes
│ │ ├── rclcpp
│ │ │ ├── command.hpp
│ │ │ ├── sensor.hpp
│ │ │ ├── transformer.hpp
│ │ │ ├── reactor.hpp
│ │ │ └── fusion.hpp
│ │ └── settings.hpp
│ │ ├── number_cruncher.hpp
│ │ └── sample_management.hpp
├── package.xml
└── CMakeLists.txt
├── benchmark.sh
├── autoware_reference_system
├── test
│ ├── generate_graph.sh
│ ├── test_autoware_reference_system.cpp
│ └── test_autoware_reference_system.py
├── package.xml
├── src
│ └── ros2
│ │ └── executor
│ │ ├── autoware_default_multithreaded.cpp
│ │ ├── autoware_default_singlethreaded.cpp
│ │ └── autoware_default_staticsinglethreaded.cpp
├── CMakeLists.txt
├── include
│ └── autoware_reference_system
│ │ ├── system
│ │ └── timing
│ │ │ ├── default.hpp
│ │ │ └── benchmark.hpp
│ │ └── autoware_system_builder.hpp
└── README.md
├── CONTRIBUTING.md
├── .github
└── workflows
│ └── colcon-build.yml
├── README.md
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | **__pycache__
2 |
--------------------------------------------------------------------------------
/content/img/rosgraph_autoware.auto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ApexAI/reference-system-autoware/HEAD/content/img/rosgraph_autoware.auto.png
--------------------------------------------------------------------------------
/reference_interfaces/msg/TransmissionStats.idl:
--------------------------------------------------------------------------------
1 | module reference_interfaces {
2 | module msg {
3 | module TransmissionStats_Constants {
4 | const uint64 NODE_NAME_LENGTH = 56;
5 | };
6 | struct TransmissionStats { // 64 bytes
7 | uint64 timestamp;
8 | char node_name[56];
9 | };
10 | };
11 | };
12 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/benchmark.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | BENCHMARK_DURATION_IN_SECONDS=10
4 |
5 | if ! [ -x "$(command -v psrecord)" ]; then
6 | echo psrecord is not installed, please install it with pip install -U psrecord
7 | exit 1
8 | fi
9 |
10 | # colcon build --packages-up-to reference_system
11 |
12 | for FILE in $(find build/reference_system/ -maxdepth 1 -type f -executable); do
13 | BASE_FILE=$(basename ${FILE})
14 | echo benchmarking: ${BASE_FILE}
15 | psrecord ./${FILE} --include-children --plot ${BASE_FILE}_benchmark.png --duration ${BENCHMARK_DURATION_IN_SECONDS} >/dev/null 2>/dev/null
16 | killall ${BASE_FILE}
17 | done
18 |
--------------------------------------------------------------------------------
/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/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.0.0
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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/reference_system/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | reference_system
5 | 0.0.0
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/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | autoware_reference_system
5 | 0.0.0
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_lint_auto
22 | ament_lint_common
23 | ros_testing
24 |
25 |
26 | ament_cmake
27 |
28 |
29 |
--------------------------------------------------------------------------------
/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_auto_package()
40 |
41 |
--------------------------------------------------------------------------------
/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)
--------------------------------------------------------------------------------
/reference_system/include/reference_system/system/type/rclcpp_system.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__TYPE__RCLCPP_SYSTEM_HPP_
15 | #define REFERENCE_SYSTEM__SYSTEM__TYPE__RCLCPP_SYSTEM_HPP_
16 | #include "reference_system/nodes/rclcpp/command.hpp"
17 | #include "reference_system/nodes/rclcpp/fusion.hpp"
18 | #include "reference_system/nodes/rclcpp/transformer.hpp"
19 | #include "reference_system/nodes/rclcpp/reactor.hpp"
20 | #include "reference_system/nodes/rclcpp/sensor.hpp"
21 |
22 | struct RclcppSystem
23 | {
24 | using NodeBaseType = rclcpp::Node;
25 | using Sensor = nodes::rclcpp_system::Sensor;
26 | using Command = nodes::rclcpp_system::Command;
27 | using Fusion = nodes::rclcpp_system::Fusion;
28 | using Reactor = nodes::rclcpp_system::Reactor;
29 | using Transformer = nodes::rclcpp_system::Transformer;
30 | };
31 |
32 | #endif // REFERENCE_SYSTEM__SYSTEM__TYPE__RCLCPP_SYSTEM_HPP_
33 |
--------------------------------------------------------------------------------
/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_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 | #if 0
35 | rclcpp::executors::StaticSingleThreadedExecutor executor;
36 | for (auto & node : nodes) {
37 | executor.add_node(node);
38 | }
39 | executor.spin();
40 | #endif
41 |
42 | nodes.clear();
43 | rclcpp::shutdown();
44 |
45 | return 0;
46 | }
47 |
--------------------------------------------------------------------------------
/reference_system/include/reference_system/nodes/rclcpp/command.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__NODES__RCLCPP__COMMAND_HPP_
15 | #define REFERENCE_SYSTEM__NODES__RCLCPP__COMMAND_HPP_
16 |
17 | #include
18 | #include
19 |
20 | #include "rclcpp/rclcpp.hpp"
21 | #include "reference_system/nodes/settings.hpp"
22 | #include "reference_system/sample_management.hpp"
23 | #include "reference_system/msg_types.hpp"
24 |
25 | namespace nodes
26 | {
27 | namespace rclcpp_system
28 | {
29 |
30 | class Command : public rclcpp::Node
31 | {
32 | public:
33 | explicit Command(const CommandSettings & settings)
34 | : Node(settings.node_name)
35 | {
36 | subscription_ = this->create_subscription(
37 | settings.input_topic, 10,
38 | [this](const message_t::SharedPtr msg) {input_callback(msg);});
39 | }
40 |
41 | private:
42 | void input_callback(const message_t::SharedPtr input_message) const
43 | {
44 | print_sample_path(this->get_name(), input_message);
45 | }
46 |
47 | private:
48 | rclcpp::Subscription::SharedPtr subscription_;
49 | };
50 | } // namespace rclcpp_system
51 | } // namespace nodes
52 | #endif // REFERENCE_SYSTEM__NODES__RCLCPP__COMMAND_HPP_
53 |
--------------------------------------------------------------------------------
/reference_system/include/reference_system/nodes/settings.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__NODES__SETTINGS_HPP_
15 | #define REFERENCE_SYSTEM__NODES__SETTINGS_HPP_
16 |
17 | #include
18 | #include
19 | #include
20 |
21 | namespace nodes
22 | {
23 |
24 | struct CommandSettings
25 | {
26 | std::string node_name;
27 | std::string input_topic;
28 | };
29 |
30 | struct FusionSettings
31 | {
32 | std::string node_name;
33 | std::string input_0;
34 | std::string input_1;
35 | std::string output_topic;
36 | std::chrono::nanoseconds number_crunch_time;
37 | std::chrono::nanoseconds max_input_time_difference;
38 | };
39 |
40 | struct TransformerSettings
41 | {
42 | std::string node_name;
43 | std::string input_topic;
44 | std::string output_topic;
45 | std::chrono::nanoseconds number_crunch_time;
46 | };
47 |
48 | struct ReactorSettings
49 | {
50 | std::string node_name;
51 | std::vector inputs;
52 | std::string output_topic;
53 | std::chrono::nanoseconds cycle_time;
54 | };
55 |
56 | struct SensorSettings
57 | {
58 | std::string node_name;
59 | std::string topic_name;
60 | std::chrono::nanoseconds cycle_time;
61 | };
62 | } // namespace nodes
63 | #endif // REFERENCE_SYSTEM__NODES__SETTINGS_HPP_
64 |
--------------------------------------------------------------------------------
/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 | std::vector number_cruncher(const std::chrono::nanoseconds & timeout)
22 | {
23 | // cause heavy CPU load by finding some primes
24 | std::vector primes{2};
25 | // allocate memory beforehand so that we put only load on the CPU
26 | primes.reserve(1024 * 1024);
27 | bool has_timeout_occurred = false;
28 | auto current_time = [] {
29 | return std::chrono::duration_cast(
30 | std::chrono::system_clock::now().time_since_epoch())
31 | .count();
32 | };
33 | int64_t start_time = current_time();
34 | for (uint64_t i = 3; !has_timeout_occurred; ++i) {
35 | uint64_t rootOfI = static_cast(std::sqrt(i));
36 | for (auto p : primes) {
37 | if (current_time() - start_time > timeout.count()) {
38 | has_timeout_occurred = true;
39 | }
40 | if (p > rootOfI) {
41 | primes.emplace_back(i);
42 | break;
43 | } else if (i % p == 0) {
44 | break;
45 | }
46 | }
47 | }
48 | return primes;
49 | }
50 |
51 | #endif // REFERENCE_SYSTEM__NUMBER_CRUNCHER_HPP_
52 |
--------------------------------------------------------------------------------
/reference_system/include/reference_system/nodes/rclcpp/sensor.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__NODES__RCLCPP__SENSOR_HPP_
15 | #define REFERENCE_SYSTEM__NODES__RCLCPP__SENSOR_HPP_
16 | #include
17 | #include
18 | #include
19 |
20 | #include "rclcpp/rclcpp.hpp"
21 | #include "reference_system/nodes/settings.hpp"
22 | #include "reference_system/sample_management.hpp"
23 | #include "reference_system/msg_types.hpp"
24 |
25 | namespace nodes
26 | {
27 | namespace rclcpp_system
28 | {
29 |
30 | class Sensor : public rclcpp::Node
31 | {
32 | public:
33 | explicit Sensor(const SensorSettings & settings)
34 | : Node(settings.node_name)
35 | {
36 | publisher_ = this->create_publisher(settings.topic_name, 10);
37 | timer_ = this->create_wall_timer(
38 | settings.cycle_time,
39 | [this] {timer_callback();});
40 | }
41 |
42 | private:
43 | void timer_callback()
44 | {
45 | auto message = publisher_->borrow_loaned_message();
46 | message.get().size = 0;
47 |
48 | set_sample(this->get_name(), message.get());
49 |
50 | publisher_->publish(std::move(message));
51 | }
52 |
53 | private:
54 | rclcpp::Publisher::SharedPtr publisher_;
55 | rclcpp::TimerBase::SharedPtr timer_;
56 | };
57 | } // namespace rclcpp_system
58 | } // namespace nodes
59 | #endif // REFERENCE_SYSTEM__NODES__RCLCPP__SENSOR_HPP_
60 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/reference_system/include/reference_system/nodes/rclcpp/transformer.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__NODES__RCLCPP__PROCESSING_HPP_
15 | #define REFERENCE_SYSTEM__NODES__RCLCPP__PROCESSING_HPP_
16 | #include
17 | #include
18 | #include
19 |
20 | #include "rclcpp/rclcpp.hpp"
21 | #include "reference_system/nodes/settings.hpp"
22 | #include "reference_system/number_cruncher.hpp"
23 | #include "reference_system/sample_management.hpp"
24 | #include "reference_system/msg_types.hpp"
25 |
26 | namespace nodes
27 | {
28 | namespace rclcpp_system
29 | {
30 |
31 | class Transformer : public rclcpp::Node
32 | {
33 | public:
34 | explicit Transformer(const TransformerSettings & settings)
35 | : Node(settings.node_name),
36 | number_crunch_time_(settings.number_crunch_time)
37 | {
38 | subscription_ = this->create_subscription(
39 | settings.input_topic, 10,
40 | [this](const message_t::SharedPtr msg) {input_callback(msg);});
41 | publisher_ = this->create_publisher(settings.output_topic, 10);
42 | }
43 |
44 | private:
45 | void input_callback(const message_t::SharedPtr input_message) const
46 | {
47 | auto number_cruncher_result = number_cruncher(number_crunch_time_);
48 |
49 | auto output_message = publisher_->borrow_loaned_message();
50 |
51 | fuse_samples(this->get_name(), output_message.get(), input_message);
52 |
53 | // use result so that it is not optimizied away by some clever compiler
54 | output_message.get().data[0] = number_cruncher_result.empty();
55 | publisher_->publish(std::move(output_message));
56 | }
57 |
58 | private:
59 | rclcpp::Publisher::SharedPtr publisher_;
60 | rclcpp::Subscription::SharedPtr subscription_;
61 | std::chrono::nanoseconds number_crunch_time_;
62 | };
63 | } // namespace rclcpp_system
64 | } // namespace nodes
65 | #endif // REFERENCE_SYSTEM__NODES__RCLCPP__PROCESSING_HPP_
66 |
--------------------------------------------------------------------------------
/autoware_reference_system/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.5)
2 | project(autoware_reference_system)
3 |
4 | if(NOT CMAKE_CXX_STANDARD)
5 | set(CMAKE_CXX_STANDARD 17)
6 | endif()
7 |
8 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
9 | add_compile_options(-Wall -Wextra -Wpedantic)
10 | endif()
11 |
12 | find_package(ament_cmake_auto REQUIRED)
13 | ament_auto_find_build_dependencies()
14 |
15 | # find_package(reference_system REQUIRED)
16 |
17 | # Single Threaded Executor
18 | ament_auto_add_executable(autoware_default_singlethreaded
19 | src/ros2/executor/autoware_default_singlethreaded.cpp
20 | )
21 |
22 | # Static Single Threaded Executor
23 | ament_auto_add_executable(autoware_default_staticsinglethreaded
24 | src/ros2/executor/autoware_default_staticsinglethreaded.cpp
25 | )
26 |
27 | # Multi Threaded Executor
28 | ament_auto_add_executable(autoware_default_multithreaded
29 | src/ros2/executor/autoware_default_multithreaded.cpp
30 | )
31 |
32 | # Add new executors to test here
33 | #ament_auto_add_executable(autoware_default_custom
34 | # src/ros2/executor/autoware_default_custom.cpp
35 | #)
36 |
37 | if(${BUILD_TESTING})
38 | find_package(ament_lint_auto REQUIRED)
39 | ament_lint_auto_find_test_dependencies()
40 |
41 | find_package(ros_testing REQUIRED)
42 |
43 | # run target for n seconds
44 | function(test_reference_system_autoware target timeout)
45 | set(TEST_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/${target})
46 | set(TEST_EXECUTABLE_NAME ${target}_${rmw_implementation})
47 | set(TIMEOUT ${timeout})
48 | set(RMW_IMPLEMENTATION ${rmw_implementation})
49 |
50 | # replaces all @var@ and ${var} within input file
51 | configure_file(
52 | test/test_${PROJECT_NAME}.py
53 | test_${target}_${rmw_implementation}.py
54 | @ONLY
55 | )
56 |
57 | add_ros_test(
58 | ${CMAKE_CURRENT_BINARY_DIR}/test_${target}_${rmw_implementation}.py
59 | TIMEOUT 10 # seconds
60 | )
61 |
62 | if(TARGET ${target})
63 | ament_target_dependencies(${target}
64 | "rclcpp" "reference_interfaces" "reference_system")
65 | endif()
66 | endfunction()
67 |
68 | # get available rmw implementations
69 | find_package(rmw_implementation_cmake REQUIRED)
70 | get_available_rmw_implementations(rmws_available)
71 |
72 | # loop over each rmw implmentation
73 | foreach(rmw_implementation ${rmws_available})
74 | find_package("${rmw_implementation}" REQUIRED)
75 |
76 | # add each exe to test
77 | test_reference_system_autoware(autoware_default_singlethreaded 10)
78 | test_reference_system_autoware(autoware_default_staticsinglethreaded 10)
79 | test_reference_system_autoware(autoware_default_multithreaded 10)
80 | # Add new exe's here to test
81 | #test_reference_system_autoware(autoware_default_custom)
82 |
83 | endforeach()
84 | endif()
85 |
86 | ament_auto_package(
87 | INSTALL_TO_SHARE test
88 | )
89 |
--------------------------------------------------------------------------------
/reference_system/include/reference_system/nodes/rclcpp/reactor.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__NODES__RCLCPP__REACTOR_HPP_
15 | #define REFERENCE_SYSTEM__NODES__RCLCPP__REACTOR_HPP_
16 | #include
17 | #include
18 | #include
19 | #include
20 |
21 | #include "rclcpp/rclcpp.hpp"
22 | #include "reference_system/nodes/settings.hpp"
23 | #include "reference_system/sample_management.hpp"
24 | #include "reference_system/msg_types.hpp"
25 |
26 | namespace nodes
27 | {
28 | namespace rclcpp_system
29 | {
30 |
31 | class Reactor : public rclcpp::Node
32 | {
33 | public:
34 | explicit Reactor(const ReactorSettings & settings)
35 | : Node(settings.node_name)
36 | {
37 | uint64_t input_number = 0U;
38 | for (const auto & input_topic : settings.inputs) {
39 | subscriptions_.emplace_back(
40 | this->create_subscription(
41 | input_topic, 10,
42 | [this, input_number](const message_t::SharedPtr msg) {
43 | input_callback(input_number, msg);
44 | }));
45 | ++input_number;
46 | }
47 | message_cache_.resize(subscriptions_.size());
48 | publisher_ = this->create_publisher(settings.output_topic, 10);
49 | timer_ = this->create_wall_timer(
50 | settings.cycle_time,
51 | [this]{timer_callback();});
52 | }
53 |
54 | private:
55 | void input_callback(
56 | const uint64_t input_number,
57 | const message_t::SharedPtr input_message)
58 | {
59 | message_cache_[input_number] = input_message;
60 | }
61 |
62 | void timer_callback() {
63 | uint64_t sent_samples = 0;
64 | for(auto & m : message_cache_) {
65 | if ( !m ) continue;
66 |
67 | auto output_message = publisher_->borrow_loaned_message();
68 |
69 | fuse_samples(this->get_name(), output_message.get(), m);
70 |
71 | publisher_->publish(std::move(output_message));
72 | m.reset();
73 | ++sent_samples;
74 | }
75 |
76 | if ( sent_samples == 0 ) {
77 | auto message = publisher_->borrow_loaned_message();
78 | message.get().size = 0;
79 |
80 | set_sample(this->get_name(), message.get());
81 |
82 | publisher_->publish(std::move(message));
83 | }
84 | }
85 |
86 | private:
87 | rclcpp::Publisher::SharedPtr publisher_;
88 | rclcpp::TimerBase::SharedPtr timer_;
89 | std::vector::SharedPtr> subscriptions_;
90 | std::vector message_cache_;
91 | };
92 | } // namespace rclcpp_system
93 | } // namespace nodes
94 | #endif // REFERENCE_SYSTEM__NODES__RCLCPP__REACTOR_HPP_
95 |
--------------------------------------------------------------------------------
/reference_system/include/reference_system/nodes/rclcpp/fusion.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__NODES__RCLCPP__FUSION_HPP_
15 | #define REFERENCE_SYSTEM__NODES__RCLCPP__FUSION_HPP_
16 | #include
17 | #include
18 | #include
19 |
20 | #include "rclcpp/rclcpp.hpp"
21 | #include "reference_system/nodes/settings.hpp"
22 | #include "reference_system/number_cruncher.hpp"
23 | #include "reference_system/sample_management.hpp"
24 | #include "reference_system/msg_types.hpp"
25 |
26 | namespace nodes
27 | {
28 | namespace rclcpp_system
29 | {
30 |
31 | class Fusion : public rclcpp::Node
32 | {
33 | public:
34 | explicit Fusion(const FusionSettings & settings)
35 | : Node(settings.node_name),
36 | number_crunch_time_(settings.number_crunch_time),
37 | max_input_time_difference_(settings.max_input_time_difference)
38 | {
39 | subscription_[0] = this->create_subscription(
40 | settings.input_0, 10,
41 | [this](const message_t::SharedPtr msg) {input_callback(0U, msg);});
42 |
43 | subscription_[1] = this->create_subscription(
44 | settings.input_1, 10,
45 | [this](const message_t::SharedPtr msg) {input_callback(1U, msg);});
46 | publisher_ = this->create_publisher(settings.output_topic, 10);
47 | }
48 |
49 | private:
50 | void input_callback(
51 | const uint64_t input_number,
52 | const message_t::SharedPtr input_message)
53 | {
54 | message_cache_[input_number] = input_message;
55 |
56 | // only process and publish when we can perform an actual fusion, this means
57 | // we have received a sample from each subscription
58 | if (!message_cache_[0] || !message_cache_[1]) {
59 | return;
60 | }
61 |
62 | uint64_t timestamp_input0 = get_sample_timestamp(message_cache_[0]);
63 | uint64_t timestamp_input1 = get_sample_timestamp(message_cache_[1]);
64 | int64_t time_diff = (timestamp_input0 < timestamp_input1)
65 | ? timestamp_input1 - timestamp_input0
66 | : timestamp_input0 - timestamp_input1;
67 |
68 | if ( time_diff >= max_input_time_difference_.count()) {
69 | std::cerr << "[ Warning ] " << this->get_name() << " : input latency exceeded from "
70 | << "{" << subscription_[0]->get_topic_name() << ", "
71 | << subscription_[1]->get_topic_name() << "} " << std::endl;
72 | exit(0);
73 | }
74 |
75 | auto number_cruncher_result = number_cruncher(number_crunch_time_);
76 |
77 | auto output_message = publisher_->borrow_loaned_message();
78 | fuse_samples(
79 | this->get_name(), output_message.get(), message_cache_[0],
80 | message_cache_[1]);
81 | output_message.get().data[0] = number_cruncher_result.empty();
82 | publisher_->publish(std::move(output_message));
83 |
84 | message_cache_[0].reset();
85 | message_cache_[1].reset();
86 | }
87 |
88 | private:
89 | message_t::SharedPtr message_cache_[2];
90 | rclcpp::Publisher::SharedPtr publisher_;
91 | rclcpp::Subscription::SharedPtr subscription_[2];
92 |
93 | std::chrono::nanoseconds number_crunch_time_;
94 | std::chrono::nanoseconds max_input_time_difference_;
95 | };
96 | } // namespace rclcpp_system
97 | } // namespace nodes
98 | #endif // REFERENCE_SYSTEM__NODES__RCLCPP__FUSION_HPP_
99 |
--------------------------------------------------------------------------------
/autoware_reference_system/include/autoware_reference_system/system/timing/default.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 AUTOWARE_REFERENCE_SYSTEM__SYSTEM__TIMING__DEFAULT_HPP_
15 | #define AUTOWARE_REFERENCE_SYSTEM__SYSTEM__TIMING__DEFAULT_HPP_
16 | #include
17 |
18 | namespace nodes
19 | {
20 | namespace timing
21 | {
22 |
23 | struct Default
24 | {
25 | using time_t = std::chrono::nanoseconds;
26 | using milliseconds = std::chrono::milliseconds;
27 |
28 | // sensors
29 | static constexpr time_t FRONT_LIDAR_DRIVER = milliseconds(100);
30 | static constexpr time_t REAR_LIDAR_DRIVER = milliseconds(100);
31 | static constexpr time_t POINT_CLOUD_MAP = milliseconds(100);
32 | static constexpr time_t RVIZ2 = milliseconds(100);
33 | static constexpr time_t LANELET2MAP = milliseconds(100);
34 |
35 | // processing
36 | static constexpr time_t POINTS_TRANSFORMER_FRONT = milliseconds(50);
37 | static constexpr time_t POINTS_TRANSFORMER_REAR = milliseconds(50);
38 | static constexpr time_t VOXEL_GRID_DOWNSAMPLER = milliseconds(50);
39 | static constexpr time_t POINT_CLOUD_MAP_LOADER = milliseconds(50);
40 | static constexpr time_t RAY_GROUND_FILTER = milliseconds(50);
41 | static constexpr time_t EUCLIDEAN_CLUSTER_DETECTOR = milliseconds(50);
42 | static constexpr time_t OBJECT_COLLISION_ESTIMATOR = milliseconds(50);
43 | static constexpr time_t MPC_CONTROLLER = milliseconds(50);
44 | static constexpr time_t PARKING_PLANNER = milliseconds(50);
45 | static constexpr time_t LANE_PLANNER = milliseconds(50);
46 |
47 | // fusion
48 | static constexpr time_t POINT_CLOUD_FUSION = milliseconds(25);
49 | static constexpr time_t NDT_LOCALIZER = milliseconds(25);
50 | static constexpr time_t VEHICLE_INTERFACE = milliseconds(25);
51 | static constexpr time_t LANELET_2_GLOBAL_PLANNER = milliseconds(25);
52 | static constexpr time_t LANELET_2_MAP_LOADER = milliseconds(25);
53 |
54 | static constexpr time_t POINT_CLOUD_FUSION_MAX_INPUT_TIME_DIFF = milliseconds(125);
55 | static constexpr time_t NDT_LOCALIZER_MAX_INPUT_TIME_DIFF = milliseconds(125);
56 | static constexpr time_t VEHICLE_INTERFACE_MAX_INPUT_TIME_DIFF = milliseconds(125);
57 | static constexpr time_t LANELET_2_GLOBAL_PLANNER_MAX_INPUT_TIME_DIFF = milliseconds(125);
58 | static constexpr time_t LANELET_2_MAP_LOADER_MAX_INPUT_TIME_DIFF = milliseconds(125);
59 |
60 | // reactor
61 | static constexpr time_t BEHAVIOR_PLANNER = milliseconds(50);
62 | };
63 |
64 | constexpr Default::time_t Default::FRONT_LIDAR_DRIVER;
65 | constexpr Default::time_t Default::REAR_LIDAR_DRIVER;
66 | constexpr Default::time_t Default::POINT_CLOUD_MAP;
67 | constexpr Default::time_t Default::RVIZ2;
68 | constexpr Default::time_t Default::LANELET2MAP;
69 | constexpr Default::time_t Default::POINTS_TRANSFORMER_FRONT;
70 | constexpr Default::time_t Default::POINTS_TRANSFORMER_REAR;
71 | constexpr Default::time_t Default::VOXEL_GRID_DOWNSAMPLER;
72 | constexpr Default::time_t Default::POINT_CLOUD_MAP_LOADER;
73 | constexpr Default::time_t Default::RAY_GROUND_FILTER;
74 | constexpr Default::time_t Default::EUCLIDEAN_CLUSTER_DETECTOR;
75 | constexpr Default::time_t Default::OBJECT_COLLISION_ESTIMATOR;
76 | constexpr Default::time_t Default::MPC_CONTROLLER;
77 | constexpr Default::time_t Default::PARKING_PLANNER;
78 | constexpr Default::time_t Default::LANE_PLANNER;
79 | constexpr Default::time_t Default::POINT_CLOUD_FUSION;
80 | constexpr Default::time_t Default::NDT_LOCALIZER;
81 | constexpr Default::time_t Default::VEHICLE_INTERFACE;
82 | constexpr Default::time_t Default::LANELET_2_GLOBAL_PLANNER;
83 | constexpr Default::time_t Default::LANELET_2_MAP_LOADER;
84 | constexpr Default::time_t Default::POINT_CLOUD_FUSION_MAX_INPUT_TIME_DIFF;
85 | constexpr Default::time_t Default::NDT_LOCALIZER_MAX_INPUT_TIME_DIFF;
86 | constexpr Default::time_t Default::VEHICLE_INTERFACE_MAX_INPUT_TIME_DIFF;
87 | constexpr Default::time_t Default::LANELET_2_GLOBAL_PLANNER_MAX_INPUT_TIME_DIFF;
88 | constexpr Default::time_t Default::LANELET_2_MAP_LOADER_MAX_INPUT_TIME_DIFF;
89 | constexpr Default::time_t Default::BEHAVIOR_PLANNER;
90 |
91 | } // namespace timing
92 | } // namespace nodes
93 | #endif // AUTOWARE_REFERENCE_SYSTEM__SYSTEM__TIMING__DEFAULT_HPP_
94 |
--------------------------------------------------------------------------------
/reference_system/include/reference_system/sample_management.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__SAMPLE_MANAGEMENT_HPP_
15 | #define REFERENCE_SYSTEM__SAMPLE_MANAGEMENT_HPP_
16 | #include
17 | #include
18 | #include