Skip to content

Commit 47d8da2

Browse files
TonyWelteomichel
andauthored
Fix missing pi offset after merge of cyberbotics#6417 (cyberbotics#6525)
* Fix missing pi offset after merge of cyberbotics#6417 * Remove parentheses from ternary operation Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> --------- Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
1 parent 9f43f44 commit 47d8da2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/webots/nodes/WbLidar.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ void WbLidar::updatePointCloud(int minWidth, int maxWidth) {
427427
const double dtheta = mIsActuallyRotating ? (-2 * M_PI / (double)resolution) : (-actualFieldOfView() / w);
428428
const double cosdTheta = cos(dtheta);
429429
const double sindTheta = sin(dtheta);
430-
const double theta0 = mIsActuallyRotating ? (minWidth * dtheta) : (actualFieldOfView() / 2 + minWidth * dtheta + dtheta / 2);
430+
const double theta0 =
431+
mIsActuallyRotating ? minWidth * dtheta - M_PI : actualFieldOfView() / 2 + minWidth * dtheta + dtheta / 2;
431432
const double cosTheta0 = cos(theta0);
432433
const double sinTheta0 = sin(theta0);
433434

0 commit comments

Comments
 (0)