scenic.simulators.webots.utils
Various utilities for working with Webots scenarios.
Summary of Module Members
Module Attributes
The ENU coordinate system (the Webots default). |
|
The NUE coordinate system. |
|
The EUN coordinate system. |
Functions
Convert a Scenic position to a Webots position. |
|
Convert a Scenic heading to a Webots rotation vector. |
|
Convert a Webots position to a Scenic position. |
|
Convert a Webots rotation vector to a Scenic heading. |
Classes
A Webots coordinate system into which Scenic positions can be converted. |
Member Details
- class WebotsCoordinateSystem(system='ENU')[source]
A Webots coordinate system into which Scenic positions can be converted.
See the Webots documentation of WorldInfo.coordinateSystem for a discussion of the possible coordinate systems. Since Webots R2022a, the default coordinate axis convention is ENU (X-Y-Z=East-North-Up), which is the same as Scenic’s.
- rotationToScenic(rot, tolerance2D=None)[source]
Convert a Webots rotation vector to a Scenic heading.
Assumes the object lies in the Webots horizontal plane, with a rotation axis close to the up axis. If
tolerance2D
is given, returnsNone
if the orientation of the object is not sufficiently close to being 2D.
- ENU = <scenic.simulators.webots.utils.WebotsCoordinateSystem object>
The ENU coordinate system (the Webots default).
- NUE = <scenic.simulators.webots.utils.WebotsCoordinateSystem object>
The NUE coordinate system.
- EUN = <scenic.simulators.webots.utils.WebotsCoordinateSystem object>
The EUN coordinate system.
- webotsToScenicPosition(pos)[source]
Convert a Webots position to a Scenic position.
Drops the Webots Y coordinate.
Deprecated since version 2.1.0: Use
WebotsCoordinateSystem.positionToScenic
instead, dropping the third coordinate.
- scenicToWebotsPosition(pos, y=0, coordinateSystem='ENU')[source]
Convert a Scenic position to a Webots position.
Deprecated since version 2.1.0: Use
WebotsCoordinateSystem.positionFromScenic
instead.
- webotsToScenicRotation(rot, tolerance2D=None)[source]
Convert a Webots rotation vector to a Scenic heading.
Assumes the object lies in the Webots X-Z plane, with a rotation axis close to the Y axis. If
tolerance2D
is given, returnsNone
if the orientation of the object is not sufficiently close to being 2D.Deprecated since version 2.1.0: Use
WebotsCoordinateSystem.rotationToScenic
instead.
- scenicToWebotsRotation(heading)[source]
Convert a Scenic heading to a Webots rotation vector.
Deprecated since version 2.1.0: Use
WebotsCoordinateSystem.rotationFromScenic
instead.