Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jesse Heckman
pbtoolbox
Commits
dab5e229
Commit
dab5e229
authored
Oct 23, 2018
by
Jesse Heckman
Browse files
updated servo
parent
d7f21ff6
Changes
5
Hide whitespace changes
Inline
Side-by-side
setups/vestibular chair/vPrime/core/pb_vRunExp.m
View file @
dab5e229
...
@@ -51,8 +51,8 @@ function pb_vRunExp(handles)
...
@@ -51,8 +51,8 @@ function pb_vRunExp(handles)
% start vestibular chair
% start vestibular chair
if
~
ismac
&&
~
debug
if
~
ismac
&&
~
debug
pb_sendServo
(
vs
,
profile
);
pb_sendServo
(
profile
);
pb_startServo
(
vs
)
;
vs
=
pb_startServo
;
pause
(
6
);
blockTime
=
tic
;
% allow vestibular chair to get in sync with input signal
pause
(
6
);
blockTime
=
tic
;
% allow vestibular chair to get in sync with input signal
end
end
...
@@ -85,7 +85,8 @@ function pb_vRunExp(handles)
...
@@ -85,7 +85,8 @@ function pb_vRunExp(handles)
elapsedTime
=
toc
(
blockTime
);
elapsedTime
=
toc
(
blockTime
);
if
elapsedTime
<
dur
;
pause
(
dur
-
floor
(
elapsedTime
));
end
% wait untill chair is finished running before disabling.
if
elapsedTime
<
dur
;
pause
(
dur
-
floor
(
elapsedTime
));
end
% wait untill chair is finished running before disabling.
Dat
=
pb_stopServo
(
vs
);
pb_stopServo
(
vs
);
Dat
=
pb_readServo
;
end
end
% stop recording
% stop recording
...
...
subtools/servo/pb_readServo.m
View file @
dab5e229
function
D
=
pb_readServo
(
vs
)
function
D
=
pb_readServo
% PB_READSERVO()
% PB_READSERVO()
%
%
% PB_READSERVO() ...
% PB_READSERVO() ...
...
@@ -7,9 +7,9 @@ function D = pb_readServo(vs)
...
@@ -7,9 +7,9 @@ function D = pb_readServo(vs)
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
vs
=
vs_servo
;
[
sv
.
vertical
,
sv
.
horizontal
]
=
vs
.
read_profile_sv
;
[
sv
.
vertical
,
sv
.
horizontal
]
=
vs
.
read_profile_sv
;
[
pv
.
vertical
,
pv
.
horizontal
]
=
vs
.
read_profile_pv
;
[
pv
.
vertical
,
pv
.
horizontal
]
=
vs
.
read_profile_pv
;
delete
(
vs
);
delete
(
vs
);
D
.
sv
=
sv
;
D
.
sv
=
sv
;
...
...
subtools/servo/pb_sendServo.m
View file @
dab5e229
function
pb_sendServo
(
vs
,
profile
)
function
pb_sendServo
(
profile
)
% PB_SENDSERVO()
% PB_SENDSERVO()
%
%
% PB_SENDSERVO() ...
% PB_SENDSERVO() ...
...
@@ -6,8 +6,9 @@ function pb_sendServo(vs,profile)
...
@@ -6,8 +6,9 @@ function pb_sendServo(vs,profile)
% See also ...
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
vs
=
vs_servo
;
vs
.
write_profile
(
profile
.
v
,
profile
.
h
);
vs
.
write_profile
(
profile
.
v
,
profile
.
h
);
delete
(
vs
);
end
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
...
...
subtools/servo/pb_startServo.m
View file @
dab5e229
function
pb_startServo
(
vs
)
function
vs
=
pb_startServo
% PB_STARTSERVO()
% PB_STARTSERVO()
%
%
% PB_STARTSERVO() ...
% PB_STARTSERVO() ...
...
@@ -7,6 +7,9 @@ function pb_startServo(vs)
...
@@ -7,6 +7,9 @@ function pb_startServo(vs)
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
vs
=
vs_servo
;
vs
.
enable
;
pause
(
1
);
vs
.
start
;
vs
.
start
;
end
end
...
...
subtools/servo/pb_stopServo.m
View file @
dab5e229
...
@@ -9,9 +9,6 @@ function pb_stopServo(vs)
...
@@ -9,9 +9,6 @@ function pb_stopServo(vs)
vs
.
stop
;
vs
.
stop
;
vs
.
disable
;
vs
.
disable
;
Dat
=
pb_readServo
(
vs
);
delete
(
vs
);
delete
(
vs
);
end
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment