Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix robot warnings and add robot and ndi IPs #868

Merged
merged 2 commits into from
Dec 10, 2024
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
12 changes: 9 additions & 3 deletions invesalius/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@
DEFAULT_TRACKER = SELECT

NDICOMPORT = b"COM1"
NDI_IP = ["P9-13715.local", "P9-13719.local"]
NDI_IP = ["P9-13715.local", "P9-13719.local", "P9-25026.local"]

TRACKERS = [
_("Claron MicronTracker"),
Expand Down Expand Up @@ -1126,8 +1126,14 @@
PULSE_DURATION_IN_MILLISECONDS = 0.2

# Robot
ROBOT_ElFIN_IP = ["192.168.200.251", "143.107.220.251", "169.254.153.251", "127.0.0.1"]
ROBOT_DOBOT_IP = ["192.168.1.6"]
ROBOT_IPS = [
"192.168.200.251",
"143.107.220.251",
"169.254.153.251",
"127.0.0.1",
"192.168.1.6",
"169.254.128.103",
]

MTMS_RADIUS = 15

Expand Down
2 changes: 1 addition & 1 deletion invesalius/data/viewer_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ def DisableTargetMode(self):
if self.distance_text is not None:
self.ren.RemoveActor(self.distance_text.actor)

# Remove the actor for 'distance' text.
# Remove the actor for 'robot warnings' text.
if self.robot_warnings_text is not None:
self.ren.RemoveActor(self.robot_warnings_text.actor)

Expand Down
2 changes: 1 addition & 1 deletion invesalius/gui/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6510,7 +6510,7 @@ def __init__(self, title: str = _("Set Robot IP")):
def _init_gui(self) -> None:
# ComboBox for spatial tracker device selection
tooltip = _("Choose or type the robot IP")
robot_ip_options = [_("Select robot IP:")] + const.ROBOT_ElFIN_IP
robot_ip_options = [_("Select robot IP:")] + const.ROBOT_IPS
choice_IP = wx.ComboBox(
self, -1, "", choices=robot_ip_options, style=wx.CB_DROPDOWN | wx.TE_PROCESS_ENTER
)
Expand Down
2 changes: 1 addition & 1 deletion invesalius/gui/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ def __init__(self, parent, tracker, robot):

# ComboBox for spatial tracker device selection
tooltip = _("Choose or type the robot IP")
robot_ip_options = [_("Select robot IP:")] + const.ROBOT_ElFIN_IP + const.ROBOT_DOBOT_IP
robot_ip_options = [_("Select robot IP:")] + const.ROBOT_IPS
choice_IP = wx.ComboBox(
self, -1, "", choices=robot_ip_options, style=wx.CB_DROPDOWN | wx.TE_PROCESS_ENTER
)
Expand Down
6 changes: 6 additions & 0 deletions invesalius/gui/task_navigator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,9 @@ def OnRobotTrackTargetButton(self, evt=None, ctrl=None):
# objective set by another button; hence this check.
if self.robot.objective == RobotObjective.TRACK_TARGET:
self.robot.SetObjective(RobotObjective.NONE)
Publisher.sendMessage(
"Robot to Neuronavigation: Update robot warning", robot_warning=""
)

# 'Move away' button
def EnableRobotMoveAwayButton(self, enabled=False):
Expand All @@ -1925,6 +1928,9 @@ def OnRobotMoveAwayButton(self, evt=None, ctrl=None):
# objective set by another button; hence this check.
if self.robot.objective == RobotObjective.MOVE_AWAY_FROM_HEAD:
self.robot.SetObjective(RobotObjective.NONE)
Publisher.sendMessage(
"Robot to Neuronavigation: Update robot warning", robot_warning=""
)

# 'Free drive' button
def EnableRobotFreeDriveButton(self, enabled=False):
Expand Down
Loading