Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add autoware_node and autoware_control_center #73

Closed
wants to merge 131 commits into from
Closed
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
942930a
feat: add autoware_node and autoware_control_center
Feb 3, 2023
1a4f640
fix case
Feb 3, 2023
fd9981e
mark explicit
Feb 3, 2023
4d7a2a9
simple service call
Mar 15, 2023
d67b55d
style(pre-commit): autofix
pre-commit-ci[bot] Mar 15, 2023
4a695cf
add heartbeat and uuid
Sep 10, 2023
692641d
style(pre-commit): autofix
pre-commit-ci[bot] Sep 10, 2023
02350b8
add node registry template
Sep 10, 2023
4457c90
style(pre-commit): autofix
pre-commit-ci[bot] Sep 10, 2023
0089d7f
feat(autoware_control_center): update register_node, add unregister_node
lexavtanke Dec 13, 2023
55e7ebc
feat(autoware_control_center): add test for register/unregister requests
lexavtanke Dec 15, 2023
01afc38
feat(autoware_control_center): rename unregister to deregister
lexavtanke Dec 25, 2023
abcec4a
feat(autoware_node): add register_callback, timer disable after register
lexavtanke Dec 27, 2023
ea61deb
feat(autoware_node): add deregister service
lexavtanke Dec 28, 2023
276ba5b
feat(autoware_control_center): add is_empty method to node_registry
lexavtanke Jan 5, 2024
83a50ae
feat(autoware_control_center): add startup timer with delay and dereg…
lexavtanke Jan 10, 2024
dd23e23
feat(autoware_node): add launch file for testing with multiple nodes
lexavtanke Jan 10, 2024
8fbecb3
feat(autoware_node): add heartbeat publishing
lexavtanke Jan 11, 2024
1547ffb
style(pre-commit): autofix
pre-commit-ci[bot] Jan 15, 2024
4dd205a
feat(autoware_control_center): add heartbeat sub, doesn't work with n…
lexavtanke Jan 16, 2024
76e1c93
style(pre-commit): autofix
pre-commit-ci[bot] Jan 16, 2024
42577fd
feat(autoware_node): add namespace support
lexavtanke Jan 23, 2024
7218c00
feat(autoware_control_center_msgs): Add AutowareNodeReport and Autowa…
lexavtanke Jan 23, 2024
89271bd
feat(autoware_control_center): add autoware_node_reports publishing
lexavtanke Jan 23, 2024
62af543
style(pre-commit): autofix
pre-commit-ci[bot] Jan 23, 2024
48e2d4c
fix(autoware_control_center): fix double deregister srv call
lexavtanke Jan 25, 2024
162a651
style(pre-commit): autofix
pre-commit-ci[bot] Jan 25, 2024
80155fb
feat(autoware_control_center_msgs): rename StatusRegistration to Stat…
lexavtanke Jan 29, 2024
a6c7fab
feat(autoware_control_center_msgs): add AutowareNodeState msg and Aut…
lexavtanke Jan 29, 2024
77f2ead
feat(autoware_control_center): implement AutowareNodeError srv in ACC
lexavtanke Jan 29, 2024
2c89335
style(pre-commit): autofix
pre-commit-ci[bot] Jan 29, 2024
27201e9
feat(autoware_node): add AutowareNodeError client
lexavtanke Feb 5, 2024
fe92f7e
fix(autoware_node): fix autoware_node deregister respond
lexavtanke Feb 5, 2024
721b8e2
style(pre-commit): autofix
pre-commit-ci[bot] Feb 5, 2024
ffaa74a
feat(autoware_node): add create_monitored_subscription, build, produc…
lexavtanke Feb 12, 2024
b2de989
feat(autoware_node): fix runtime error with monitored subscription
lexavtanke Feb 13, 2024
1ff6a01
feat(test_node): add test_publisher with proper qos param
lexavtanke Feb 13, 2024
74edf54
feat(autoware_control_center): update startup callback
lexavtanke Feb 13, 2024
ea0e8e2
style(pre-commit): autofix
pre-commit-ci[bot] Feb 13, 2024
fbe977f
feat(autoware_control_center): remove tier4_autoware_utils dependency
lexavtanke Feb 16, 2024
2fd28c0
feat(autoware_node): remove tier4_autoware_utils dependency
lexavtanke Feb 16, 2024
877544a
style(pre-commit): autofix
pre-commit-ci[bot] Feb 16, 2024
695c256
feat(test_node): remove autowar
lexavtanke Feb 18, 2024
8948da5
feat(autoware_node): fix ci check errors
lexavtanke Feb 18, 2024
cde1362
feat(test_node): fix ci check errors
lexavtanke Feb 18, 2024
dfe82e2
style(pre-commit): autofix
pre-commit-ci[bot] Feb 18, 2024
c383825
fix(autoware_control_center): fix cspell errors
lexavtanke Feb 18, 2024
d97942f
fix test_pub cmakelists
Feb 22, 2024
f977cf8
feat(autoware_control_center_msgs): add new fields to AutowareNodeReport
lexavtanke Feb 29, 2024
5e96d5b
feat(autoware_control_center): add manage relaunch of registered node…
lexavtanke Feb 29, 2024
85058c7
feat(autoware_node): add send normal state after registration
lexavtanke Feb 29, 2024
dbf66d3
style(pre-commit): autofix
pre-commit-ci[bot] Feb 29, 2024
66736fa
feat(autoware_control_center): add test cases to ACC and node_registry
lexavtanke Mar 11, 2024
e0e9a5b
style(pre-commit): autofix
pre-commit-ci[bot] Mar 11, 2024
21cf431
 feat(autoware_contorl_center): add README
