Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ev3-toolbox-matlab
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mindstorms
ev3-toolbox-matlab
Commits
38f3fbf4
Commit
38f3fbf4
authored
8 years ago
by
Tim Stadtmann
Browse files
Options
Downloads
Patches
Plain Diff
Fix some typos and comments
parent
912bb027
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
source/Command.m
+2
-2
2 additions, 2 deletions
source/Command.m
source/Motor.m
+18
-24
18 additions, 24 deletions
source/Motor.m
source/btBrickIO.m
+1
-1
1 addition, 1 deletion
source/btBrickIO.m
with
21 additions
and
27 deletions
source/Command.m
+
2
−
2
View file @
38f3fbf4
...
...
@@ -2202,7 +2202,7 @@ classdef Command < handle
cmd
.
GV0
(
speed
);
end
function
opOUTPUT_TEST
(
cmd
,
layer
,
nos
,
value
)
function
opOUTPUT_TEST
(
cmd
,
layer
,
nos
,
busy
)
% Command.opOUTPUT_TEST Add a opOUTPUT_TEST
%
% Command.opOUTPUT_READ(layer,nos) adds a opOUTPUT_TEST opcode
...
...
@@ -2222,7 +2222,7 @@ classdef Command < handle
cmd
.
addDirectCommand
(
ByteCodes
.
OutputTest
);
cmd
.
LC0
(
layer
);
cmd
.
LC0
(
nos
);
cmd
.
GV0
(
value
);
cmd
.
GV0
(
busy
);
end
function
opOUTPUT_READY
(
cmd
,
layer
,
nos
)
...
...
This diff is collapsed.
Click to expand it.
source/Motor.m
+
18
−
24
View file @
38f3fbf4
...
...
@@ -96,14 +96,14 @@ classdef Motor < MaskedHandle & dynamicprops
%% Miscallenous flags
connectedToBrick
=
false
;
% Connection to physical Brick?
connectedToBrick
=
false
;
% Connection to physical Brick?
sendPowerOnNextStart
=
false
;
% Indicates whether current power parameter should be sent
% to the Brick right before starting it next time
sendPowerOnSet
=
false
;
% Indicates whether power parameter should be sent to the Brick
% immediately after setting it
limitSetToZero
=
false
;
% Indicates whether limitValue has been set to zero
% (workaround for a bug, see motor.start, Note 2)
init
=
true
;
% Indicates 'init-phase' (True as long as constructor is running)
init
=
true
;
% Indicates 'init-phase' (True as long as constructor is running)
end
properties
(
Hidden
,
Dependent
,
Access
=
'private'
)
% Hidden, dependent properties for internal use only
...
...
@@ -175,6 +175,10 @@ classdef Motor < MaskedHandle & dynamicprops
if
motor
.
brakeMode_
==
BrakeMode
.
Coast
motor
.
reset
();
end
% if motor.internalTachoCount ~= 0
% motor.reset();
% end
% Call right function in commInterface depending on limitValue and limitMode
if
motor
.
limitValue
==
0
...
...
@@ -440,16 +444,16 @@ classdef Motor < MaskedHandle & dynamicprops
% -> No need to check if motor is connected as speed correctly
% returns 0 if it's not
%
if
~
motor
.
connectedToBrick
error
([
'Motor::waitFor: Motor-Object not connected to comm handle.'
,
...
'You have to call motor.connect(commInterface) first!'
]);
end
pause
(
0.1
);
while
motor
.
isRunning
pause
(
0.03
);
end
motor
.
commInterface
.
outputReady
(
0
,
motor
.
port
);
% %
if ~motor.connectedToBrick
% %
error(['Motor::waitFor: Motor-Object not connected to comm handle.',...
% %
'You have to call motor.connect(commInterface) first!']);
% %
end
% %
% %
pause(0.1);
% %
while motor.isRunning
% %
pause(0.03);
% %
end
% elseif ~motor.limitValue
% error(['Motor::waitFor: Motor has no tacho limit. ' ,...
% 'Can''t reliably determine whether it is running or not.']);
...
...
@@ -561,11 +565,6 @@ classdef Motor < MaskedHandle & dynamicprops
error
(
'Motor::set.smoothStart: Smooth start steps are out of bounds.'
);
end
% if ~isempty(motor.limitValue) && steps>motor.limitValue
% warning(['Motor::set.smoothStart: Smooth start steps are greater than ',...
% 'limitValue.']);
% end
motor
.
smoothStart
=
steps
;
end
...
...
@@ -577,11 +576,6 @@ classdef Motor < MaskedHandle & dynamicprops
error
(
'Motor::set.smoothStop: Smooth stop steps are out of bounds.'
);
end
% if ~isempty(motor.limitValue) && steps>motor.limitValue
% error(['Motor::set.smoothStop: Smooth stop steps are greater than ',...
% 'limitValue.']);
% end
motor
.
smoothStop
=
steps
;
end
...
...
@@ -777,6 +771,7 @@ classdef Motor < MaskedHandle & dynamicprops
function
running
=
get
.
isRunning
(
motor
)
running
=
(
motor
.
currentSpeed
~=
0
);
%running = motor.commInterface.outputTest(0, motor.port);
end
function
synced
=
get
.
isSynced
(
motor
)
...
...
@@ -961,8 +956,7 @@ classdef Motor < MaskedHandle & dynamicprops
'comm handle is invalid. Deleting invalid handle and '
,
...
'resetting Motor.connectedToBrick now...'
]);
motor
.
commInterface
=
0
;
motor
.
connectedToBrick
=
false
;
motor
.
disconnect
();
error
(
'Motor::connect: Disconnected due to internal error.'
);
end
...
...
This diff is collapsed.
Click to expand it.
source/btBrickIO.m
+
1
−
1
View file @
38f3fbf4
...
...
@@ -180,7 +180,7 @@ classdef btBrickIO < BrickIO
id
=
[
ID
(),
':'
,
'UnknownError'
];
newException
=
MException
(
id
,
msg
);
newException
=
addCause
(
newException
,
ME
);
throw
(
newException
);
b
.
bee
throw
(
newException
);
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment