Skip to content

Commit

Permalink
matlab compatible real time plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
acxz committed Nov 14, 2019
1 parent 9e3b420 commit 77e9a85
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions mppi.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
xlabel('Time');
ylabel('Value');
for sd = 1:state_dim
state_animated_lines(sd).animatedline = @animatedline(...
'Color', state_colors(mod(sd - 1,size(state_colors,2)) + 1,:));
state_animated_lines(sd).animatedline = octaveanimatedline(...
'Color', state_colors(mod(sd - 1,size(state_colors,1)) + 1,:));
%'DisplayName', ['State ' num2str(sd)]);
end
legend
Expand All @@ -79,7 +79,7 @@
xlabel('Time');
ylabel('Value');
for cd = 1:control_dim
control_animated_lines(cd).animatedline = @animatedline(...
control_animated_lines(cd).animatedline = octaveanimatedline(...
'Color', ctrl_colors(mod(cd - 1,size(ctrl_colors,2)) + 1,:));
%'DisplayName', ['Control ' num2str(cd)]);
end
Expand All @@ -89,7 +89,7 @@
title('Trajectory Cost');
xlabel('Time');
ylabel('Value');
traj_cost_line = animatedline('Color', rep_traj_cost_color);
traj_cost_line = octaveanimatedline('Color', rep_traj_cost_color);
%'DisplayName', 'Trajectory Cost');
legend
end
Expand Down
42 changes: 21 additions & 21 deletions animatedline.m → octaveanimatedline.m
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
## Copyright (C) 2019 Antonius R. Burgers
##
## This file is part of Octave.
##
## Octave is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## <https://www.gnu.org/licenses/>.
%% Copyright (C) 2019 Antonius R. Burgers
%%
%% This file is part of Octave.
%%
%% Octave is free software: you can redistribute it and/or modify it
%% under the terms of the GNU General Public License as published by
%% the Free Software Foundation, either version 3 of the License, or
%% (at your option) any later version.
%%
%% Octave is distributed in the hope that it will be useful, but
%% WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%% GNU General Public License for more details.
%%
%% You should have received a copy of the GNU General Public License
%% along with Octave; see the file COPYING. If not, see
%% <https://www.gnu.org/licenses/>.

classdef animatedline < handle
properties (Private)
classdef octaveanimatedline < handle
properties (Hidden)
h
end
properties
Expand All @@ -39,7 +39,7 @@
end
end

methods (Private)
methods (Hidden)
function truncatepoints(obj)
[x, y, z] = obj.getpoints;
if obj.MaximumNumPoints > 0 && numel(x) > obj.MaximumNumPoints
Expand All @@ -63,7 +63,7 @@ function truncatepoints(obj)
end

methods
function obj = animatedline(varargin)
function obj = octaveanimatedline(varargin)
[lineprop_names, lineprop_dflts] = obj.lineprops;

p = inputParser;
Expand Down

0 comments on commit 77e9a85

Please sign in to comment.