Skip to content

Commit

Permalink
Merge pull request #188 from zivid/2024-11-05-update-python-samples
Browse files Browse the repository at this point in the history
Samples: Automatic updates to public repository
  • Loading branch information
torbsorb authored Nov 6, 2024
2 parents e04e444 + b16f6c7 commit 0d51bc5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions modules/zividsamples/gui/hand_eye_verification_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ def on_hand_eye_configuration_updated(self):
)
self.markers_in_camera_frame_pose_widget.on_eye_in_hand_toggled(self.hand_eye_configuration.eye_in_hand)
self.markers_in_robot_base_frame_pose_widget.on_eye_in_hand_toggled(self.hand_eye_configuration.eye_in_hand)
self.markers_in_robot_base_frame_pose_widget.set_title(
f"Marker Poses In Robot {('Base' if self.hand_eye_configuration.eye_in_hand else 'Tool')} Frame"
)
self.detection_visualization_widget.on_hand_eye_configuration_updated(self.hand_eye_configuration)

def confirm_robot_pose(self):
Expand Down
8 changes: 4 additions & 4 deletions modules/zividsamples/gui/pose_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,6 @@ def setup_base_connections(self):
if self.display_mode != PoseWidgetDisplayMode.OnlyPose:
self.rotation_format_selection_widget.rotation_format_update.connect(self.on_rotation_format_update)

def set_title(self, title: str):
self.title = title

def get_rotation_format(self) -> RotationInformation:
return self.rotation_information

Expand Down Expand Up @@ -787,6 +784,9 @@ def update_layout(self):
else:
self.scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)

def set_title(self, title: str):
self.group_box.setTitle(title)

def update_markers(self):
self.translation_parameters = {}
self.rotation_parameters = {}
Expand Down Expand Up @@ -850,7 +850,7 @@ def MarkersInRobotFrame(
"hand-eye-robot-and-calibration-board-ee-object-pose-low-res.png"
)
return cls(
title="Marker Poses In Robot Base Frame",
title=f"Marker Poses In Robot {('Base' if eye_in_hand else 'Tool')} Frame",
initial_rotation_information=initial_rotation_information,
eye_in_hand=eye_in_hand,
display_mode=display_mode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ def connect_signals(self) -> None:
self.load_from_directory.triggered.connect(self.on_load_from_data_directory_action_triggered)
self.save_to_directory.triggered.connect(self.on_save_to_data_directory_action_triggered)
self.save_frame_action.triggered.connect(self.on_save_last_frame_action_triggered)
self.select_eye_in_hand_action.triggered.connect(self.on_hand_eye_action_triggered)
self.select_eye_to_hand_action.triggered.connect(self.on_hand_eye_action_triggered)
self.select_eye_in_hand_action.triggered.connect(lambda: self.on_hand_eye_action_triggered(True))
self.select_eye_to_hand_action.triggered.connect(lambda: self.on_hand_eye_action_triggered(False))
self.select_checkerboard_action.triggered.connect(
lambda: self.on_calibration_object_action_triggered(CalibrationObject.Checkerboard)
)
Expand Down Expand Up @@ -547,8 +547,8 @@ def on_select_hand_eye_settings_action_triggered(self) -> None:
self.setup_settings()
self.live2d_widget.settings_2d = self.settings.settings_2d

def on_hand_eye_action_triggered(self, action: QAction) -> None:
self.hand_eye_configuration.eye_in_hand = action == self.select_eye_in_hand_action
def on_hand_eye_action_triggered(self, eye_in_hand: bool) -> None:
self.hand_eye_configuration.eye_in_hand = eye_in_hand
self.hand_eye_calibration_gui.hand_eye_configuration_update(self.hand_eye_configuration)
self.hand_eye_verification_gui.hand_eye_configuration_update(self.hand_eye_configuration)

Expand Down

0 comments on commit 0d51bc5

Please sign in to comment.