From 00f25ad6252e6dee857c489bd4860885f026e927 Mon Sep 17 00:00:00 2001 From: Michael Anderson Date: Wed, 12 Jul 2023 12:07:38 -0700 Subject: [PATCH 1/4] add incwaveheight service message Signed-off-by: Michael Anderson --- buoy_interfaces/CMakeLists.txt | 1 + buoy_interfaces/srv/IncWaveHeight.srv | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 buoy_interfaces/srv/IncWaveHeight.srv diff --git a/buoy_interfaces/CMakeLists.txt b/buoy_interfaces/CMakeLists.txt index 836d760..130266e 100644 --- a/buoy_interfaces/CMakeLists.txt +++ b/buoy_interfaces/CMakeLists.txt @@ -25,6 +25,7 @@ rosidl_generate_interfaces(${PROJECT_NAME} "srv/BenderCommand.srv" "srv/BusCommand.srv" "srv/GainCommand.srv" + "srv/IncWaveHeight.srv" "srv/PCBattSwitchCommand.srv" "srv/PCBiasCurrCommand.srv" "srv/PCChargeCurrLimCommand.srv" diff --git a/buoy_interfaces/srv/IncWaveHeight.srv b/buoy_interfaces/srv/IncWaveHeight.srv new file mode 100644 index 0000000..0a77a83 --- /dev/null +++ b/buoy_interfaces/srv/IncWaveHeight.srv @@ -0,0 +1,16 @@ +# IncWaveHeight Request + +# x, y to evaluate height +geometry_msgs/Point[] points + +# x, y is relative to buoy origin; otherwise world origin +bool use_buoy_origin + +--- + +# IncWaveHeight Response + +# position = x, y, height +# orientation = normal vector (slope of wave) at position +geometry_msgs/Pose[] poses +bool valid From 7d87e1f8d1c4d7af35c54d9d7e9f81bab1908ad4 Mon Sep 17 00:00:00 2001 From: Michael Anderson Date: Wed, 23 Aug 2023 17:25:26 -0700 Subject: [PATCH 2/4] add latent data message and tweak incwaveheight Signed-off-by: Michael Anderson --- buoy_interfaces/CMakeLists.txt | 4 +++- buoy_interfaces/msg/IncWaveHeight.msg | 6 ++++++ buoy_interfaces/msg/LatentData.msg | 5 +++++ buoy_interfaces/srv/IncWaveHeight.srv | 5 ++--- 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 buoy_interfaces/msg/IncWaveHeight.msg create mode 100644 buoy_interfaces/msg/LatentData.msg diff --git a/buoy_interfaces/CMakeLists.txt b/buoy_interfaces/CMakeLists.txt index 130266e..efa0be2 100644 --- a/buoy_interfaces/CMakeLists.txt +++ b/buoy_interfaces/CMakeLists.txt @@ -14,13 +14,15 @@ find_package(std_msgs REQUIRED) rosidl_generate_interfaces(${PROJECT_NAME} "msg/BCRecord.msg" + "msg/IncWaveHeight.msg" + "msg/LatentData.msg" "msg/PBCommandResponse.msg" "msg/PBRecord.msg" + "msg/PBWatch.msg" "msg/PCRecord.msg" "msg/SCRecord.msg" "msg/TFRecord.msg" "msg/XBRecord.msg" - "msg/PBWatch.msg" "srv/BCResetCommand.srv" "srv/BenderCommand.srv" "srv/BusCommand.srv" diff --git a/buoy_interfaces/msg/IncWaveHeight.msg b/buoy_interfaces/msg/IncWaveHeight.msg new file mode 100644 index 0000000..6cd939e --- /dev/null +++ b/buoy_interfaces/msg/IncWaveHeight.msg @@ -0,0 +1,6 @@ +# x, y is relative to buoy origin; otherwise world origin +bool use_buoy_origin + +# position = x, y, height +# orientation = normal vector (slope of wave) at position +geometry_msgs/Pose pose diff --git a/buoy_interfaces/msg/LatentData.msg b/buoy_interfaces/msg/LatentData.msg new file mode 100644 index 0000000..0512f65 --- /dev/null +++ b/buoy_interfaces/msg/LatentData.msg @@ -0,0 +1,5 @@ +std_msgs/Header header + +IncWaveHeight[] inc_wave_heights + +# TODO(andermi) fill in other stuff diff --git a/buoy_interfaces/srv/IncWaveHeight.srv b/buoy_interfaces/srv/IncWaveHeight.srv index 0a77a83..5ca4d25 100644 --- a/buoy_interfaces/srv/IncWaveHeight.srv +++ b/buoy_interfaces/srv/IncWaveHeight.srv @@ -10,7 +10,6 @@ bool use_buoy_origin # IncWaveHeight Response -# position = x, y, height -# orientation = normal vector (slope of wave) at position -geometry_msgs/Pose[] poses +builtin_interfaces/Time stamp +IncWaveHeight[] heights bool valid From 17310e432dc827e78bd2e1c78af3ce3b32cbeb29 Mon Sep 17 00:00:00 2001 From: Michael Anderson Date: Tue, 5 Sep 2023 18:16:29 -0700 Subject: [PATCH 3/4] separate sdf incwaveheight points from service call; allow service to request points in relative_time to current sim time Signed-off-by: Michael Anderson --- buoy_interfaces/msg/IncWaveHeight.msg | 9 +++++++-- buoy_interfaces/srv/IncWaveHeight.srv | 9 ++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/buoy_interfaces/msg/IncWaveHeight.msg b/buoy_interfaces/msg/IncWaveHeight.msg index 6cd939e..20ff247 100644 --- a/buoy_interfaces/msg/IncWaveHeight.msg +++ b/buoy_interfaces/msg/IncWaveHeight.msg @@ -1,6 +1,11 @@ +# relative_time is the time height was computed in decimal seconds +# relative to simulation time in pose header.stamp +float64 relative_time + # x, y is relative to buoy origin; otherwise world origin bool use_buoy_origin -# position = x, y, height +# header.stamp = simulation time +# position = x, y, z(height) # orientation = normal vector (slope of wave) at position -geometry_msgs/Pose pose +geometry_msgs/PoseStamped pose diff --git a/buoy_interfaces/srv/IncWaveHeight.srv b/buoy_interfaces/srv/IncWaveHeight.srv index 5ca4d25..e305b4e 100644 --- a/buoy_interfaces/srv/IncWaveHeight.srv +++ b/buoy_interfaces/srv/IncWaveHeight.srv @@ -1,15 +1,18 @@ # IncWaveHeight Request -# x, y to evaluate height -geometry_msgs/Point[] points +# relative_time in decimal seconds to evaluate height at time relative to now (0) +# (Note: may be in future) +float64 relative_time # x, y is relative to buoy origin; otherwise world origin bool use_buoy_origin +# x, y to evaluate height +geometry_msgs/Point[] points + --- # IncWaveHeight Response -builtin_interfaces/Time stamp IncWaveHeight[] heights bool valid From ed5afa3f089d43935b19bcb2b2b992cec8a552e5 Mon Sep 17 00:00:00 2001 From: Michael Anderson Date: Wed, 6 Sep 2023 12:28:27 -0700 Subject: [PATCH 4/4] use arrays for relative_time/absolute_time; update comments Signed-off-by: Michael Anderson --- buoy_interfaces/msg/IncWaveHeight.msg | 10 +++++++--- buoy_interfaces/srv/IncWaveHeight.srv | 12 +++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/buoy_interfaces/msg/IncWaveHeight.msg b/buoy_interfaces/msg/IncWaveHeight.msg index 20ff247..2992abc 100644 --- a/buoy_interfaces/msg/IncWaveHeight.msg +++ b/buoy_interfaces/msg/IncWaveHeight.msg @@ -1,11 +1,15 @@ # relative_time is the time height was computed in decimal seconds # relative to simulation time in pose header.stamp +# time of wave height = header.stamp + relative_time +# Note: absolute_time from IncWaveHeight.srv converted to relative for response +# Note: all fixed-points in SDF are computed with relative_time = 0.0 float64 relative_time -# x, y is relative to buoy origin; otherwise world origin +# For now, position is always in world coords (use_buoy_origin always False) bool use_buoy_origin -# header.stamp = simulation time -# position = x, y, z(height) +# header.stamp = simulation time of computation +# time of wave height = header.stamp + relative_time +# position = x, y, z(height above waterplane) # orientation = normal vector (slope of wave) at position geometry_msgs/PoseStamped pose diff --git a/buoy_interfaces/srv/IncWaveHeight.srv b/buoy_interfaces/srv/IncWaveHeight.srv index e305b4e..146ddd8 100644 --- a/buoy_interfaces/srv/IncWaveHeight.srv +++ b/buoy_interfaces/srv/IncWaveHeight.srv @@ -1,13 +1,19 @@ # IncWaveHeight Request # relative_time in decimal seconds to evaluate height at time relative to now (0) -# (Note: may be in future) -float64 relative_time +# (Note: may be in future for wave prediction) +float64[] relative_time + +# absolute_time in epoch decimal seconds (from 01/01/1970 or sim start) to evaluate height +# (Note: may be in future for wave prediction) +float64[] absolute_time + +bool use_relative_time # x, y is relative to buoy origin; otherwise world origin bool use_buoy_origin -# x, y to evaluate height +# x, y to evaluate height above waterplane geometry_msgs/Point[] points ---