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

Testing Windows fix #392

Merged
merged 6 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/CameraSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ bool CameraSensor::CreateCamera()
double cx = cameraSdf->LensIntrinsicsCx();
double cy = cameraSdf->LensIntrinsicsCy();
double s = cameraSdf->LensIntrinsicsSkew();
auto projectionMatrix = buildProjectionMatrix(
auto projectionMatrix = gz::sensors::buildProjectionMatrix(
this->dataPtr->camera->ImageWidth(),
this->dataPtr->camera->ImageHeight(),
fx, fy, cx, cy, s,
Expand Down Expand Up @@ -313,7 +313,7 @@ bool CameraSensor::CreateCamera()
double cy = cameraSdf->LensProjectionCy();
double s = 0;

auto projectionMatrix = buildProjectionMatrix(
auto projectionMatrix = gz::sensors::buildProjectionMatrix(
this->dataPtr->camera->ImageWidth(),
this->dataPtr->camera->ImageHeight(),
fx, fy, cx, cy, s,
Expand Down
11 changes: 6 additions & 5 deletions src/CameraSensorUtil.hh
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ math::Matrix4d buildPerspectiveMatrix(
/// This value is negative if the plane is to be behind
/// the camera
/// \return OpenGL projection matrix
math::Matrix4d buildProjectionMatrix(double _imageWidth, double _imageHeight,
double _intrinsicsFx, double _intrinsicsFy,
double _intrinsicsCx, double _intrinsicsCy,
double _intrinsicsS, double _clipNear,
double _clipFar);
math::Matrix4d GZ_SENSORS_VISIBLE buildProjectionMatrix(
Copy link
Contributor

@azeey azeey Oct 11, 2023

Choose a reason for hiding this comment

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

I think it would be better to compile CameraSensorUtil.cc with each of the components that need it rather than making it visible here since it now becomes part of our public ABI.

Edit: Technically, I think it is visible by default on linux, so it is part of the public ABI (unfortunately) already, but when gazebosim/gz-cmake#166 is resolved, this would break in Linux as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

testing alternative fix in d5b64ef

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Windows CI looks good with the new changes.

double _imageWidth, double _imageHeight,
double _intrinsicsFx, double _intrinsicsFy,
double _intrinsicsCx, double _intrinsicsCy,
double _intrinsicsS, double _clipNear,
double _clipFar);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/DepthCameraSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@
double cx = cameraSdf->LensIntrinsicsCx();
double cy = cameraSdf->LensIntrinsicsCy();
double s = cameraSdf->LensIntrinsicsSkew();
auto projectionMatrix = buildProjectionMatrix(
auto projectionMatrix = gz::sensors::buildProjectionMatrix(

Check warning on line 408 in src/DepthCameraSensor.cc

View check run for this annotation

Codecov / codecov/patch

src/DepthCameraSensor.cc#L408

Added line #L408 was not covered by tests
this->dataPtr->depthCamera->ImageWidth(),
this->dataPtr->depthCamera->ImageHeight(), fx, fy, cx, cy, s,
this->dataPtr->depthCamera->NearClipPlane(),
Expand Down Expand Up @@ -446,7 +446,7 @@
double cy = cameraSdf->LensProjectionCy();
double s = 0;

auto projectionMatrix = buildProjectionMatrix(
auto projectionMatrix = gz::sensors::buildProjectionMatrix(

Check warning on line 449 in src/DepthCameraSensor.cc

View check run for this annotation

Codecov / codecov/patch

src/DepthCameraSensor.cc#L449

Added line #L449 was not covered by tests
this->dataPtr->depthCamera->ImageWidth(),
this->dataPtr->depthCamera->ImageHeight(),
fx, fy, cx, cy, s,
Expand Down