Skip to content

fix arccos boundaries - #3934

Merged
joachimhgg merged 3 commits into
masterfrom
fix-acos-boundaries
Nov 18, 2021
Merged

joachimhgg merged 3 commits into
masterfrom
fix-acos-boundaries

Conversation

@joachimhgg

@joachimhgg joachimhgg commented Nov 18, 2021 •

Copy link
Copy Markdown
Contributor

Description

This PR is related to these two issues #3556 and #3915 and the PR #3741. The bug came from the clampedAcos function in WbMathsUtilities.hpp
The boundaries of acos are [0,pi] for the values between [-1,1].
So the clamp should happen for value ]-1,1[ and take the value 0 or pi. However, for performance reason we can clamp between [-1,1].

Otherwise, The NaN issue can be reproduced by sending a rotation exactly equals to M_PI [0, 0, 1,3.14159265358979323].

In addition, I added a ToString function to WbAxisAngle Class and a default precision to the toString function of WbRotation Class.

@joachimhgg
joachimhgg requested a review from a team November 18, 2021 11:51
Comment thread src/webots/maths/WbMathsUtilities.hpp Resolved
@joachimhgg
joachimhgg requested a review from omichel November 18, 2021 13:13
@omichel

omichel commented Nov 18, 2021

Copy link
Copy Markdown
Member

Please fix the clang-format failure.

@joachimhgg joachimhgg linked an issue Nov 18, 2021 that may be closed by this pull request

@ad-daniel ad-daniel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you.

@joachimhgg
joachimhgg removed the request for review from omichel November 18, 2021 13:34
@joachimhgg
joachimhgg merged commit 10f33c9 into master Nov 18, 2021
@joachimhgg
joachimhgg deleted the fix-acos-boundaries branch November 18, 2021 13:35
ad-daniel added a commit that referenced this pull request Nov 18, 2021
* Fix auto-regeneration crash (#3869)

* Fix auto-regeneration crash

* Fix typo

* Changelog entry

* Proper fix

* Update src/webots/nodes/utils/WbSupervisorUtilities.cpp

Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>

* Fix Clang format

Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>

* Update discord docs. (#3877)

Co-authored-by: DavidMansolino <DavidMansolino@github.com>

* Fixed line endings (#3880)

* Fixed line endings

* added driver.def

* Added car.def

* Update Solid.wrl (#3881)

* Fix lights cast shadow (#3883)

* Fix visibility distance

* remove comment

* max value + comment

* Update src/wren/Scene.cpp

Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>

* clang format

Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>

* Add supervisor tutorial (#3882)

* Beginning

* Handson 2

* Hands-on 3

* continuation

* hands-on 4

* format

* format test

* test

* Finalize

* Finalize

* Fix sources

* Fix errors

* Fix referenceS

* Remove reference

* Fix

* Add function links

* Fix

* Update docs/guide/tutorial-8-the-supervisor.md

Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>

* Review fixes

* minor

* Fix

* Fix matlab

Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>

* Cleanup wheel acceleration computation (#3854)

* Fix

* fix

* Update driver.c

Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>

* Update discord docs. (#3929)

Co-authored-by: DavidMansolino <DavidMansolino@github.com>

* fix arccos boundaries (#3934)

* fix acos boundaries + add ToString

* include boundaries for performance

* fix clang

Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: DavidMansolino <DavidMansolino@github.com>
Co-authored-by: Benjamin Délèze <benjamin.deleze@cyberbotics.com>
Co-authored-by: joachimhgg <48200998+joachimhgg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

wrong orientation of SUMO car when having pitch

3 participants