Skip to content

Commit

Permalink
Radar fine tuning (#285)
Browse files Browse the repository at this point in the history
* Rename parameters to be the same as in RGL API

* Fix separations

* Update docs

* Update prefab

* Update RGL binary
  • Loading branch information
msz-rai committed Apr 17, 2024
1 parent 64845e6 commit f9a0f67
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
automaticCaptureHz: 10
applyDistanceGaussianNoise: 1
applyAngularGaussianNoise: 1
modelPreset: 1
configuration:
minAzimuthAngle: -65
Expand All @@ -103,14 +101,14 @@ MonoBehaviour:
maxElevationAngle: 7.5
frequency: 79
powerTransmitted: 31
antennaGain: 27
receivedNoiseMean: 60
receivedNoiseStDev: 1
cumulativeDeviceGain: 60
receivedNoiseMean: 93
receivedNoiseStDev: 2
scopeParameters:
- beginDistance: 0.6
- beginDistance: 0.1
endDistance: 9.5
distanceSeparationThreshold: 0.15
radialSpeedSeparationThreshold: 0.15
radialSpeedSeparationThreshold: 0.3
azimuthSeparationThreshold: 8
- beginDistance: 9.5
endDistance: 19
Expand All @@ -122,12 +120,6 @@ MonoBehaviour:
distanceSeparationThreshold: 0.6
radialSpeedSeparationThreshold: 0.3
azimuthSeparationThreshold: 8
noiseParams:
angularNoiseStDev: 2
angularNoiseMean: 0
distanceNoiseStDevBase: 0.2
distanceNoiseStDevRisePerMeter: 0
distanceNoiseMean: 0
--- !u!1 &4328371732713975294
GameObject:
m_ObjectHideFlags: 0
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ public static extern int rgl_node_points_udp_publish(

[DllImport("RobotecGPULidar")]
public static extern int rgl_node_points_radar_postprocess(ref IntPtr node, IntPtr radar_scopes, int radar_scopes_count,
float ray_azimuth_step, float ray_elevation_step, float frequency, float power_transmitted_dbm,
float antenna_gain_dbi, float received_noise_mean_dbm, float received_noise_st_dev_dbm);
float ray_azimuth_step, float ray_elevation_step, float frequency, float power_transmitted,
float cumulative_device_gain, float received_noise_mean, float received_noise_st_dev);

[DllImport("RobotecGPULidar")]
public static extern int rgl_node_points_simulate_snow(ref IntPtr node, float min_range, float max_range, float rain_rate,
Expand Down Expand Up @@ -527,7 +527,7 @@ public static void NodePointsFilterGround(ref IntPtr node, float groundAngleThre

public static void NodePointsRadarPostprocess(ref IntPtr node, RadarScopeParameters[] radarParametersScopes,
float rayAzimuthStep, float rayElevationStep, float frequency, float powerTransmitted,
float antennaGain, float receivedNoiseMean, float receivedNoiseStDev)
float cumulativeDeviceGain, float receivedNoiseMean, float receivedNoiseStDev)
{
// Make a copy to convert azimuthSeparationThreshold units (deg to rad)
RadarScopeParameters[] radarParametersScopesCopy = new RadarScopeParameters[radarParametersScopes.Length];
Expand All @@ -543,7 +543,7 @@ public static void NodePointsRadarPostprocess(ref IntPtr node, RadarScopeParamet
{
CheckErr(rgl_node_points_radar_postprocess(ref node, (IntPtr) pRadarParametersScopes,
radarParametersScopesCopy.Length, rayAzimuthStep, rayElevationStep, frequency,
powerTransmitted, antennaGain, receivedNoiseMean, receivedNoiseStDev));
powerTransmitted, cumulativeDeviceGain, receivedNoiseMean, receivedNoiseStDev));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,12 @@ public RGLNodeSequence AddNodeGaussianNoiseDistance(string identifier, float mea

public RGLNodeSequence AddNodePointsRadarPostprocess(string identifier, RadarScopeParameters[] radarParametersScopes,
float rayAzimuthStep, float rayElevationStep, float frequency, float powerTransmitted,
float antennaGain, float receivedNoiseMean, float receivedNoiseStDev)
float cumulativeDeviceGain, float receivedNoiseMean, float receivedNoiseStDev)
{
CheckNodeNotExist(identifier);
RGLNodeHandle handle = new RGLNodeHandle();
RGLNativeAPI.NodePointsRadarPostprocess(ref handle.Node, radarParametersScopes, rayAzimuthStep, rayElevationStep, frequency,
powerTransmitted, antennaGain, receivedNoiseMean, receivedNoiseStDev);
powerTransmitted, cumulativeDeviceGain, receivedNoiseMean, receivedNoiseStDev);
handle.Type = RGLNodeType.POINTS_RADAR_POSTPROCESS;
handle.Identifier = identifier;
AddNode(handle);
Expand Down Expand Up @@ -441,11 +441,11 @@ public RGLNodeSequence UpdateNodePointsCompactByField(string identifier, RGLFiel

public RGLNodeSequence UpdateNodePointsRadarPostprocess(string identifier, RadarScopeParameters[] radarParametersScopes,
float rayAzimuthStep, float rayElevationStep, float frequency, float powerTransmitted,
float antennaGain, float receivedNoiseMean, float receivedNoiseStDev)
float cumulativeDeviceGain, float receivedNoiseMean, float receivedNoiseStDev)
{
RGLNodeHandle handle = ValidateNode(identifier, RGLNodeType.POINTS_RADAR_POSTPROCESS);
RGLNativeAPI.NodePointsRadarPostprocess(ref handle.Node, radarParametersScopes, rayAzimuthStep, rayElevationStep,
frequency, powerTransmitted, antennaGain, receivedNoiseMean, receivedNoiseStDev);
frequency, powerTransmitted, cumulativeDeviceGain, receivedNoiseMean, receivedNoiseStDev);
return this;
}

Expand Down
12 changes: 6 additions & 6 deletions Assets/RGLUnityPlugin/Scripts/RadarModels/RadarConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ public class RadarConfiguration
[Tooltip("The power transmitted by the radar (in dBm)")]
[Range(0.0f, 100.0f)] public float powerTransmitted = 31.0f;

[Tooltip("The gain of the radar's antenna (in dBi)")]
[Range(0.0f, 100.0f)] public float antennaGain = 27.0f;
[Tooltip("The gain of the radar's antennas and any other gains of the device (in dBi)")]
[Range(0.0f, 100.0f)] public float cumulativeDeviceGain = 60.0f;

[Tooltip("The mean of the received noise (in dBm)")]
public float receivedNoiseMean = 60.0f;
[Tooltip("The mean of the received noise (in dB)")]
public float receivedNoiseMean = 93.0f;

[Tooltip("The standard deviation of the received noise (in dBm)")]
public float receivedNoiseStDev = 1.0f;
[Tooltip("The standard deviation of the received noise (in dB)")]
public float receivedNoiseStDev = 2.0f;

[Tooltip("Array of radar scope parameters")]
public RadarScopeParameters[] scopeParameters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ public static class RadarConfigurationLibrary
maxAzimuthAngle = 65.0f,
minElevationAngle = -7.5f,
maxElevationAngle = 7.5f,
frequency = 79.0f,
powerTransmitted = 31.0f,
cumulativeDeviceGain = 60.0f,
receivedNoiseMean = 93.0f,
receivedNoiseStDev = 2.0f,
scopeParameters = new[]
{
new RadarScopeParameters
{
beginDistance = 1.3f,
beginDistance = 0.2f,
endDistance = 19.0f,
distanceSeparationThreshold = 0.3f,
radialSpeedSeparationThreshold = 0.3f,
Expand Down Expand Up @@ -64,14 +69,19 @@ public static class RadarConfigurationLibrary
maxAzimuthAngle = 65.0f,
minElevationAngle = -7.5f,
maxElevationAngle = 7.5f,
frequency = 79.0f,
powerTransmitted = 31.0f,
cumulativeDeviceGain = 60.0f,
receivedNoiseMean = 93.0f,
receivedNoiseStDev = 2.0f,
scopeParameters = new[]
{
new RadarScopeParameters
{
beginDistance = 0.6f,
beginDistance = 0.1f,
endDistance = 9.5f,
distanceSeparationThreshold = 0.15f,
radialSpeedSeparationThreshold = 0.15f,
radialSpeedSeparationThreshold = 0.3f,
azimuthSeparationThreshold = 8.0f
},
new RadarScopeParameters
Expand Down Expand Up @@ -100,14 +110,19 @@ public static class RadarConfigurationLibrary
maxAzimuthAngle = 65.0f,
minElevationAngle = -7.5f,
maxElevationAngle = 7.5f,
frequency = 79.0f,
powerTransmitted = 31.0f,
cumulativeDeviceGain = 60.0f,
receivedNoiseMean = 93.0f,
receivedNoiseStDev = 2.0f,
scopeParameters = new[]
{
new RadarScopeParameters
{
beginDistance = 0.2f,
beginDistance = 0.1f,
endDistance = 9.5f,
distanceSeparationThreshold = 0.15f,
radialSpeedSeparationThreshold = 0.15f,
radialSpeedSeparationThreshold = 0.3f,
azimuthSeparationThreshold = 8.0f
},
new RadarScopeParameters
Expand All @@ -128,14 +143,19 @@ public static class RadarConfigurationLibrary
maxAzimuthAngle = 70.0f,
minElevationAngle = -14.0f,
maxElevationAngle = 14.0f,
frequency = 79.0f,
powerTransmitted = 31.0f,
cumulativeDeviceGain = 60.0f,
receivedNoiseMean = 93.0f,
receivedNoiseStDev = 2.0f,
scopeParameters = new[]
{
new RadarScopeParameters
{
beginDistance = 0.1f,
endDistance = 9.5f,
distanceSeparationThreshold = 0.15f,
radialSpeedSeparationThreshold = 0.15f,
radialSpeedSeparationThreshold = 0.3f,
azimuthSeparationThreshold = 8.0f
},
},
Expand Down
4 changes: 2 additions & 2 deletions Assets/RGLUnityPlugin/Scripts/RadarSensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ private void ApplyConfiguration(RadarConfiguration newConfig)
.UpdateNodeRaysSetRange(RadarRangeNodeId, newConfig.GetRayRanges())
.UpdateNodePointsRadarPostprocess(RadarPostprocessNodeId, newConfig.scopeParameters,
newConfig.azimuthResolution * Mathf.Deg2Rad, newConfig.elevationResolution * Mathf.Deg2Rad,
radarFrequencyHz, newConfig.powerTransmitted, newConfig.antennaGain, newConfig.receivedNoiseMean,
newConfig.receivedNoiseStDev)
radarFrequencyHz, newConfig.powerTransmitted, newConfig.cumulativeDeviceGain,
newConfig.receivedNoiseMean, newConfig.receivedNoiseStDev)
.UpdateNodeGaussianNoiseAngularRay(NoiseRaysNodeId,
newConfig.noiseParams.angularNoiseMean * Mathf.Deg2Rad,
newConfig.noiseParams.angularNoiseStDev * Mathf.Deg2Rad)
Expand Down
16 changes: 8 additions & 8 deletions docs/Components/Sensors/RadarSensor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ The pipeline consists of:
- `Max Elevation Angle` - maximum elevation angle (in degrees)
- `Frequency` - frequency of the wave propagation by the radar (in GHz)
- `Power Transmitted` - power transmitted by the radar (in dBm)
- `Antenna Gain` - gain of the radar's antenna (in dBi)
- `Received Noise Mean` - mean of the received noise (in dBm)
- `Received Noise St Dev` - standard deviation of the received noise (in dBm)
- `Cumulative Device Gain` - gain of the radar's antennas and any other gains of the device (in dBi)
- `Received Noise Mean` - mean of the received noise (in dB)
- `Received Noise St Dev` - standard deviation of the received noise (in dB)
- *Scope Parameters* - radar ability to separate (distinguish) different detections varies with the distance (e.g. by employing multiple frequency bands). Scope parameters allow to configure separation thresholds for different distance ranges (scopes):
- `Begin Distance` - begin of the distance interval where the following parameters are used
- `End Distance` - end of the distance interval where the following parameters are used
- `Distance Separation Threshold` - minimum distance between two points to be considered as separate detections
- `Radial Speed Seperation Threshold` - minimum radial speed difference between two points to be considered as separate detections
- `Azimuth Separation Threshold` - minimum azimuth difference between two points to be considered as separate detections
- `Begin Distance` - begin of the distance interval where the following parameters are used (in meters)
- `End Distance` - end of the distance interval where the following parameters are used (in meters)
- `Distance Separation Threshold` - minimum distance between two points to be considered as separate detections (in meters)
- `Radial Speed Seperation Threshold` - minimum radial speed difference between two points to be considered as separate detections (in meters per seconds)
- `Azimuth Separation Threshold` - minimum azimuth difference between two points to be considered as separate detections (in degrees)

#### Output Data

Expand Down
Binary file modified docs/Components/Sensors/RadarSensor/radar_component.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f9a0f67

Please sign in to comment.