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

Get quaternion from InertialUnit #2424

Merged
merged 30 commits into from Nov 4, 2020
Merged

Conversation

lukicdarkoo
Copy link
Member

@lukicdarkoo lukicdarkoo commented Nov 2, 2020

This PR adds support to the InertialUnit node that allows retrieval of quaternions. This allows us to avoid gimbal-lock and to be closer to the real sensor implementation. It also fixes orientation in ROS.

Physical Sensor Example
I used an MPU6050 sensor (driver implementation) as an example:

Non-related fixes

  • PointStamped is published by GPS instead of Point. This also fixes ROS tests.

Documentation
https://cyberbotics.com/doc/reference/inertialunit?version=feature-inertial-unit-quaternion

ROS Objective
The ROS layer should be changed, so RVIz and Webots orientation match if the coordinate system is ENU:
image

Related Issues
cyberbotics/webots_ros#37
cyberbotics/webots_ros#38

Tasks

  • Basic implementation
  • Decide on how the lookup table should be implemented
  • Add getter for noise parameter
  • Python/Java/Matlab
  • Documentation
  • Document gimbal-lock case
  • Changelog

@lukicdarkoo lukicdarkoo added bug Something isn't working enhancement Implementation of a minor feature labels Nov 2, 2020
@lukicdarkoo lukicdarkoo self-assigned this Nov 2, 2020
@lukicdarkoo lukicdarkoo added test ros Start the ros test test suite Start the test suite labels Nov 3, 2020
@lukicdarkoo lukicdarkoo marked this pull request as ready for review November 4, 2020 11:30
@lukicdarkoo lukicdarkoo requested a review from a team November 4, 2020 11:30
Copy link
Member

@omichel omichel left a comment

Choose a reason for hiding this comment

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

Thank you. It looks very good to me. A few minor change requests.

docs/reference/inertialunit.md Outdated Show resolved Hide resolved
docs/reference/inertialunit.md Outdated Show resolved Hide resolved
src/webots/maths/WbAxisAngle.hpp Show resolved Hide resolved
lukicdarkoo and others added 2 commits November 4, 2020 14:29
Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
@lukicdarkoo lukicdarkoo marked this pull request as draft November 4, 2020 14:09
@lukicdarkoo lukicdarkoo marked this pull request as ready for review November 4, 2020 14:53
Copy link
Member

@omichel omichel left a comment

Choose a reason for hiding this comment

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

Thank you!

@lukicdarkoo lukicdarkoo merged commit 09e1238 into develop Nov 4, 2020
@lukicdarkoo lukicdarkoo deleted the feature-inertial-unit-quaternion branch November 4, 2020 15:49
@@ -13,6 +13,7 @@ Released on December XXth, 2020.
- Added a new [`wb_supervisor_node_get_contact_point_node`](supervisor.md#wb_supervisor_node_get_contact_point_node) [Supervisor](supervisor.md) API function to get the node reference associated to a given contact point ([#2228](https://github.com/cyberbotics/webots/pull/2228)).
- Added two new functions to the [Camera](camera.md) API called [`wb_camera_get_exposure`](camera.md#wb_camera_get_exposure) and [`wb_camera_set_exposure`](camera.md#wb_camera_set_exposure) to retrieve and change the [Camera](camera.md) exposure ([#2363](https://github.com/cyberbotics/webots/pull/2363)).
- Added a new functionality in the [Recognition](recognition.md) node and [Camera](camera.md) API for generating segmented ground truth images ([#2199](https://github.com/cyberbotics/webots/pull/2199)).
- **Added a new [`wb_inertial_unit_get_quaternion`](inertialunit.md#wb_inertial_unit_get_quaternion) [InertialUnit](inertialunit.md) API function to get the orientation measurement represented as a quaternion ([#2424](https://github.com/cyberbotics/webots/pull/2424)).**
Copy link
Member

Choose a reason for hiding this comment

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

Why this entry is written in bold?
Does it break compatibility with previous version? if not it should not be in bold to be consistent with the rest of the ChangeLog.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, and we should also mention here in bold that a function was removed and another one was added (lookup table and noise).

Copy link
Member

Choose a reason for hiding this comment

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

It seems this comment has still not been solved, and in addition, the removal of the lookupTable field should be mentioned too.

@@ -21,7 +21,7 @@ InertialUnit {
field SFFloat radarCrossSection 0.0 # radar cross section of this solid
field MFColor recognitionColors [] # colors returned for this Solid by Cameras with a Recognition node
#fields specific to the InertialUnit node:
field MFVec3f lookupTable [] # empty: no interpolation
Copy link
Member

Choose a reason for hiding this comment

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

Usually, the field is actually kept in the '*.wrl' file (at the end) with the 'deprecatedField' keyword instead of 'field' so that a deprecation warning is automatically generated if needed. See for example: https://github.com/cyberbotics/webots/blob/master/resources/nodes/Camera.wrl#L46

@omichel
Copy link
Member

omichel commented Dec 1, 2020

I am taking care of fixing the remaining issues here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement Implementation of a minor feature test ros Start the ros test test suite Start the test suite
Development

Successfully merging this pull request may close these issues.

None yet

4 participants