-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
ENU/FLU Conversion Plan #3073
ENU/FLU Conversion Plan #3073
Conversation
With this conversion, we are going to break the backward compatibility. It will not break the compatibility with the webots worlds as we are going to convert them, but it will break the user's worlds. Here is some reflexions we had with @ad-daniel and @mael25 Sensors
Another idea could be to check the webots version in the header of the .wbt file to determine if we should use the old or the new version of sensors. Protos
Some possible hints could be to:
We do not have an idea of a working solution for now and we think that it is better not to begin the conversion before having a solution about these problem, otherwise, we risk to have to start all over again. |
Note that the world (ENU/NUE...) and body (FLU/RUB...) are independent (see https://www.ros.org/reps/rep-0103.html#axis-orientation). Most users will use ENU and FLU together, but that is not a general rule.
Yes, I have just implemented it here and I have the same problem. What about adding a field to the WorldInfo called |
A problem would also arise if a user has defined his own proto that uses some webots protos (such as Sick S300 for example) |
Yes :/
Could be an idea. I do not really like the idea to add a new field, but I do not see a better solution. And if there is no deviceCoordinateSystem tag, it would be legacy by default. |
Would it be a solution to make the version in the .wbt persistent? |
I am not sure whether it is possible. I guess in 99% of cases it will work fine, but I am afraid there will be some uncovered edge cases. The PROTO issue you mentioned is a good point. What happens if the user adds an R2021b PROTO in an R2021c world? That will be a common case and non of the suggestions will work :/ |
One thing would be that we will have a warning everytime we open an old world. Otherwise I do not see an issue but I share your concerns about uncovered edge |
That is a tricky point indeed! if the user want to insert his R2021b proto inside a R2021c webots world, the world will be fine but not the proto. And if he changed the world to legacy mode, the proto will be fine, but not the world |
We can implement a
Once the world file is saved in R2021c+ Webots would append the That way we ease the transition and users can save world files. |
Does it mean that it would be possible to have both legacy and FLU devices inside the same proto? I think we should agree on a kind of tag to put as comment where we defined different behavior in the sensors, so it will ease the cleanup when we drop the legacy version. |
Also how do we handle the docs? |
Yes, we could mix them. Eventually, we can deprecate the
I think it is a way to go as we want to discourage people from using the legacy axis orientation. |
I meant in the .cpp files of Webots such that once we want to remove the legacy behavior it is easy to find every lines in the code where there is such a thing to remove
I agree |
Concerning the test suite, if we support sensors for both legacy and FLU, I think we will need to have two test suites in order to be sure that we do not break legacy or FLU :/ |
The main objectives are:
This is bad and we should avoid it because then old worlds will never be updated.
I would try to avoid adding a new field specifying the coordinate system for device (legacy or FLU) and keep it as last solution if we should not really be able to handle it properly internally in Webots. Instead I think we should focus on implementing some functionality inside Webots that automatically converts the old devices (based on Webots version) at load into the new ones, so that when saving the worlds they will already follow the new standard. Additionally, we should provide a script to upgrade PROTO models to R2021c and the new coordinate system.
This won't be necessary if Webots can convert internally the old device coordinate system into the new ones. |
I like the idea of converting worlds automatically. It is probably the most efficient way to force users to use the new conventions. However, there are a few challenges with that approach.
Let's consider a use-case in which a user uses a point cloud from a LiDAR. It's likely the user uses getPosition/getOrientation/getPose of the LiDAR node to transform the point cloud to another coordinate frame. Adding an additional transform will break the behavior. Not terrible, but we should be aware we cannot provide full backward compatibility.
We cannot make such a script, at least not if there is JavaScript/Lua inside.
The field can be hidden. |
If we convert automatically the world of a user when it is open, we should put an additional warning when he tries to save as it will heavily modify his .wbt and make it incompatible with previous version of webots. Another question concerns cylinders (also capsules and cones by extension). Cylinders are currently built along the Y axis. If we follow the ROS convention, and it is what we are trying to do with this PR, cylinders should be oriented along the Z-axis (http://wiki.ros.org/urdf/XML/link at <cylinder>) , we should change the default orientation of the cylinders/cone/capsule in webots as well. |
Yes. But users will continue to use the old coordinate system and won't update their worlds. If for some devices it would be useful to be able to specify the coordinate system (at least to guarantee the backward compatibility for some time), for others I really don't see the advantage, for example for the Where it is not strictly needed, I would automatically convert them.
We should at least provide a script for simple PROTO structures not using JavaScript/Lua.
Yes, of course we should print/ show a warning.
Yes, we should probably update the geometries too. |
I have checked the conventions for the sensors that have a specific axis measurements.
The As for the I would propose to use the x-axis for both of them, as the Shape of these devices in the Guided Tour suggests that the measurement is done on the forwards axis, which should be x (instead of z currently) if we use FLU: |
For infra-red |
I added a list of all PROTOs. I propose the following procedure:
|
…enu-plan Merge `develop` into `feature-enu-plan`
* fix animation initialization * merge webots-streaming and webots-animation * correct fullscreen and buttons * docs and sync * Update docs/guide/web-scene.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update docs/guide/web-scene.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update docs/guide/web-scene.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * rename x3d and json attributes * Update docs/guide/web-scene.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update docs/guide/web-simulation.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update docs/guide/web-simulation.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update docs/guide/web-simulation.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update docs/guide/web-animation.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * hasActiveAnimation to hasAnimation Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
* Remove additional rendering call after world is destroyed * reduce max number of lights * typo * add automatic close * update limitation example * typo * Update docs/guide/web-animation.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update docs/guide/web-simulation.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update docs/reference/light.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
* remove skybox rendering in orthographic mode * disable shadow
* first commit * Begin of humanoid_marathon * convert sumo world * Fix pillar * convert highways * clean + convert boomer * convert highway * convert cities + fix forest * fix crossroad * fix forest * fix forest + convert village * convert villages winter+realistic * convert village center + fix stripBuilding * fix forests + add script to convert them * fix fastFoodRestaurant * convert CH_Vens * convert ch_morges * convert humanoid marathon * fix robotis proto translation * fix humanoid marathon * clean + convert forst highway * swap y/z + protos fixes * fix forest * clean+ sumo update * convert sumo exporter * convert vehicle sensors * fix ibeoLux proto * pep8 compliance * fix highway_overtake * convert highway overtake * convert city net * convert city night * convert city traffic net * convert village net * convert village center net * convert village realistic net * fix sumo_interface_example traffic lights * convert radar target tracker controller * convert highway controller * highway * restore radar.c * fix robotbenchmark/highway_driving * fix humanoid_marathon.wbt * correct CH_Morges * fix buildings in CH_Morges * fix highway_overtake * fix building and route village_realistic * fix village_center route * convert webots vehicle * compliance * delete edges and nodes. * replace trip by flow for highway * Apply suggestions from code review Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * remove useless crossroad on highway.wbt * remove crossroads shape * correct roll and pitch * fix truck and tank simple * fixes from daniel reviews * add edge and node for sumo example * small fix ch_morges * fixes village_center * fix strange behaviour vehicle * fix turn and changeline SUMO * fix darwin * fix sumo center of rotation * pep8 * Update sumo (#3876) * update makefile * adapt sumo webots for 1.10.0 * add windows md5 * add linux md5 * add mac md5 * update docs * update docs * add SUMO dependencies * update tarball installation * add SUMO dependencies to linux compilation * update Makefile for ubuntu18.04 * fix change lane function * fix default translation * Update docs/automobile/sumo-exporter.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update projects/vehicles/protos/generic/TruckTrailerSimple.proto Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update projects/objects/road/protos/RoadPillars.proto Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * fix car_node + comment Co-authored-by: joachimhgg <joachim.honegger@gmail.com> Co-authored-by: Benjamin Deleze <benjamin.deleze@cyberbotics.com> Co-authored-by: Benjamin Délèze <benjamin.deleze@cyberbotics.ch> Co-authored-by: joachimhgg <48200998+joachimhgg@users.noreply.github.com> Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
* Converted web_component_studio to ENU * Aibo * Altino * Atlas * bb8 * bioloid * blimp * All robots * IRB * irb * irb * atlas * better viewpoint for altino and atlas * bb8 * khr2 * khr3 * ned * Fixed view for BB8, KHR2, KHR3 and NED * Fixed viewpoint for some robots
* first commit * Begin of humanoid_marathon * convert sumo world * Fix pillar * convert highways * clean + convert boomer * convert highway * convert cities + fix forest * fix crossroad * fix forest * fix forest + convert village * convert villages winter+realistic * convert village center + fix stripBuilding * fix forests + add script to convert them * fix fastFoodRestaurant * convert CH_Vens * convert ch_morges * convert humanoid marathon * fix robotis proto translation * fix humanoid marathon * clean + convert forst highway * swap y/z + protos fixes * fix forest * osm_importer * fix crosswalk and wall * clean+ sumo update * fix bug * correct elevation * convert sumo exporter * convert vehicle sensors * fix ibeoLux proto * pep8 compliance * fix highway_overtake * convert highway overtake * convert city net * convert city night * convert city traffic net * convert village net * convert village center net * convert village realistic net * fix sumo_interface_example traffic lights * convert radar target tracker controller * convert highway controller * highway * restore radar.c * fix robotbenchmark/highway_driving * fix humanoid_marathon.wbt * correct CH_Morges * fix buildings in CH_Morges * fix highway_overtake * fix building and route village_realistic * fix village_center route * convert webots vehicle * compliance * delete edges and nodes. * replace trip by flow for highway * Apply suggestions from code review Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * remove useless crossroad on highway.wbt * remove crossroads shape * correct roll and pitch * fix truck and tank simple * fixes from daniel reviews * add edge and node for sumo example * small fix ch_morges * fixes village_center * fix strange behaviour vehicle * fix turn and changeline SUMO * fix darwin * fix sumo center of rotation * pep8 * Update sumo (#3876) * update makefile * adapt sumo webots for 1.10.0 * add windows md5 * add linux md5 * add mac md5 * update docs * update docs * add SUMO dependencies * update tarball installation * add SUMO dependencies to linux compilation * update Makefile for ubuntu18.04 * fix change lane function * fix default translation * Update docs/automobile/sumo-exporter.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update projects/vehicles/protos/generic/TruckTrailerSimple.proto Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update projects/objects/road/protos/RoadPillars.proto Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * fix car_node + comment * pep8 Co-authored-by: ad-daniel <daniel.dias@epfl.ch> Co-authored-by: joachimhgg <joachim.honegger@gmail.com> Co-authored-by: Benjamin Délèze <benjamin.deleze@cyberbotics.ch> Co-authored-by: joachimhgg <48200998+joachimhgg@users.noreply.github.com> Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
* loadModel, closeModel * update docs for scene * update for scene * correct closing * model to scene * typo * Update docs/guide/web-animation.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update docs/guide/web-scene.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> * Update docs/guide/web-simulation.md Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com> Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
* Update viewer.js * Update webots.js
* Disable css when not needed * cascading
…ta… (#3950) * Fix crash when changing a world after the backward compability adaptation * better * Update WbNodeUtilities.cpp
* Fix extrusion * fix CrashBarrier bo * orientation * switch Y and Z to meet the VRML2 norm * fix extrusion protos * update script * pep8 * Update Morges wrong walls * pep8 * Update projects/objects/geometries/protos/Extrusion.proto Co-authored-by: ad-daniel <44834743+ad-daniel@users.noreply.github.com> * Update projects/objects/geometries/protos/Extrusion.proto Co-authored-by: ad-daniel <44834743+ad-daniel@users.noreply.github.com> * Update projects/objects/geometries/protos/Extrusion.proto Co-authored-by: ad-daniel <44834743+ad-daniel@users.noreply.github.com> * Update projects/objects/geometries/protos/Extrusion.proto Co-authored-by: ad-daniel <44834743+ad-daniel@users.noreply.github.com> * Update scripts/converter/convert_nue_to_enu_rub.py Co-authored-by: ad-daniel <44834743+ad-daniel@users.noreply.github.com> * Update projects/objects/geometries/protos/Extrusion.proto Co-authored-by: ad-daniel <44834743+ad-daniel@users.noreply.github.com> Co-authored-by: joachimhgg <joachim.honegger@gmail.com> Co-authored-by: ad-daniel <44834743+ad-daniel@users.noreply.github.com>
…enu-plan Merge develop into `feature-enu-plan`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
This PR includes ENU/FLU conversion changes.
Plan
1. Fix geometries orientation (#3510)
2. Fix sensor orientation
Some sensors don't respect the ENU/FLU convention, so we have to fix it first. Otherwise, the conversion has to be done twice (this will break MANY things).
realsense_ros_gazebo
package (Change Camera orientation to FLU #3472 (comment)), the camera follows FLU convention, it looks along the x-axis, and the z-axis is up. Optical frame: According to the CameraInfo documentation, ROS adds additional optical frame that follows the OpenCV camera convention. The camera looks along the positive z-axis while xy-axes match the standard image convention (see the image).shaftAxis
parameter the axis can be defined. Maybe we can change to z-axis default?3. Improve the conversion script
4. Convert device and object PROTOs
All PROTOs are converted and therefore commented out.
5. Convert robots
6. Convert worlds
8. Convert test worlds and test controllers
8. Merge to develop
develop
branch7. Fix tools and other simulations
Statistics
Number of NUE worlds: 487/567
/projects
: 269/287/tests
: 217/266A number of PROTO files: 972