Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions main_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,15 @@ def main(connection=None):
for i in range(len(buf)):
if topic[i] in const.PUB_MESSAGES:
msg_data = buf[i]["data"]

msg_robot_id = 0

if isinstance(msg_data, dict):
msg_robot_id = msg_data.get("robot_id", 0)
if msg_robot_id is None:
msg_robot_id = 0
else:
msg_robot_id = int(msg_robot_id)

if msg_robot_id != robot_id:
if msg_robot_id != robot_id:
if topic[i] in const.PUB_MESSAGES_WL and msg_robot_id == -1:
pass
else:
continue
else:
continue

get_function = {
Expand Down
6 changes: 6 additions & 0 deletions robot/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
},
}

# Publisher messages from invesalius to any robot
# It's important these message to be in the PUB_MESSAGES list too
PUB_MESSAGES_WL = [
"From Neuronavigation: Update tracker poses",
]

# Publisher messages from invesalius
PUB_MESSAGES = [
"Neuronavigation to Robot: Connect to robot",
Expand Down
Loading