lexavtanke Mar 12, 2024
5886294
style(pre-commit): autofix
pre-commit-ci[bot] Mar 12, 2024
3c84ee1
feat(autoware_control_center): update README
lexavtanke Mar 12, 2024
c9b643d
style(pre-commit): autofix
pre-commit-ci[bot] Mar 12, 2024
35d96f9
feat(autoware_node): update README
lexavtanke Mar 14, 2024
ecf6e7c
style(pre-commit): autofix
pre-commit-ci[bot] Mar 14, 2024
1745e06
fix(autoware_node): fix spell-check errors
lexavtanke Mar 14, 2024
d16e74b
style(pre-commit): autofix
pre-commit-ci[bot] Mar 14, 2024
ec21dbb
fix(autoware_node): fix spell-check error
lexavtanke Mar 14, 2024
e3e8220
feat(autoware_control_center): clean up CMakeLists
lexavtanke Mar 18, 2024
2593013
feat(test_node): clean up CMakeLists
lexavtanke Mar 18, 2024
f20393b
feat(autoware_node): clean up source
lexavtanke Mar 18, 2024
d7bb9f0
fix(autoware_control_center): fix uncrustiry errors
lexavtanke Mar 20, 2024
12cac57
fix(autoware_node): fix uncrustify errors
lexavtanke Mar 20, 2024
c43d40a
fix(test_node): fix uncrustify errors
lexavtanke Mar 20, 2024
c73913e
style(pre-commit): autofix
pre-commit-ci[bot] Mar 20, 2024
8ec287d
feat(autoware_node): improve readabilty
lexavtanke Mar 22, 2024
406cbdb
style(pre-commit): autofix
pre-commit-ci[bot] Mar 25, 2024
6c007a3
fix(autoware_node): fix typo
lexavtanke Mar 25, 2024
5c03cbb
feat(autoware_control_center): improve readability, define callbacks …
lexavtanke Mar 25, 2024
529c29e
feat(autoware_control_center): move node_status_map_ insert to regist…
lexavtanke Mar 25, 2024
7895ade
feat(autoware_control_center):  separate filter_deregister_services f…
lexavtanke Mar 25, 2024
5ab56d1
style(pre-commit): autofix
pre-commit-ci[bot] Mar 25, 2024
77b0c56
feat(autoware_control_center): update and parameterize startup_callba…
lexavtanke Mar 27, 2024
a2e8ce1
style(pre-commit): autofix
pre-commit-ci[bot] Mar 27, 2024
248f53a
fix(autoware_control_center): fix cpplint errors
lexavtanke Mar 27, 2024
26ac0bc
feat(autoware_control_center): update README
lexavtanke Mar 27, 2024
65303a7
refactor(autoware_control_center): remove unused dependencies, add p…
lexavtanke Mar 27, 2024
06ac84b
refactor(autoware_node): remove unused dependency, add package descri…
lexavtanke Mar 27, 2024
8646daf
refactor(autoware_node): perameterize register timer period, use SUCC…
lexavtanke Mar 27, 2024
9cfeb2c
style(pre-commit): autofix
pre-commit-ci[bot] Mar 27, 2024
0a28619
refactor(test_node): remove unused dependecy, add package description
lexavtanke Mar 28, 2024
f94e875
refactor(autoware_node): use SUCCESS from Status.msg
lexavtanke Mar 28, 2024
6334bf7
refactor(autoware_control_center): use SUCCESS from Status.msg
lexavtanke Mar 28, 2024
72413c2
refactor(autoware_control_center):rremove cspell exception
lexavtanke Mar 28, 2024
6906458
doc(autoware_control_center): add doxygen commets
lexavtanke Mar 29, 2024
d53e4c2
style(pre-commit): autofix
pre-commit-ci[bot] Mar 29, 2024
76ceb9d
fix(autoware_control_center): fix spell-check errors
lexavtanke Mar 29, 2024
689b0e3
docs(autoware_node): add doxygen comments
lexavtanke Mar 29, 2024
1c1e0be
style(pre-commit): autofix
pre-commit-ci[bot] Mar 29, 2024
e7eb03e
fix(autoware_node): fix spell-check error
lexavtanke Mar 29, 2024
dd20e6f
refactor(autoware_control_center):add const, use assignment  to varia…
lexavtanke Apr 2, 2024
0688a96
docs(autoware_control_center): add parameters explanation
lexavtanke Apr 2, 2024
04fa515
style(autoware_control_center, autoware_node, test_node): update year
lexavtanke Apr 2, 2024
b9d32c0
refactor(autoware_node): move aliases to header file
lexavtanke Apr 2, 2024
da888b0
refactor(autoware_node): add const, remove unnecessary vars
lexavtanke Apr 2, 2024
b5c5be6
style(pre-commit): autofix
pre-commit-ci[bot] Apr 2, 2024
c2e582e
registrate -> register
Apr 15, 2024
de50f2a
fix lint deps
Apr 15, 2024
db4e729
spelling ROS 2
Apr 15, 2024
3203c3a
remove unused aliases
Apr 15, 2024
e4f5fca
small spelling fixes
Apr 15, 2024
4613318
fix(autoware_control_center): fix clang-tidy warnings
lexavtanke Apr 17, 2024
fea1486
fix(autoware_control_center): fix clang-tidy warnings
lexavtanke Apr 17, 2024
a2a1508
fix(autoware_node, test_node): fix clang-tidy warnings
lexavtanke Apr 17, 2024
d834855
style(pre-commit): autofix
pre-commit-ci[bot] Apr 17, 2024
1d9eddf
fix clang-tidy warnings
lexavtanke Apr 17, 2024
16e99b9
style(pre-commit): autofix
pre-commit-ci[bot] Apr 17, 2024
c5161fd
fix(autoware_control_center): fix clang-tidy warnings
lexavtanke Apr 18, 2024
cfabbab
style(pre-commit): autofix
pre-commit-ci[bot] Apr 18, 2024
f07be46
supress clang-tidy performance warn on async_send_request
lexavtanke Apr 19, 2024
0e6d5ec
refactor(autoware_control_center): change startup procedure, remove t…
lexavtanke Apr 21, 2024
5b4d994
refactor, change log level to debug
lexavtanke Apr 21, 2024
e684b54
style(pre-commit): autofix
pre-commit-ci[bot] Apr 21, 2024
a7edbab
test clang-analyzer prefix for no lint
Apr 22, 2024
3641b52
empty nolint for now
Apr 22, 2024
3d6ff2e
add todo
Apr 22, 2024
9879f58
update namespaces, service/topic names
May 16, 2024
6a48e28
style(pre-commit): autofix
pre-commit-ci[bot] May 16, 2024
63a87b4
memory
May 16, 2024
da9470c
add launch
May 16, 2024
9da94d9
single instance, readme
May 17, 2024
588a1d3
style(pre-commit): autofix
pre-commit-ci[bot] May 17, 2024
8d2db52
refactor autoware_node
May 17, 2024
ed2efdb
style(pre-commit): autofix
pre-commit-ci[bot] May 17, 2024
343cbc5
refactor all
May 17, 2024
54d92cb
style(pre-commit): autofix
pre-commit-ci[bot] May 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions common/autoware_control_center/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
cmake_minimum_required(VERSION 3.8)
project(autoware_control_center)

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

