From e9d0a470cca9328affd51e9c89ddb4f661269e4a Mon Sep 17 00:00:00 2001 From: Philipp Caspers Date: Thu, 4 Jul 2024 13:01:37 +0200 Subject: [PATCH] feat: Add interface package (#16) Adds a temporary sample interface package to provide custom ros messages and services. --- voraus_ros_interfaces/CMakeLists.txt | 27 +++++++++++++++++++++++++++ voraus_ros_interfaces/README.md | 5 +++++ voraus_ros_interfaces/msg/Voraus.msg | 11 +++++++++++ voraus_ros_interfaces/package.xml | 20 ++++++++++++++++++++ voraus_ros_interfaces/srv/Voraus.srv | 5 +++++ 5 files changed, 68 insertions(+) create mode 100644 voraus_ros_interfaces/CMakeLists.txt create mode 100644 voraus_ros_interfaces/README.md create mode 100644 voraus_ros_interfaces/msg/Voraus.msg create mode 100644 voraus_ros_interfaces/package.xml create mode 100644 voraus_ros_interfaces/srv/Voraus.srv diff --git a/voraus_ros_interfaces/CMakeLists.txt b/voraus_ros_interfaces/CMakeLists.txt new file mode 100644 index 0000000..73d70e6 --- /dev/null +++ b/voraus_ros_interfaces/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.5) + +project(voraus_ros_interfaces) + +# Default to C++14 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +find_package(ament_cmake REQUIRED) +find_package(rosidl_default_generators REQUIRED) + +set(msg_files + "msg/Voraus.msg" + "srv/Voraus.srv" +) + +rosidl_generate_interfaces(${PROJECT_NAME} + ${msg_files} +) + +ament_export_dependencies(rosidl_default_runtime) + +ament_package() diff --git a/voraus_ros_interfaces/README.md b/voraus_ros_interfaces/README.md new file mode 100644 index 0000000..dca8085 --- /dev/null +++ b/voraus_ros_interfaces/README.md @@ -0,0 +1,5 @@ +This is a ros package without any rust code for providing the necessary message and service types. +It will probably be autogenerated in the future. It is needed for the compilation of the voraus-ros-bridge and +all its ros consumers. +As this package will be generated from the OPC UA spec it will move to either the voraus components or to the release +such that a preconfigured rosbridge can be shipped. \ No newline at end of file diff --git a/voraus_ros_interfaces/msg/Voraus.msg b/voraus_ros_interfaces/msg/Voraus.msg new file mode 100644 index 0000000..885d5c7 --- /dev/null +++ b/voraus_ros_interfaces/msg/Voraus.msg @@ -0,0 +1,11 @@ +# Primitive types +bool bool_member true +int8 int8_member 1 +uint8 uint8_member 2 +byte byte_member 3 +float32 float32_member 1e-2 + +# Array/sequence of primitive type +float32[3] float_array [1.0, 2.0, 3.0] +float32[<=3] float_seq_bounded [4.0, 5.0] +float32[] float_seq_unbounded [6.0] diff --git a/voraus_ros_interfaces/package.xml b/voraus_ros_interfaces/package.xml new file mode 100644 index 0000000..7ca914a --- /dev/null +++ b/voraus_ros_interfaces/package.xml @@ -0,0 +1,20 @@ + + voraus_ros_interfaces + 0.0.1 + Defines custom ros message/service types for the voraus-ros-bridge + user + MIT + + ament_cmake + rosidl_default_generators + + rosidl_default_runtime + + ament_lint_common + + rosidl_interface_packages + + + ament_cmake + + diff --git a/voraus_ros_interfaces/srv/Voraus.srv b/voraus_ros_interfaces/srv/Voraus.srv new file mode 100644 index 0000000..b2e646f --- /dev/null +++ b/voraus_ros_interfaces/srv/Voraus.srv @@ -0,0 +1,5 @@ +int64 a +int64 b +int64 c +--- +int64 sum