Skip to content

Update camera.cpp#6411

Open
saarors wants to merge 1 commit intoPointCloudLibrary:masterfrom
saarors:patch-1
Open

Update camera.cpp#6411
saarors wants to merge 1 commit intoPointCloudLibrary:masterfrom
saarors:patch-1

Conversation

@saarors
Copy link

@saarors saarors commented Mar 3, 2026

move
Replaced manual Vector3d initialization (v << vx, vy, vz;) with direct constructor:
const Vector3d v(vx, vy, vz);
Avoided repeated calls to pose_.translation() by storing it in a const reference:
const Vector3d& t = pose_.translation();
Used that reference to assign x_, y_, z_.

updatePose
Declared rotation matrix m as const and initialized it directly instead of default-construct + assign.
Replaced:
pose_ *= m;
with:
pose_.linear() = m;
(more explicit and avoids unnecessary transform multiplication)
Replaced manual vector construction:
Vector3d v;
v << x_, y_, z_;
pose_.translation() = v;
with:
pose_.translation() = Vector3d(x_, y_, z_);

setParameters
Added const to local helper variables.
Precomputed:
const float inv_width;
const float inv_height;
instead of dividing by width_ and height_ multiple times.
Minor formatting alignment for readability.
Changed z_nf to const.

@mvieth
Copy link
Member

mvieth commented Mar 4, 2026

Hello, you have to fix the formatting, according to clang-format. Also, give this PR a more meaningful title. Otherwise I would have to assume that this is just a spam pull request.

@saarors
Copy link
Author

saarors commented Mar 4, 2026

ok thank

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.

2 participants