Skip to content

Commit ebf7413

Browse files
committed
always set state to initial conditions in constructor
check size of initial conditions, enforce column vector
1 parent 451eb72 commit ebf7413

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Bicycle.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144

145145
veh = tb_optparse(opt, veh.options, veh);
146146
veh.vprev = 0;
147+
veh.x = veh.x0;
147148
end
148149

149150
function xnext = f(veh, x, odo, w)

Unicycle.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,12 @@
125125

126126
veh = veh@Vehicle(varargin{:});
127127

128-
veh.x = zeros(3,1);
129-
130128
opt.W = 1;
131129
opt.accelmax = Inf;
132130

133131
veh = tb_optparse(opt, veh.options, veh);
134132
veh.vprev = 0;
133+
veh.x = veh.x0;
135134
end
136135

137136

Vehicle.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,11 @@ function add_driver(veh, driver)
352352
% 'size',S Draw vehicle with length S
353353
% 'color',C Color of vehicle.
354354
% 'fill' Filled
355+
% 'trail',S Trail with line style S, use line() name-value pairs
355356
%
357+
% Example::
358+
% veh.plot('trail', {'Color', 'r', 'Marker', 'o', 'MarkerFaceColor', 'r', 'MarkerEdgeColor', 'r', 'MarkerSize', 3})
359+
356360
% Notes::
357361
% - The last two calls are useful if animating multiple robots in the same
358362
% figure.

0 commit comments

Comments
 (0)