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

Errors in rotation function in OSMPDummySensor #94

Closed
ClemensLinnhoff opened this issue Mar 14, 2023 · 0 comments · Fixed by #95
Closed

Errors in rotation function in OSMPDummySensor #94

ClemensLinnhoff opened this issue Mar 14, 2023 · 0 comments · Fixed by #95
Assignees
Labels
bug Problems in the build system, build scripts, etc or faults in the interface.

Comments

@ClemensLinnhoff
Copy link
Contributor

ClemensLinnhoff commented Mar 14, 2023

Describe the bug

In the rotatePoint() function of the OSMPDummySensor, a rotation matrix is calculated. Then the rotation matrix is multiplied by the relative translation of an object to the ego vehicle to get the relativ position considering the orientation of the ego.
However, since this is a transformation from a global coordinate system to a local coordinate system, it has to be the inverse (or transpose) of the rotation matrix multiplied by the translation. This is described in the OSI documentation of the orientation field:

image

Furthermore, when the rotatePoint() function is called in the doCalc() function, the orientation of the object is passed to the function instead of the ego orientation.

Describe how to reproduce the bug

Run a unit test on rotatePoint() and feed it e.g. a relative translation of (5,3,0) and a rotation of yaw = pi/2. This should result in a position of (3,-5,0). But instead it yields (-3,-5,0).
This example was run in a unit test in the OpenMSL template repo, which is based on the OSMPDummySensor. You can find the failed test result here.

Describe the expected behavior

see example above

Describe the OS you are using

  • OS: Ubuntu 22.04
  • Language: C++
  • Version 1.3.0
@ClemensLinnhoff ClemensLinnhoff added the bug Problems in the build system, build scripts, etc or faults in the interface. label Mar 14, 2023
@ClemensLinnhoff ClemensLinnhoff self-assigned this Mar 14, 2023
@pmai pmai closed this as completed in #95 Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Problems in the build system, build scripts, etc or faults in the interface.
Projects
None yet
1 participant