Skip to content

Commit 04345e1

Browse files
committed
fix issue where if ROS 2 entry includes a path, it will also ingest the whole json message. Also fix util parse function to return None if it finds None
1 parent c5ac147 commit 04345e1

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

formant_ros2_adapter/scripts/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,7 @@ def handle_ros2_message(self, msg, subscriber_config):
930930
f"ERROR: Could not find path '{path_config['path']}' in message {msg_type}"
931931
)
932932
pass
933+
return
933934

934935
msg_timestamp = int(time.time() * 1000)
935936
if hasattr(msg, "header"):

formant_ros2_adapter/scripts/message_utils/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ def parse(m):
5454
return NUMPY_DTYPE_TO_BUILTIN_MAPPING[type(m)](m)
5555
elif type(m) in [list, array.array, np.ndarray]:
5656
return [parse(o) for o in m]
57+
elif m is None:
58+
return None
5759
else:
5860
return {k: parse(getattr(m, k)) for k in m._fields_and_field_types}
5961

0 commit comments

Comments
 (0)