Browse Source

根据气动手新接口调整范式控制指令

dk 1 year ago
parent
commit
cab07ee0c9

+ 1 - 1
backend/free_grasp.psyexp

@@ -95,7 +95,7 @@
         <Param val="" valType="extendedCode" updates="constant" name="Begin Experiment"/>
         <Param val="" valType="extendedCode" updates="constant" name="Begin Experiment"/>
         <Param val="" valType="extendedCode" updates="constant" name="Begin JS Experiment"/>
         <Param val="" valType="extendedCode" updates="constant" name="Begin JS Experiment"/>
         <Param val="" valType="extendedCode" updates="constant" name="Begin JS Routine"/>
         <Param val="" valType="extendedCode" updates="constant" name="Begin JS Routine"/>
-        <Param val="# state changed&amp;#10;feedback_bar1.progress = force&amp;#10;if decision != -1:&amp;#10;    feedback_time = 3&amp;#10;    if not decision:&amp;#10;        trigger.send_trigger(0)&amp;#10;        hand_device.extend()&amp;#10;    else:&amp;#10;        trigger.send_trigger(int(decision))&amp;#10;        hand_device.start(model=fingermodel_ids_inverse[decision])&amp;#10;else:&amp;#10;    feedback_time = 0&amp;#10;    " valType="extendedCode" updates="constant" name="Begin Routine"/>
+        <Param val="# state changed&amp;#10;feedback_bar1.progress = force&amp;#10;if decision != -1:&amp;#10;    feedback_time = 3&amp;#10;    trigger.send_trigger(int(decision))&amp;#10;    hand_device.start(model=fingermodel_ids_inverse[decision])&amp;#10;else:&amp;#10;    feedback_time = 0&amp;#10;    " valType="extendedCode" updates="constant" name="Begin Routine"/>
         <Param val="Py" valType="str" updates="None" name="Code Type"/>
         <Param val="Py" valType="str" updates="None" name="Code Type"/>
         <Param val="" valType="extendedCode" updates="constant" name="Each Frame"/>
         <Param val="" valType="extendedCode" updates="constant" name="Each Frame"/>
         <Param val="" valType="extendedCode" updates="constant" name="Each JS Frame"/>
         <Param val="" valType="extendedCode" updates="constant" name="Each JS Frame"/>

+ 3 - 7
backend/free_grasp.py

@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
 This experiment was created using PsychoPy3 Experiment Builder (v2023.2.3),
 This experiment was created using PsychoPy3 Experiment Builder (v2023.2.3),
-    on Tue Dec 12 13:24:05 2023
+    on Wed Dec 13 11:12:24 2023
 If you publish work using this script the most relevant publication is:
 If you publish work using this script the most relevant publication is:
 
 
     Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019) 
     Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019) 
@@ -693,12 +693,8 @@ def run(expInfo, thisExp, win, inputs, globalClock=None, thisSession=None):
         feedback_bar1.progress = force
         feedback_bar1.progress = force
         if decision != -1:
         if decision != -1:
             feedback_time = 3
             feedback_time = 3
-            if not decision:
-                trigger.send_trigger(0)
-                hand_device.extend()
-            else:
-                trigger.send_trigger(int(decision))
-                hand_device.start(model=fingermodel_ids_inverse[decision])
+            trigger.send_trigger(int(decision))
+            hand_device.start(model=fingermodel_ids_inverse[decision])
         else:
         else:
             feedback_time = 0
             feedback_time = 0
             
             

+ 1 - 1
backend/general_grasp_training.psyexp

@@ -590,7 +590,7 @@
         <Param val="" valType="extendedCode" updates="constant" name="Begin Experiment"/>
         <Param val="" valType="extendedCode" updates="constant" name="Begin Experiment"/>
         <Param val="" valType="extendedCode" updates="constant" name="Begin JS Experiment"/>
         <Param val="" valType="extendedCode" updates="constant" name="Begin JS Experiment"/>
         <Param val="" valType="extendedCode" updates="constant" name="Begin JS Routine"/>
         <Param val="" valType="extendedCode" updates="constant" name="Begin JS Routine"/>
-        <Param val="if success:&amp;#10;    feedback_2.text = '恭喜!'&amp;#10;    if args.hand_feedback:&amp;#10;        hand_device.extend()&amp;#10;else:&amp;#10;    feedback_2.text = '继续努力!'" valType="extendedCode" updates="constant" name="Begin Routine"/>
+        <Param val="if success:&amp;#10;    feedback_2.text = '恭喜!'&amp;#10;    if args.hand_feedback:&amp;#10;        hand_device.start('rest')&amp;#10;else:&amp;#10;    feedback_2.text = '继续努力!'" valType="extendedCode" updates="constant" name="Begin Routine"/>
         <Param val="Py" valType="str" updates="None" name="Code Type"/>
         <Param val="Py" valType="str" updates="None" name="Code Type"/>
         <Param val="" valType="extendedCode" updates="constant" name="Each Frame"/>
         <Param val="" valType="extendedCode" updates="constant" name="Each Frame"/>
         <Param val="" valType="extendedCode" updates="constant" name="Each JS Frame"/>
         <Param val="" valType="extendedCode" updates="constant" name="Each JS Frame"/>

+ 2 - 2
backend/general_grasp_training.py

@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
 This experiment was created using PsychoPy3 Experiment Builder (v2023.2.3),
 This experiment was created using PsychoPy3 Experiment Builder (v2023.2.3),
-    on Tue Dec 12 13:08:19 2023
+    on Wed Dec 13 11:15:00 2023
 If you publish work using this script the most relevant publication is:
 If you publish work using this script the most relevant publication is:
 
 
     Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019) 
     Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019) 
@@ -1082,7 +1082,7 @@ def run(expInfo, thisExp, win, inputs, globalClock=None, thisSession=None):
         if success:
         if success:
             feedback_2.text = '恭喜!'
             feedback_2.text = '恭喜!'
             if args.hand_feedback:
             if args.hand_feedback:
-                hand_device.extend()
+                hand_device.start('rest')
         else:
         else:
             feedback_2.text = '继续努力!'
             feedback_2.text = '继续努力!'
         # keep track of which components have finished
         # keep track of which components have finished