5

I just started with webots and are faced with the following problem:

Webots global coordinate frame defines its y-axis to show upwards (gravity vectory with negative y-component). However I would like to build a world around a coordinate frame in which the z-axis shows upwards.

Is it possibly to change this globally?

Thank you for your replies.

2 Answers2

3

Yes, this is possible following these steps:

  • The objects (Webots PROTOs or "level-0" Transform) should be rotated so that their bottom points towards the Z axis (negative). You can do this using the gizmo of the 3D view after selecting an object.
  • The WorldInfo.gravity field should be changed to 0 0 -9.81. In addition to change the gravity, this parameter also affects the way that the viewpoint move using the mouse.
  • WorldInfo.north should be modified if you plan to use Compass sensors in the simulation.
  • The cubic textures released in Webots for the background sky cube are oriented along the y-axis. Rotating them is not straight-forward. Removing the Background.cubmap is a quick solution, but it would avoid to have a good-looking rendering (PBR materials won't work well without a textured background). To go further, you have to create a custom set of textures for your world ($YOUR_PROJECT/worlds/textures/cubic/*.png). Probably that switching/rotating/renaming the textures is sufficient.

Note that in Webots, the global y-axis is upwards because of the VRML and X3D legacy. Lot of X3D exporters like Blender allow to change the down axis during the export. => It's not a bad idea to use the y-axis down :-)

FabienRohrer
  • 1,794
  • 2
  • 15
  • 26
  • There is a parameter in webots documentation, coordinateSystem that can take values ENU, NUE, or EUN. That looks like it should do the job. Unfortunately, it is not possible to find this field in the scene tree of webots R2020a rev1. – Miroslav Radojević Feb 02 '21 at 13:47
  • 1
    Indeed, this field has been introduced in R2021a. To use it, you should upgrade Webots. I expect that it solves some of the issues mentioned in my answer, but certainly not all of them. IMO this new field is quite confusing... – FabienRohrer Feb 07 '21 at 14:41
1

Since Webots R2020b, gravity is not a vector anymore. Instead, you can set the value of coordinateSystem field to ENU in the WorldInfo node:
https://cyberbotics.com/doc/reference/worldinfo

However, note that the coordinateSystem field will not affect the axis system of the objects. If you want to change an object's axis system to e.g. FLU (x-Forward, y-Left, z-Up) then you have to modify the object manually.

Darko Lukić
  • 161
  • 2
  • 6