-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathenvironment.m
More file actions
35 lines (33 loc) · 1.23 KB
/
environment.m
File metadata and controls
35 lines (33 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
classdef environment < handle
% AutoDRIVE Environment MATLAB API
% Attributes and methods to store and parse environment commands
properties
% Environmental conditions
auto_time = boolean(0)
auto_time_str = "False"
time_scale = 60
time_of_day = 560
weather_id = uint8(3)
cloud_intensity = 0
fog_intensity = 0
rain_intensity = 0
snow_intensity = 0
end
methods
function data = generate_commands(obj)
if(obj.auto_time == boolean(0))
obj.auto_time_str = 'False';
else
obj.auto_time_str = 'True';
end
data = strcat('","Auto Time":"',obj.auto_time_str, ...
'","Time Scale":"',num2str(obj.time_scale), ...
'","Time":"',num2str(obj.time_of_day), ...
'","Weather":"',num2str(obj.weather_id), ...
'","Clouds":"',num2str(obj.cloud_intensity), ...
'","Fog":"',num2str(obj.fog_intensity), ...
'","Rain":"',num2str(obj.rain_intensity), ...
'","Snow":"',num2str(obj.snow_intensity));
end
end
end