Skip to content

Commit

Permalink
Add package_interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
H1rono committed May 28, 2024
1 parent 12c71a2 commit 70acd87
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packet/packet_interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.8)
project(packet_interfaces)

if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif ()

# find dependencies
find_package(ament_cmake REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
msg/Composed.msg
msg/Current.msg
msg/Depth.msg
msg/Flex.msg
msg/Power.msg
msg/Voltage.msg
DEPENDENCIES std_msgs sensor_msgs
)

ament_package()
17 changes: 17 additions & 0 deletions packet/packet_interfaces/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# packet_interfaces

device-app間で受け渡すメッセージ型

## Messages

- Composed: センサー類の値まとめ
- Current: 電流センサーの値
- Depth: 深さセンサーの値
- Flex: まげセンサーの値
- Power: BLDCとサーボへの出力値 (Composedに含まれない)
- Voltage: 電圧計の値

(see also)

- sensor_msgs/msg/Image: カメライメージ (**これはComposedに含めない**)
- std_msgs/msg/Empty: quit命令の型
10 changes: 10 additions & 0 deletions packet/packet_interfaces/msg/Composed.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 値まとめ

# まげセンサー2つ
# FIXME: 位置関係などの情報が名前ないしコメントに入ると嬉しい
Flex flex1
Flex flex2

sensor_msgs/Imu imu
Current current
Voltage voltage
5 changes: 5 additions & 0 deletions packet/packet_interfaces/msg/Current.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
std_msgs/Header header

# 電流の値
# TODO: 値の範囲
float32 value
5 changes: 5 additions & 0 deletions packet/packet_interfaces/msg/Depth.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
std_msgs/Header header

# 深さセンサーの値
# TODO: 値の範囲と現実との対応関係を書く
float32 value
5 changes: 5 additions & 0 deletions packet/packet_interfaces/msg/Flex.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
std_msgs/Header header

# nucleoから送られてきた値そのまま
# TODO: 値の範囲は 0~0xFFFFFFFF で決まっているが、どちらが曲がっている側か決める
uint16 value
8 changes: 8 additions & 0 deletions packet/packet_interfaces/msg/Power.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# BLDC, サーボへの出力
# Nucleoが出力する値そのまま

# BLDC4つ PWMのパルス幅[ms]
uint16[4] bldc
# サーボ4つ PWMのパルス幅[ms]
# NOTE: 4つの位置関係はBLDCと揃えること
uint16[4] servo
5 changes: 5 additions & 0 deletions packet/packet_interfaces/msg/Voltage.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
std_msgs/Header header

# 電圧の値
# TODO: 値の範囲は 0~3.3(5.0?) にしたい
float32 value
20 changes: 20 additions & 0 deletions packet/packet_interfaces/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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>packet_interfaces</name>
<version>0.1.0</version>
<description>device-app間で受け渡すメッセージ型</description>
<maintainer email="[email protected]">h1rono</maintainer>
<license>MIT</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<depend>std_msgs</depend>
<depend>sensor_msgs</depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
<member_of_group>rosidl_interface_packages</member_of_group>

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

0 comments on commit 70acd87

Please sign in to comment.