Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add energy computation to RadarPostProcessNode #255

Merged
merged 7 commits into from
Mar 5, 2024

Conversation

prybicki
Copy link
Collaborator

No description provided.

@@ -295,6 +295,11 @@ typedef enum : int32_t
*/
RGL_FIELD_INCIDENT_ANGLE_F32,

/**
* 3x4 matrix describing pose of the ray in the TODO coordinate system.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO -> world?

NORMAL_VEC3_F32,
INCIDENT_ANGLE_F32,
};
static std::set<rgl_field_t> allRealFields = {XYZ_VEC3_F32,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is formatting here fine? Previous one seems correct.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both are the result of our clang-format. The new one misses the colon at the end of list, which causes different formatting. Fixed that.

const Vec3f dirZ = {0, 0, 1};

Vec3f rayDirCts = rayPose[tid] * Vec3f{0, 0, 1};
Vec3f rayDirSph = {rayDirCts.length(), rayDirCts[0] == 0 && rayDirCts[1] == 0 ? 0 : atan2(rayDirCts.y(), rayDirCts.x()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (cts to sph) may be useful as some general math function.

Vec3f rayDirCts = rayPose[tid] * Vec3f{0, 0, 1};
Vec3f rayDirSph = {rayDirCts.length(), rayDirCts[0] == 0 && rayDirCts[1] == 0 ? 0 : atan2(rayDirCts.y(), rayDirCts.x()),
std::acos(rayDirCts.z() / rayDirCts.length())};
float phi = rayDirSph[1]; // azimuth, 0 = X-axis, positive = CCW
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and some variables below may be made const.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added const where possible.

LIMIT(count);

constexpr float c0 = 299792458.0f;
constexpr float freq = 79E9f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should become a parameter in general, because this exact value may be specific for SmartMicro radar.

Vec3f vecK = waveNum * ((dirX * cp + dirY * sp) * st + dirZ * ct);

float rayArea = hitDist[tid] * hitDist[tid] * std::sin(rayElevationStepRad) * rayAzimuthStepRad;
Vector<3, thrust::complex<float>> outBUBRFactor = {0, 0, 0};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that this not match this function signature, where you have three separate complex numbers for values.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

return -polCompR * refPolR + polCompU * refPolU;
}

float getRayArea(float R) { return R * R * std::sin(elevationRad) * azimuthRad; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
float getRayArea(float R) { return R * R * std::sin(elevationRad) * azimuthRad; }
float getRayArea(float R) { return R * R * std::sin(elevationStep) * azimuthStep; }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed manually

@prybicki prybicki merged commit 0db92eb into develop Mar 5, 2024
19 of 20 checks passed
@prybicki prybicki deleted the feature/rcs-radar-nodes branch March 5, 2024 09:29
msz-rai pushed a commit that referenced this pull request Jun 11, 2024
* Fix bugs

* Add ray area computation

* Fix calculating ray polarization. Update ray directions calculation.

Signed-off-by: Paweł Liberadzki <[email protected]>

* Add RAY_POSE field

* Implement BU, BR computation on GPU

* Call energy computation in RadarPostprocessPointsNode

* Review fixes

---------

Signed-off-by: Paweł Liberadzki <[email protected]>
Co-authored-by: Paweł Liberadzki <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants