Skip to content

Commit 033cf68

Browse files
authored
User configurable network data capture (#56)
1 parent 944af64 commit 033cf68

File tree

6 files changed

+1212
-73
lines changed

6 files changed

+1212
-73
lines changed

configs/example.yaml

+40-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,45 @@ alerts:
1818

1919
# Node-specific configuration
2020

21+
# Network Data Capture
22+
# Used for capturing udp/tcp streams, e.g. during a cruise
23+
network_data_capture: #optional
24+
stats_interval: 60 #optional. How frequently to log statistics. Default is 60 seconds.
25+
print_stats: false #optional. Print to STDOUT. Default is false. Useful for debugging connections
26+
topics:
27+
ship_udp_example: #optional. Name of the topic to publish to
28+
connection_type: "udp" # Can be "udp" or "tcp"
29+
port: 44444 # Port for PhytO-ARM to listen to
30+
parsing_strategy: "delimited" # Can be "json_dict", "json_array", "raw", or "delimited"
31+
delimiter: ", " #optional. Only used if parsing_strategy is "delimited"
32+
use_regex_delimiter: false #optional. If true, delimiter is treated as a regex pattern. Default is false.
33+
subtopics: #optional. If parsing_strategy is not raw use this to parse data into subtopics
34+
example_subtopic: #optional. Name of the subtopic
35+
field_id: 0 # Index of the field. Used if parsing_strategy is "json_array" or "delimited"
36+
type: "str" # Can be "str", "int", "float", "bool", "float[]", "int[]", or "bool[]"
37+
second_example: #optional. Another subtopic, would have path "/ship_udp_example/second_example"
38+
field_id: 1
39+
type: "float"
40+
rbr_udp_stream: #optional. Example for an RBR CTD stream proxied over UDP
41+
connection_type: "udp"
42+
port: 12345
43+
parsing_strategy: "json_dict"
44+
subtopics: #optional
45+
depth: #optional. Will publish to "/rbr_udp_stream/depth"
46+
field_id: "depth" # Example of a JSON dict key.
47+
type: "float"
48+
delimited_stream_example: #optional. Example for a delimited stream
49+
connection_type: "udp"
50+
port: 5678
51+
parsing_strategy: "delimited"
52+
delimiter: ",? "
53+
use_regex_delimiter: true #optional. If true, delimiter is treated as a regex pattern. Default is false.
54+
subtopics: #optional
55+
temperature: #optional. Will publish to "/delimited_stream_example/temperature"
56+
field_id: 0
57+
type: "float" # Note delimited fields cannot be arrays
58+
59+
2160
gps:
2261
host: "172.17.0.1"
2362

@@ -169,7 +208,7 @@ arm_chanos: #optional
169208
- 5.0
170209
- 6.5
171210

172-
ctd_topic: '/arm_chanos/ctd/depth'
211+
ctd_topic: '/rbr_udp_stream/depth'
173212
ctd:
174213
channels:
175214
- conductivity(mS/cm)

src/phyto_arm/launch/arm_chanos.launch

-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44

55
<!-- RBR winch namespace. Important for separating similar nodes on different arms -->
66
<group ns="arm_chanos">
7-
<!-- proxy for publishing RBR's UDP stream as ROS topic -->
8-
<node name="rbr_udp" pkg="rbr_maestro3_ctd" type="udp_to_ros.py">
9-
<param name="port" type="int" value="12345" />
10-
</node>
11-
127
<node name="ctd" pkg="rbr_maestro3_ctd" type="rbr_maestro3_node.py">
138
<remap from="~in" to="udp_stream" />
149
</node>

src/phyto_arm/launch/main.launch

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
<node name="lock_manager" pkg="phyto_arm" type="lock_manager.py" />
1313

14+
<node name="network_data_capture" pkg="phyto_arm" type="network_data_capture.py" required="false" />
15+
1416
<group if="$(arg classifier)">
1517
<node name="classifier" pkg="triton_classifier" type="classifier_node.py" />
1618

0 commit comments

Comments
 (0)