Skip to content
Open
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
6 changes: 5 additions & 1 deletion built_in_tasks/target_capture_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ class ScreenTargetCapture(TargetCapture, Window):
cursor_color = traits.OptionsList("dark_purple", *target_colors, desc='Color of cursor endpoint', bmi3d_input_options=list(target_colors.keys()))
cursor_bounds = traits.Tuple((-10., 10., -10., 10., -10., 10.), desc='(x min, x max, y min, y max, z min, z max)')
starting_pos = traits.Tuple((5., 0., 5.), desc='Where to initialize the cursor')
leniency = traits.Float(0, desc = 'How many cursor radii that the cursor can be outside the non-center target') #increments of cursor radius, set to 0 means cursor must be fully within target

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down Expand Up @@ -383,7 +384,10 @@ def _test_leave_target(self, ts):
'''
cursor_pos = self.plant.get_endpoint_pos()
d = np.linalg.norm(cursor_pos - self.targs[self.target_index])
rad = self.target_radius - self.cursor_radius
if self.target_index == 0: #If first target, cursor should be immersed
rad = self.target_radius - self.cursor_radius
if self.target_index > 0:
rad = self.target_radius - self.cursor_radius + self.leniency*self.cursor_radius
return d > rad or super()._test_leave_target(ts)

#### STATE FUNCTIONS ####
Expand Down
Binary file modified db/db_test_aopy.sql
Binary file not shown.