Skip to content

Commit

Permalink
minor bug fixes in VRBall
Browse files Browse the repository at this point in the history
  • Loading branch information
olakiril committed Mar 29, 2022
1 parent 6d63e8d commit 7023a78
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Behaviors/VRBall.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def is_correct(self):
x, y, theta, tmst = self.get_position()
if self.curr_cond['reward_loc_x'] < 0 or self.curr_cond['reward_loc_y'] < 0: # cor location is any other
resp_locs = np.array([self.curr_cond['response_loc_x'], self.curr_cond['response_loc_y']]).T
cor_locs = resp_locs[[np.all(loc != self.previous_loc) for loc in resp_locs]]
cor_locs = resp_locs[[np.any(loc != self.previous_loc) for loc in resp_locs]]
else:
cor_locs = np.array([self.curr_cond['reward_loc_x'], self.curr_cond['reward_loc_y']])
dist_to_loc = [np.sum((loc - np.array([x, y])) ** 2) ** .5 for loc in cor_locs]
Expand Down
36 changes: 36 additions & 0 deletions conf/obj_test_static.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from Experiments.Passive import *
from core.Behavior import *
from Stimuli.Panda import *
from utils.helper_functions import *


# define session parameters
session_params = {
'setup_conf_idx' : 2,
'trial_selection': 'fixed',
'max_res': 1000,
}

exp = Experiment()
exp.setup(logger, Behavior, session_params)

# two static objects (1 target + 1 distractor) multiple delays & rotation
np.random.seed(0)
reps = 1

conditions = exp.make_conditions(stim_class=Panda(), conditions={
'background_color': [[1,1,1]],
'obj_dur': 4000,
'obj_id': 4,
'obj_pos_x': 0,
'obj_pos_y': 0,
'obj_mag': .5,
'obj_rot': -0,
'obj_tilt': -0,
'obj_yaw': 0,
'light_idx': [[1, 2]],
'light_dir': [[[0, -20, 0], [180, -20, 0]]]})

# run experiments
exp.push_conditions(conditions)
exp.start()

0 comments on commit 7023a78

Please sign in to comment.