Skip to content

Commit

Permalink
Merged in development (pull request #20)
Browse files Browse the repository at this point in the history
Development

Approved-by: Fred Kummer
  • Loading branch information
Vertiq-Ben committed Aug 14, 2024
2 parents 5c62e02 + 2095d9d commit ef3219c
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 3 deletions.
11 changes: 11 additions & 0 deletions iq/src/clients/MultiTurnAngleControlClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,16 @@ function SendTrajectory(obj,tf,xf,xdf,xddf)
end
obj.set('trajectory_duration',tf);
end

function SendLinearTrajectory(obj,tf,xf,xdf,xddf)
obj.set('trajectory_linear_displacement',xf);
if(nargin > 3)
obj.set('trajectory_linear_velocity',xdf);
if(nargin > 4)
obj.set('trajectory_linear_acceleration',xddf);
end
end
obj.set('trajectory_duration',tf);
end
end
end
35 changes: 35 additions & 0 deletions iq/src/clients/RgbLedClient.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
% RgbLedClient allows the user to control the RGB LED on an LED board connected to a Vertiq module.
%
% Example:
% % Make a communication interface object
% com = MessageInterface('COM3', 115200);
% % Make a RgbLedClient object with obj_id 0
% rgbLed = RgbLedClient('com', com);
% % Use the RgbLedClient object
% rgbLedRed = rgbLed.get('red');
%
% Copyright 2024 Vertiq [email protected]
%
% This file is part of the Vertiq Matlab API.
%
% This code is licensed under the MIT license (see LICENSE or https://opensource.org/licenses/MIT for details)
%
% Name: RgbLedClient.m
% Last update: 2024/08/05 by Fred Kummer
% Author: Fred Kummer
% Contributors:

classdef RgbLedClient < Client

methods

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Constructor, from JSON Parameters

function obj = RgbLedClient(varargin)
args = varargin;
args = [args, {'filename', 'rgb_led.json'}];
obj@Client(args{:});
end
end
end
35 changes: 35 additions & 0 deletions iq/src/clients/WhiteLedClient.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
% WhiteLedClient allows the user to control the white LED on an LED board connected to a Vertiq module.
%
% Example:
% % Make a communication interface object
% com = MessageInterface('COM3', 115200);
% % Make a WhiteLedClient object with obj_id 0
% whiteLed = WhiteLedClient('com', com);
% % Use the WhiteLedClient object
% whiteLedIntensity = whiteLed.get('intensity');
%
% Copyright 2024 Vertiq [email protected]
%
% This file is part of the Vertiq Matlab API.
%
% This code is licensed under the MIT license (see LICENSE or https://opensource.org/licenses/MIT for details)
%
% Name: WhiteLedClient.m
% Last update: 2024/08/05 by Fred Kummer
% Author: Fred Kummer
% Contributors:

classdef WhiteLedClient < Client

methods

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Constructor, from JSON Parameters

function obj = WhiteLedClient(varargin)
args = varargin;
args = [args, {'filename', 'white_led.json'}];
obj@Client(args{:});
end
end
end
2 changes: 1 addition & 1 deletion iq/src/clients/client_files
5 changes: 3 additions & 2 deletions iq/src/communication/FindCom.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
p = inputParser;
addOptional(p,'id',[]);
addOptional(p,'timeout',.2);
addOptional(p,'baud',115200);
parse(p,varargin{:});

% Sets up a com
Expand All @@ -39,10 +40,10 @@
com = [];

%% Find/make com
coms = seriallist;
coms = serialportlist;
for i = 1:length(coms)
try
com = MessageInterface(coms{i}, 115200);
com = MessageInterface(coms{i}, p.Results.baud);
sys = SystemControlClient('com',com,'timeout',p.Results.timeout);
id_in = sys.get('module_id');
clear sys
Expand Down

0 comments on commit ef3219c

Please sign in to comment.