autoware_package()

ament_auto_add_executable(${PROJECT_NAME} src/autoware_control_center_node.cpp
src/autoware_control_center.cpp
src/node_registry.cpp)
#target_link_libraries(${PROJECT_NAME})
mitsudome-r marked this conversation as resolved.
Show resolved Hide resolved

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
find_package(rclcpp REQUIRED)
find_package(autoware_utils REQUIRED)
ament_lint_auto_find_test_dependencies()
ament_add_gtest(test_autoware_control_center
test/test_autoware_control_center.cpp
test/test_node_registry.cpp
src/autoware_control_center.cpp
src/node_registry.cpp)
target_include_directories(test_autoware_control_center PRIVATE ${PROJECT_SOURCE_DIR}/include)
ament_target_dependencies(test_autoware_control_center
"rclcpp"
"autoware_utils"
"rclcpp_lifecycle"
"autoware_control_center_msgs")
endif()

ament_auto_package()
xmfcx marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Copyright 2022 The Autoware Contributors
xmfcx marked this conversation as resolved.
Show resolved Hide resolved
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef AUTOWARE_CONTROL_CENTER__AUTOWARE_CONTROL_CENTER_HPP_
#define AUTOWARE_CONTROL_CENTER__AUTOWARE_CONTROL_CENTER_HPP_

