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
14 changes: 14 additions & 0 deletions built_in_tasks/bmimultitasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .target_capture_task_xt import ScreenReachAngle
from features.bmi_task_features import LinearlyDecreasingAssist
from .target_graphics import target_colors
from .target_tracking_task import ScreenTargetTracking

np.set_printoptions(suppress=False)

Expand Down Expand Up @@ -265,6 +266,10 @@ def create_goal_calculator(self):
else:
raise ValueError("Unrecognized decoder state space!")


def move_effector(self, pos_offset=[0,0,0], vel_offset=[0,0,0]):
pass

def get_target_BMI_state(self, *args):
'''
Run the goal calculator to determine the target state of the task
Expand Down Expand Up @@ -364,6 +369,8 @@ def toggle_clda(self):
self.hdf.sendMsg(f"clda = {self.learn_flag}")
print(f"clda = {self.learn_flag}")



class BMIControlMulti2DWindow(BMIControlMultiMixin, WindowDispl2D, ScreenTargetCapture):
fps = 20.
def __init__(self,*args, **kwargs):
Expand Down Expand Up @@ -395,4 +402,11 @@ class BMIControlMultiDirectionConstraint(BMIControlMultiMixin, ScreenReachAngle)
'''
Adds an additional constraint that the direction of travel must be within a certain angle
'''
pass


class BMIControlMulti_ScreenTargetTracking(BMIControlMultiMixin, ScreenTargetTracking):
'''
BMI control for target tracking task
'''
pass
9 changes: 4 additions & 5 deletions built_in_tasks/target_tracking_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def init(self):
self.repeat_freq_set = False
self.gen_index = -1

if self.velocity_control:
print('VELOCITY CONTROL')
else:
print('POSITION CONTROL') # default is position control - see manualcontrolmixin
#if self.velocity_control:
# print('VELOCITY CONTROL')
#else:
# print('POSITION CONTROL') # default is position control - see manualcontrolmixin
self.pos_offset = [0,0,0]
self.vel_offset = [0,0,0]

Expand Down Expand Up @@ -462,7 +462,6 @@ def init(self):
self.add_dtype('disturbance', 'f8', (3,))
super().init()
self.plant.set_endpoint_pos(np.array(self.starting_pos))

def _cycle(self):
'''
Calls any update functions necessary and redraws screen
Expand Down