dynamicEvidentialGridMap
Description
The dynamicEvidentialGridMap
object represents the dynamic map estimate
obtained from the grid-based tracker, trackerGridRFS
. You can visualize
the dynamic map and obtain the estimated values by using the object functions of
dynamicEvidentialGridMap
. The dynamicEvidentialGridMap
object is a
handle object.
Creation
You can generate a dynamicEvidentialGridMap
object using a trackerGridRFS
object. See the
Usage syntax of
trackerGridRFS
and the Obtain Estimated Values at
Grid Level using dynamicEvidentialGridMap
example for
details.
Properties
MotionModel
— Motion model for tracking
'constant-velocity'
| 'constant-acceleration'
| 'constant-turn-rate'
This property is read-only.
Motion model for tracking, specified as 'constant-velocity'
,
'constant-acceleration'
, or
'constant-turn-rate'
. The particle state and object state for each
motion model are:
MotionModel | Particle State | Object State |
---|---|---|
'constant-velocity' | [x; vx; y; vy] | [x; vx; y; vy; yaw; L; W] |
'constant-acceleration' | [x; vx; ax; y; vy; ay] | [x; vx; ax; y; vy; ay; yaw; L; W] |
'constant-turn-rate' | [x; vx; y; vy; w] | [x; vx; y; vy; w; yaw; L; W] |
where:
x
— Position of the object in the x direction of the tracking frame (m)y
— Position of the object in the y direction of the tracking frame (m)vx
— Velocity of the object in the x direction of the tracking frame (m/s)vy
— Velocity of the object in the y direction of the tracking frame (m/s)ax
— Acceleration of the object in the x direction of the tracking frame (m/s2)ay
— Acceleration of the object in the y direction of the tracking frame (m/s2)w
— Yaw-rate of the object in the tracking frame (degree/s)yaw
— Yaw angle of the object in the tracking frame (deg)L
— Length of the object (m)W
— Width of the object (m)
NumStateVariables
— Number of state variables
positive integer
This property is read-only.
Number of state variables corresponding to the motion model specified in the
MotionModel
property, specified as a positive integer.
Example: 6
GridLength
— x-direction dimension of grid
100
(default) | positive scalar
This property is read-only.
x-direction dimension of the grid in the local coordinates, specified as a positive scalar in meters.
GridWidth
— y-direction dimension of grid
100
(default) | positive scalar
This property is read-only.
y-direction dimension of the grid in the local coordinates, specified as a positive scalar in meters.
GridResolution
— Resolution of grid
1
(default) | positive scalar
This property is read-only.
Resolution of the grid, specified as a positive scalar.
GridResolution
represents the number of cells per meter of the
grid for both the x- and y-direction of the grid.
GridOriginInLocal
— Location of grid origin in local coordinate frame
[-50 -50]
(default) | two-element real-valued vector
This property is read-only.
Location of the grid origin in the local coordinate frame, specified as a two-element real-valued vector in meters. The grid origin represents the bottom-left corner of the grid map.
Object Functions
getEvidences | Get estimated occupancy and free evidences |
getOccupancy | Get estimated occupancy probabilities |
getState | Get full estimated state and associated uncertainty |
getVelocity | Get estimated velocity and associated uncertainty |
show | Visualize dynamic evidential grid map |
Examples
Obtain Estimated Values at Grid Level using dynamicEvidentialGridMap
Create a tracking scenario.
rng(2021);% For reproducible results scene = trackingScenario('UpdateRate',5,'StopTime',5);
Add a platform. Mount a lidar sensor on the platform.
plat = platform(scene); lidar = monostaticLidarSensor(1,'DetectionCoordinates','Body');
Add two targets and define their position, velocity, orientation, dimension, and meshes.
for i = 1:2 target = platform(scene); x = 50*(2*rand-1); y = 50*(2*rand-1); vx = 5*(2*rand-1); vy = 5*(2*rand-1); target.Trajectory.Position = [x y 0]; target.Trajectory.Velocity = [vx vy 0]; target.Trajectory.Orientation = quaternion([atan2d(vy,vx),0,0],'eulerd','ZYX','frame'); target.Mesh = extendedObjectMesh('sphere'); target.Dimensions = struct('Length',4, ... 'Width',4, ... 'Height',2, ... 'OriginOffset',[0 0 0]); end
Define the configuration of the sensor.
config = trackingSensorConfiguration(1, ... 'SensorLimits',[-180 180;0 100], ... 'SensorTransformParameters',struct, ... 'IsValidTime',true);
Create a grid-based tracker.
tracker = trackerGridRFS('SensorConfigurations',config, ... 'AssignmentThreshold',5, ... 'MinNumCellsPerCluster',4, ... 'ClusteringThreshold',3);
Advance scenario and run the tracker based on the lidar data.
while advance(scene) % Current time time = scene.SimulationTime; % Generate point cloud tgtMeshes = targetMeshes(plat); [ptCloud, config] = lidar(tgtMeshes, time); % Format the data for the tracker sensorData = struct('Time',time, ... 'SensorIndex',1, ... 'Measurement',ptCloud', ... 'MeasurementParameters',struct ... ); % Call tracker using sensorData to obtain the map in addition % to tracks [tracks, ~, ~, map] = tracker(sensorData,time); % Obtain the estimated occupancy probability of each cell P_occ = getOccupancy(map); % Obtain the estimated evidences for each cell [m_occ, m_free] = getEvidences(map); % Obtain the estimated velocity for each cell [v, Pv] = getVelocity(map); % Obtain the estimated state for each cell [x, P] = getState(map); % Show the map show(map,'InvertColors',true) end
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
The
dynamicEvidentialGridMap
object is a handle object, which cannot be used as an entry-point input or output in code generation.The
show
object function does not support code generation.
Version History
Introduced in R2021a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)