#include "autoware_control_center/node_registry.hpp"
#include "autoware_control_center/visibility_control.hpp"
#include "rclcpp_lifecycle/lifecycle_node.hpp"

#include "autoware_control_center_msgs/msg/autoware_node_reports.hpp"
#include "autoware_control_center_msgs/msg/heartbeat.hpp"
#include "autoware_control_center_msgs/srv/autoware_node_deregister.hpp"
#include "autoware_control_center_msgs/srv/autoware_node_error.hpp"
#include "autoware_control_center_msgs/srv/autoware_node_register.hpp"

#include <string>
#include <unordered_map>

namespace autoware_control_center
{

enum class HealthState { Unknown = 0, Healthy = 1, Warning = 2, Error = 3 };

struct AutowareNodeStatus
{
bool alive;
rclcpp::Time last_heartbeat;
std::string node_report;
autoware_control_center_msgs::msg::AutowareNodeState state;
};

class AutowareControlCenter : public rclcpp_lifecycle::LifecycleNode
xmfcx marked this conversation as resolved.
Show resolved Hide resolved
{
public:
explicit AutowareControlCenter(const rclcpp::NodeOptions & options);

private:
rclcpp::CallbackGroup::SharedPtr callback_group_mut_ex_;

rclcpp::Service<autoware_control_center_msgs::srv::AutowareNodeRegister>::SharedPtr srv_register_;
rclcpp::Service<autoware_control_center_msgs::srv::AutowareNodeDeregister>::SharedPtr
srv_deregister_;
rclcpp::Service<autoware_control_center_msgs::srv::AutowareNodeError>::SharedPtr srv_node_error_;
rclcpp::Publisher<autoware_control_center_msgs::msg::AutowareNodeReports>::SharedPtr
node_reports_pub_;
NodeRegistry node_registry_;
std::unordered_map<
std::string, rclcpp::Subscription<autoware_control_center_msgs::msg::Heartbeat>::SharedPtr>
heartbeat_sub_map_;
std::unordered_map<std::string, AutowareNodeStatus> node_status_map_;

rclcpp::TimerBase::SharedPtr startup_timer_;
rclcpp::TimerBase::SharedPtr node_reports_timer_;
int countdown;
unique_identifier_msgs::msg::UUID acc_uuid;
/// The lease duration granted to the remote (heartbeat) publisher
std::chrono::milliseconds lease_duration_;
bool startup;

void register_node(
const autoware_control_center_msgs::srv::AutowareNodeRegister::Request::SharedPtr request,
const autoware_control_center_msgs::srv::AutowareNodeRegister::Response::SharedPtr response);

void deregister_node(
const autoware_control_center_msgs::srv::AutowareNodeDeregister::Request::SharedPtr request,
const autoware_control_center_msgs::srv::AutowareNodeDeregister::Response::SharedPtr response);

void autoware_node_error(
const autoware_control_center_msgs::srv::AutowareNodeError::Request::SharedPtr request,
const autoware_control_center_msgs::srv::AutowareNodeError::Response::SharedPtr response);

void startup_callback();

rclcpp::Subscription<autoware_control_center_msgs::msg::Heartbeat>::SharedPtr
create_heartbeat_sub(const std::string & node_name);

void node_reports_callback();
};

} // namespace autoware_control_center

