scenic.simulators.webots.model
Generic Scenic world model for the Webots simulator.
This model provides a general type of object WebotsObject
corresponding to a
node in the Webots scene tree, as well as a few more specialized objects.
Scenarios using this model cannot be launched directly from the command line
using the --simulate
option. Instead, Webots should be started first,
with a .wbt
file that includes nodes for all the objects in the scenario
(see the WebotsObject
documentation for how to specify which objects
correspond to which nodes). A supervisor node can then invoke Scenic to compile
the scenario and run dynamic simulations: see
scenic.simulators.webots.simulator for details.
Summary of Module Members
Functions
|
Classes
Special kind of object representing a (possibly irregular) ground surface. |
|
|
|
Abstract class for objects added together to make a |
|
Abstract class for Webots objects. |
Member Details
- class WebotsObject <specifiers>[source]
Bases:
Object
Abstract class for Webots objects.
There several ways to specify which Webots node this object corresponds to:
Set the
webotsName
property to the DEF name of the Webots node, which must already exist in the world loaded into Webots.Set the
webotsType
property to a prefix like ‘ROCK’: the interface will then search for nodes called ‘ROCK_0’, ‘ROCK_1’, etc. Again the nodes must already exist in the world loaded into Webots.Set the
webotsAdhoc
property to a dictionary of parameters. This will cause Scenic to dynamically create an Object in Webots, according to the parameters in the dictionary. This is currently the only way to create objects in Webots that do not correspond to an existing node. The parameters that can be contained in the dictionary are:physics
: Whether or not physics should be enabled for this object. Default value isTrue
.
- Properties:
elevation (float or None; dynamic) – default
None
(see above).requireVisible (bool) – Default value
False
(overriding the default fromObject
).webotsAdhoc (None | dict) – None implies this object is not Adhoc. A dictionary implies this is an object that Scenic should create in Webots.. If a dictionary, provides parameters for how to instantiate the adhoc object. See
scenic.simulators.webots.model
for more details.webotsName (str) – ‘DEF’ name of the Webots node to use for this object.
webotsType (str) – If
webotsName
is not set, the first available node with ‘DEF’ name consisting of this string followed by ‘_0’, ‘_1’, etc. will be used for this object.webotsObject – Is set at runtime to a handle to the Webots node for the object, for use with the Supervisor API. Primarily for internal use.
controller (str or None) – name of the Webots controller to use for this object, if any (instead of a Scenic behavior).
resetController (bool) – Whether to restart the controller for each simulation (default
True
).positionOffset (
Vector
) – Offset to add when computing the object’s position in Webots; for objects whose Webotstranslation
field is not aligned with the center of the object.rotationOffset (tuple[float, float, float]) – Offset to add when computing the object’s orientation in Webots; for objects whose front is not aligned with the Webots North axis.
density (float) – Density of this object in kg/m^3. The corresponding Webots object must have the
density
field.
- class Ground <specifiers>[source]
Bases:
WebotsObject
Special kind of object representing a (possibly irregular) ground surface.
Implemented using an ElevationGrid node in Webots.