Skip to content

Commit

Permalink
feat: add node base
Browse files Browse the repository at this point in the history
Signed-off-by: TetsuKawa <[email protected]>
  • Loading branch information
TetsuKawa committed Jan 7, 2025
1 parent ed77394 commit 650448f
Show file tree
Hide file tree
Showing 8 changed files with 156 additions and 0 deletions.
20 changes: 20 additions & 0 deletions system/autoware_topic_rely_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.14)
project(autoware_topic_rely_controller)

find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_library(${PROJECT_NAME} SHARED
src/topic_rely_controller_node.cpp
)

rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "autoware::topic_rely_controller::TopicRelyController"
EXECUTABLE ${PROJECT_NAME}_node
EXECUTOR MultiThreadedExecutor
)

ament_auto_package(INSTALL_TO_SHARE
launch
config
)
15 changes: 15 additions & 0 deletions system/autoware_topic_rely_controller/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# topic_rely_controller

## Purpose

## Inputs / Outputs

### Input

### Output

## Parameters

## Assumptions / Known limits

TBD.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
/**:
ros__parameters:
tmp: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<launch>
<arg name="config_file" default="$(find-pkg-share autoware_topic_rely_controller)/config/topic_rely_controller.param.yaml"/>

<node pkg="autoware_topic_rely_controller" exec="autoware_topic_rely_controller_node" name="topic_rely_controller" output="screen">
<param from="$(var config_file)"/>
</node>
</launch>
22 changes: 22 additions & 0 deletions system/autoware_topic_rely_controller/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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_topic_rely_controller</name>
<version>0.1.0</version>
<description>The topic_rely_controller ROS 2 package</description>
<maintainer email="[email protected]">Tetsuhiro Kawaguchi</maintainer>
<license>Apache License 2.0</license>

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

<depend>rclcpp</depend>
<depend>rclcpp_components</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for topic rely controller",
"type": "object",
"definitions": {
"topic_rely_controller": {
"type": "object",
"properties": {
},
"required": [
],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/topic_rely_controller"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2025 TIER IV, Inc.
//
// 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.

#include "topic_rely_controller_node.hpp"

namespace autoware::topic_rely_controller
{
TopicRelyController::TopicRelyController(const rclcpp::NodeOptions & options) : Node("topic_rely_controller", options)
{
RCLCPP_INFO(get_logger(), "Hello, Autoware Topic Rely Controller!");
}
} // namespace autoware::topic_rely_controller

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::topic_rely_controller::TopicRelyController)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2025 TIER IV, Inc.
//
// 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_TOPIC_RELY_CONTROLLER__TOPIC_RELY_CONTROLLER_HPP_
#define AUTOWARE_TOPIC_RELY_CONTROLLER__TOPIC_RELY_CONTROLLER_HPP_

// ROS 2 core
#include <rclcpp/rclcpp.hpp>

namespace autoware::topic_rely_controller
{
class TopicRelyController : public rclcpp::Node
{
public:
explicit TopicRelyController(const rclcpp::NodeOptions & options);

private:

};
} // namespace autoware::topic_rely_controller

#endif // AUTOWARE_TOPIC_RELY_CONTROLLER__TOPIC_RELY_CONTROLLER_HPP_

0 comments on commit 650448f

Please sign in to comment.