#endif // AUTOWARE_CONTROL_CENTER__AUTOWARE_CONTROL_CENTER_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright 2022 The Autoware Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef AUTOWARE_CONTROL_CENTER__NODE_REGISTRY_HPP_
#define AUTOWARE_CONTROL_CENTER__NODE_REGISTRY_HPP_

#include <rclcpp/rclcpp.hpp>

#include <unique_identifier_msgs/msg/uuid.hpp>

#include <optional>
#include <string>
#include <unordered_map>

namespace autoware_control_center
{
struct AutowareNodeInfo
{
rclcpp::Time time_registering;
std::string name;
unique_identifier_msgs::msg::UUID uuid;
int num_registered;
};

class NodeRegistry
{
public:
NodeRegistry() = default;

std::optional<unique_identifier_msgs::msg::UUID> register_node(
const std::string & name, const unique_identifier_msgs::msg::UUID & uuid);

std::optional<unique_identifier_msgs::msg::UUID> deregister_node(const std::string & name);

bool is_registered(const std::string & name) const;

std::optional<unique_identifier_msgs::msg::UUID> get_uuid(const std::string & name) const;

bool is_empty();

private:
std::unordered_map<std::string, AutowareNodeInfo> autoware_node_info_map_;
};
} // namespace autoware_control_center

#endif // AUTOWARE_CONTROL_CENTER__NODE_REGISTRY_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2022 The Autoware Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef AUTOWARE_CONTROL_CENTER__VISIBILITY_CONTROL_HPP_
#define AUTOWARE_CONTROL_CENTER__VISIBILITY_CONTROL_HPP_

#include "rcutils/visibility_control_macros.h"

#ifdef AUTOWARE_CONTROL_CENTER_BUILDING_DLL
#define AUTOWARE_CONTROL_CENTER_PUBLIC RCUTILS_EXPORT
#else
#define AUTOWARE_CONTROL_CENTER_PUBLIC RCUTILS_IMPORT
#endif // !AUTOWARE_CONTROL_CENTER_BUILDING_DLL
#define AUTOWARE_CONTROL_CENTER_LOCAL RCUTILS_LOCAL

#endif // AUTOWARE_CONTROL_CENTER__VISIBILITY_CONTROL_HPP_
33 changes: 33 additions & 0 deletions common/autoware_control_center/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>autoware_control_center</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="[email protected]">M. Fatih Cırıt</maintainer>
<license>Apache-2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>autoware_control_center_msgs</depend>
<depend>autoware_utils</depend>
<depend>bond</depend>
<depend>bondcpp</depend>
<depend>lifecycle_msgs</depend>
<depend>nlohmann-json-dev</depend>
xmfcx marked this conversation as resolved.
Show resolved Hide resolved
<depend>rclcpp_components</depend>
<depend>rclcpp_lifecycle</depend>
<depend>rcutils</depend>
<!-- cspell:ignore bondcpp -->
xmfcx marked this conversation as resolved.
Show resolved Hide resolved

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>rclcpp</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
Loading
Loading