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.
Yes, this is possible following these steps:
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.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 :-)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With