diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000000..e69de29bb2 diff --git a/404.html b/404.html new file mode 100644 index 0000000000..ce7e2627ed --- /dev/null +++ b/404.html @@ -0,0 +1,2348 @@ + + + + + + + + + + + + + + + + + + + AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ +

404 - Not found

+ +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Clock/ClockPublisher/clock_publisher_threads.png b/Components/Clock/ClockPublisher/clock_publisher_threads.png new file mode 100644 index 0000000000..12eff42cdd Binary files /dev/null and b/Components/Clock/ClockPublisher/clock_publisher_threads.png differ diff --git a/Components/Clock/ClockPublisher/index.html b/Components/Clock/ClockPublisher/index.html new file mode 100644 index 0000000000..0bcc2ebf46 --- /dev/null +++ b/Components/Clock/ClockPublisher/index.html @@ -0,0 +1,2727 @@ + + + + + + + + + + + + + + + + + + + + + + + Clock Publisher - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Clock Publisher

+ +

Introduction

+

ClockPublisher allows the publication of the simulation time from the clock operating within AWSIM. The current time is retrived from a TimeSource object via the SimulatorROS2Node. The AWSIM provides convenient method for selecting the appropriate time source type as well as the flexibility to implement custom TimeSources tailored to specific user requirements.

+

Setup

+

To enable the publication of the current time during simulation execution, ClockPublisher must be included as a component within the scene. Moreover, to allow the TimeSource to be set or changed, the TimeSourceSelector object must also be present in the active scene.

+

time_source_selector_hierarchy

+

Selecting Time Source

+

The desired TimeSource can be selected in two ways:

+
    +
  • Inspector Selection: TimeSource type can be conveniently choosen directly from the editor interface.
  • +
+

time_source_selector_inspector

+
    +
  • JSON Configuration File: Alternatively, the TimeSource type can be specified in the JSON configuration file via the TimeSource field. The supported values for this field can be found in the list of available time sources in the "String Value for JSON Config" column.
  • +
+

time_source_selector_config

+

List of Time Sources

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeString Value for JSON ConfigDriven byStart ValueAffected by Time ScaleRemarks
UNITYunityUnityEngine.Time0yes
SS2ss2externallydepends on external sourcenoused by the scenario simulator v2
DOTNET_SYSTEMsystemSystem.DateTimeUNIX epochyesstarts with UNIX epoch time and progresses with System.DateTime scaled by AWSIM time scale
DOTNET_SIMULATIONsimulationSystem.DateTime0yesstarts with zero value and progresses with System.DateTime scaled by AWSIM time scale
ROS2ros2ROS2.ClockUNIX epoch (by default)nouses ROS 2 time
+

Architecture

+

The ClockPublisher operates within a dedicated thread called the 'Clock' thread. This design choice offers significant advantages by freeing the publishing process from the constraints imposed by fixed update limits. As a result, ClockPublisher is able to consistently publish time at a high rate, ensuring stability and accuracy.

+

Accessing Time Source

+

Running the clock publisher in a dedicated thread introduced the challenge of accessing shared resources by different threads. In our case, the Main Thread and Clock Thread compete for TimeSoruce resources. The diagram below illustrates this concurrent behaviour, with two distinct threads vying for access to the TimeSource:

+
    +
  • Main Thread: included publishing message by sensors (on the diagram blueish region labeled sensor loop),
  • +
  • Clock Thread: included clock publisher (on the diagram blueish region labeled clock loop).
  • +
+

Given multiple sensors, each with its own publishing frequency, alongside a clock running at 100Hz, there is a notable competition for TimeSource resources. In such cases, it becomes imperative for the TimeSource class to be thread-safe.

+

clock_publisher_threads

+

Thread-Safe Time Source

+

The TimeSource synchronization mechanism employs a mutex to lock the necessary resource for the current thread. The sequence of actions undertaken each time the GetTime() method is called involves:

+
    +
  • acquiring the lock,
  • +
  • getting the current time, e.g. system time since epoch, (this may be different for each type of time source),
  • +
  • obtaining the current simulation time-scale,
  • +
  • calculating the delta time since previous call, influenced by the time scale,
  • +
  • returning the current time,
  • +
  • releasing the lock.
  • +
+

time_source_mutex

+

Extensions

+

There are two additional classes used to synchronise the UnityEngine TimeAsDouble and TimeScale values between threads:

+
    +
  • TimeScaleProvider: facilitates the synchronisation of the simulation time scale value across threads,
  • +
  • TimeAsDoubleProvider: provides access to the UnityEngine TimeAsDouble to the threads other than the main thread.
  • +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Clock/ClockPublisher/time_source_mutex.png b/Components/Clock/ClockPublisher/time_source_mutex.png new file mode 100644 index 0000000000..c3d717d10a Binary files /dev/null and b/Components/Clock/ClockPublisher/time_source_mutex.png differ diff --git a/Components/Clock/ClockPublisher/time_source_selector_config.png b/Components/Clock/ClockPublisher/time_source_selector_config.png new file mode 100644 index 0000000000..c7343471de Binary files /dev/null and b/Components/Clock/ClockPublisher/time_source_selector_config.png differ diff --git a/Components/Clock/ClockPublisher/time_source_selector_hierarchy.png b/Components/Clock/ClockPublisher/time_source_selector_hierarchy.png new file mode 100644 index 0000000000..bc7cfc7ce4 Binary files /dev/null and b/Components/Clock/ClockPublisher/time_source_selector_hierarchy.png differ diff --git a/Components/Clock/ClockPublisher/time_source_selector_inspector.png b/Components/Clock/ClockPublisher/time_source_selector_inspector.png new file mode 100644 index 0000000000..581cb54ec6 Binary files /dev/null and b/Components/Clock/ClockPublisher/time_source_selector_inspector.png differ diff --git a/Components/Environment/AWSIMEnvironment/directional_light.png b/Components/Environment/AWSIMEnvironment/directional_light.png new file mode 100644 index 0000000000..34e4eb3cb3 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/directional_light.png differ diff --git a/Components/Environment/AWSIMEnvironment/directional_light_prefab.png b/Components/Environment/AWSIMEnvironment/directional_light_prefab.png new file mode 100644 index 0000000000..0ebac301a9 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/directional_light_prefab.png differ diff --git a/Components/Environment/AWSIMEnvironment/environment.png b/Components/Environment/AWSIMEnvironment/environment.png new file mode 100644 index 0000000000..422a2e2183 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/environment.png differ diff --git a/Components/Environment/AWSIMEnvironment/environment_link.png b/Components/Environment/AWSIMEnvironment/environment_link.png new file mode 100644 index 0000000000..3f78f306ce Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/environment_link.png differ diff --git a/Components/Environment/AWSIMEnvironment/environment_link_2.png b/Components/Environment/AWSIMEnvironment/environment_link_2.png new file mode 100644 index 0000000000..934f4ffce5 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/environment_link_2.png differ diff --git a/Components/Environment/AWSIMEnvironment/environment_prefab.png b/Components/Environment/AWSIMEnvironment/environment_prefab.png new file mode 100644 index 0000000000..b0aadfd66e Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/environment_prefab.png differ diff --git a/Components/Environment/AWSIMEnvironment/environment_script.png b/Components/Environment/AWSIMEnvironment/environment_script.png new file mode 100644 index 0000000000..21fe7de383 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/environment_script.png differ diff --git a/Components/Environment/AWSIMEnvironment/index.html b/Components/Environment/AWSIMEnvironment/index.html new file mode 100644 index 0000000000..dcf59321fd --- /dev/null +++ b/Components/Environment/AWSIMEnvironment/index.html @@ -0,0 +1,3082 @@ + + + + + + + + + + + + + + + + + + + + + + + AWSIM Environment - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

AWSIM Environment

+

Introduction

+

Environment is an object that contains all the elements visible on the scene along with components that affect how they are rendered. +It contains several objects aggregating static environment objects in terms of their type. +Moreover, it contains elements responsible for controlling random traffic.

+

environment

+
+

Own Environment prefab

+

If you would like to develop your own prefab Environment for AWSIM, we encourage you to read this tutorial.

+
+
+

AutowareSimulation scene

+

If you would like to see how Environment with random traffic works or run some tests, we encourage you to familiarize yourself with the AutowareSimulation scene described in this section.

+
+

Prefab Environment is also used to create a point cloud (*.pcd file) needed to locate the EgoVehicle in the simulated AWSIM scene. +The point cloud is created using the RGL plugin and then used in Autoware. +We encourage you to familiarize yourself with an example scene of creating a point cloud - described here.

+
+

Create PointCloud (*.pcd file)

+

If you would like to learn how to create a point cloud in AWSIM using Environment prefab, we encourage you to read this tutorial.

+
+

Architecture

+

The architecture of an Environment - with dependencies between components - is presented on the following diagram.

+

environment diagram

+

Prefabs

+

Prefabs can be found under the following path:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionPath
NishishinjukuOnly stationary visual elements, no trafficAssets/AWSIM/Prefabs/Environments/Nishishinjuku.prefab
Nishishinjuku RandomTrafficStationary visual elements along with random trafficAssets/AWSIM/Prefabs/Environments/Nishishinjuku RandomTraffic.prefab
Nishishinjuku TrafficStationary visual elements along with non-random trafficAssets/AWSIM/Prefabs/Environments/Nishishinjuku Traffic.prefab
+
+

Environment prefab

+

Due to the similarity of the above prefabs, this section focuses on prefab Nishishinjuku RandomTraffic. +The exact differences between Nishishinjuku RandomTraffic and Nishishinjuku Traffic will be described in the future.

+
+
+

Environment name

+

In order to standardize the documentation, the name Environment will be used in this section as the equivalent of the prefab named Nishishinjuku RandomTraffic.

+
+

Nishishinjuku RandomTraffic prefab has the following content:

+

environment_link

+

As you can see it contains:

+
    +
  • SJK* objects - which are aggregators for visual models.
  • +
  • RandomTrafficSimulator, TrafficIntersections, TrafficLanes, StopLines - which are responsible for random traffic of NPCVehicles.
  • +
  • NPCPedestrians - which is an aggregator of NPCPedestrian prefabs added to the scene.
  • +
  • Volume, Directional Light - which are components that affect the appearance of objects on the scene.
  • +
+

All of these objects are described below in this section.

+

Visual elements

+

Nishishinjuku RandomTraffic prefab contains many visual elements which are described here.

+ +

Nishishinjuku RandomTraffic prefab is added to the Environment object - between which there is rotation about the Oy axis by 90 degrees. +This rotation is added because of the differences in coordinate alignments between the Nishishinjuku RandomTraffic prefab objects (which have been modeled as *.fbx files) and the specifics of the GridZone definition (more on this is described here).

+

Object Environment is added to AutowareSimulation which is added directly to the main parent of the scene - there are no transformations between these objects.

+

environment_link_2

+

Components

+

environment_prefab

+

Nishishinjuku RandomTraffic (Environment) prefab contains only one component:

+
    +
  • Environment (script) - which is important for communicating with Autoware and loading elements from Lanelet2. +Because it allows to define the location of the environment in relation to the world.
  • +
+

Layers

+

In order to enable the movement of vehicles around the environment, additional layers have been added to the project: Ground and Vehicle.

+

layers

+

All objects that are acting as a ground for NPCVehicles and EgoVehicle to move on have been added to Ground layer - they cannot pass through each other and should collide for the physics engine to calculate their interactions.

+

model_layer

+

For this purpose, NPCVehicles and EgoVehicle have been added to the Vehicle layer.

+

vehicle_layer

+

In the project physics settings, it is ensured that collisions between objects in the Vehicle layer are disabled (this applies to EgoVehicle and NPCVehicles - they do not collide with each other):

+

layers_physis

+

Traffic Components

+

Due to the specificity of the use of RandomTrafficSimulator, TrafficIntersections, TrafficLanes, StopLines objects, they have been described in a separate section Traffic Components - where all the elements necessary in simulated random traffic are presented.

+

Visual Elements (SJK)

+

The visuals elements have been loaded and organized using the *.fbx files which can be found under the path:

+
Assets/AWSIM/Externals/Nishishinjuku/Nishishinjuku_optimized/Models/*
+
+

Environment prefab contains several objects aggregating stationary visual elements of space by their category:

+
    +
  • +

    SJK01_P01 - contains all objects constituting the ground of the environment, these are roads and green fields - each of them contains a MeshColliders and layer set as Ground to ensure collisions with NPCVehicles and EgoVehicle.

    +

    sjk1

    +
  • +
  • +

    SJK01_P02 - contains all road surface markings on roads added to the environment. +The objects of this group do not have MeshColliders and their layer is Default.

    +

    sjk2

    +
  • +
  • +

    SJK01_P03 - contains all the vertical poles added to the environment, such as lamp posts, road signs and traffic light poles. +Only TrafficLight poles and PedestrianLight poles have MeshCollider added. +The layer for all objects is Default.

    +

    sjk3

    +
  • +
  • +

    SJK01_P04 - contains all barriers added to the environment, such as barriers by sidewalks. +The objects of this group do not have MeshColliders and their layer is Default.

    +

    sjk4

    +
  • +
  • +

    SJK01_P05 - contains all greenery added to the environment, such as trees, shrubs, fragments of greenery next to buildings. +The objects of this group do not have MeshColliders and their layer is Default.

    +

    sjk5

    +
  • +
  • +

    SJK01_P06 - contains all buildings added to the environment. +Objects of this category also have a MeshCollider added, but their layer is Default.

    +

    sjk6

    +
  • +
+
+

Scene Manager

+

For models (visual elements) added to the prefab to work properly with the LidarSensor sensor using RGL, make sure that the SceneManager component is added to the scene - more about it is described in this section.

+

In the scene containing Nishishinjuku RandomTrafficprefab Scene Manager (script) is added as a component to the AutowareSimulation object containing the Environment.

+

scene_manager

+
+

TrafficLights

+

TrafficLights are a stationary visual element belonging to the SJK01_P03 group. +The lights are divided into two types, the classic TrafficLights used by vehicles at intersections and the PedestrianLights found at crosswalks.

+

sjk_lights_link

+

Classic traffic lights are aggregated at object TrafficLightA01_Root01_ALL_GP01

+

pedestrian_light_link

+

while lights used by pedestrians are aggregated at object TrafficLightB01_Root01_All_GP01.

+

pedestrian_light_link

+

TrafficLights and PedestrianLights are developed using models available in the form of *.fbx files, which can be found under the following path:
+Assets/AWSIM/Externals/Nishishinjuku/Nishishinjuku_opimized/Models/TrafficLights/Models/*

+

Classic TrafficLights

+

light

+

TrafficLights lights, outside their housing, always contain 3 signaling light sources of different colors - from left to right: green, yellow, red. +Optionally, they can have additional sources of signaling the ability to drive in a specific direction in the form of one or three signaling arrows.

+

light_prefab

+

In the environment there are many classic lights with different signaling configurations. +However, each contains:

+
    +
  • Transform - defines the position of the lights in the environment relative to the main parent of the group (SJK01_P03).
  • +
  • Mesh Filter - contains a reference to the Mesh of the object.
  • +
  • Mesh Renderer - enables the rendering of Mesh, including its geometry, textures, and materials, giving it a visual appearance in the scene.
  • +
  • Mesh Collider - allows an object to have collision detection based on Mesh.
  • +
  • Traffic Light (script) - provides an interface to control signaling by changing the emission of materials. +This script is used for simulated traffic, so it is described.
  • +
+
Materials
+

An important element that is configured in the TrafficLights object are the materials in the Mesh Renderer component. +Material with index 0 always applies to the housing of the lights. +Subsequent elements 1-6 correspond to successive slots of light sources (round luminous objects) - starting from the upper left corner of the object in the right direction, to the bottom and back to the left corner. +These indexes are used in script Traffic Light (script) - described here.

+

lights_mesh

+

Materials for lighting slots that are assigned in Mesh Renderer can be found in the following path: +Assets/AWSIM/Externals/Nishishinjuku/Nishishinjuku_opimized/Models/TrafficLights/Materials/*

+

PedestrianLights

+

pedestrian_light

+

PedestrianLights lights, outside their housing, always contain 2 signaling light sources of different colors - red on top and green on the bottom.

+

pedestrian_lights_prefab

+

In the environment there are many pedestrian lights - they have the same components as classic TrafficLights, but the main difference is the configuration of their materials.

+
Materials
+

An important element that is configured in the PedestrianLights object are the materials in the Mesh Renderer component. +Material with index 0 always applies to the housing of the lights. +Subsequent elements 1-2 correspond to successive slots of light sources (round luminous objects) - starting from top to bottom. +These indexes are used in script Traffic Light (script) - described here.

+

pedestrian_lights_mesh
+Materials for lighting slots that are assigned in Mesh Renderer can be found in the following path: +Assets/AWSIM/Externals/Nishishinjuku/Nishishinjuku_opimized/Models/TrafficLights/Materials/*

+

Volume

+

volume

+

Volume is GameObject with Volume component which is used in the High Definition Render Pipeline (HDRP). +It defines a set of scene settings and properties. +It can be either global, affecting the entire scene, or local, influencing specific areas within the scene. +Volumes are used to interpolate between different property values based on the Camera's position, allowing for dynamic changes to environment settings such as fog color, density, and other visual effects.

+

In case of prefab Nishishinjuku RandomTraffic volume works in global mode and has loaded Volume profile. +This volume profile has a structure that overrides the default properties of Volume related to the following components: Fog, Shadows, Ambient Occlusion, Visual Environment, HDRI Sky. +It can be found in the following path:
+Assets/AWSIM/Prefabs/Environments/Nishishinjuku/Volume Profile.asset

+

Directional Light

+

directional_light_prefab

+

Directional Light is GameObject with Light component which is used in the High Definition Render Pipeline (HDRP). +It controls the shape, color, and intensity of the light. +It also controls whether or not the light casts shadows in scene, as well as more advanced settings.

+

In case of prefab Nishishinjuku RandomTraffic a Directional type light is added. +It creates effects that are similar to sunlight in scene. +This light illuminates all GameObjects in the scene as if the light rays are parallel and always from the same direction. +Directional light disregards the distance between the Light itself and the target, so the light does not diminish with distance. +The strength of the Light (Intensity) is set to 73123.09 Lux. +In addition, a Shadow Map with a resolution of 4096 is enabled, which is updated in Every Frame of the simulation. +The transform of the Directional Light object is set in such a way that it shines on the environment almost vertically from above.

+

directional_light

+

NPCPedestrians

+

NPCPedestrians is an aggregating object for NPCPedestrian objects placed in the environment. +Prefab Nishishinjuku RandomTraffic has 7 NPCPedestrian (humanElegant) prefabs defined in selected places. +More about this NPCPedestrian prefab you can read in this section.

+

Environment (script)

+ +

environment_script

+

Environment (script) contains the information about how a simulated Environment is positioned in real world. +That means it describes what is the real world position of a simulated Environment.

+

AWSIM uses part of a Military Grid Reference System (MGRS). +To understand this topic, you only need to know, that using MGRS you can specify distinct parts of the globe with different accuracy. +For AWSIM the chosen accuracy is a 100x100 km square. +Such a square is identified with a unique code like 54SUE (for more information on Grid Zone please see this page).

+

Inside this Grid Zone the exact location is specified with the offset calculated from the bottom-left corner of the Grid Zone. +You can interpret the Grid Zone as a local coordinate system in which you position the Environment.

+

In the Nishishinjuku RandomTraffic prefab, the simulated Environment is positioned in the Grid Zone 54SUE. +The offset if equal to 81655.73 meters in the Ox axis, 50137.43 meters in the Oy axis and 42.49998 meters in the Oz axis. +In addition to this shift, it is also necessary to rotate the Environment in the scene by 90 degrees about the Oy axis - this is ensured by the transform in the prefab object.

+

This means that the 3D models were created in reference to this exact point and because of that the 3D models of Environment align perfectly with the data from Lanelet2.

+
+

The essence of Environment (script)

+

The Environment (script) configuration is necessary at the moment of loading data from Lanelet2.

+

Internally it shifts the elements from Lanelet2 by the given offset so that they align with the Environment that is located at the local origin with no offset.

+
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Environment/AWSIMEnvironment/layers.png b/Components/Environment/AWSIMEnvironment/layers.png new file mode 100644 index 0000000000..bcebe7eed4 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/layers.png differ diff --git a/Components/Environment/AWSIMEnvironment/layers_physis.png b/Components/Environment/AWSIMEnvironment/layers_physis.png new file mode 100644 index 0000000000..f0dccc9eaa Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/layers_physis.png differ diff --git a/Components/Environment/AWSIMEnvironment/lights/light.png b/Components/Environment/AWSIMEnvironment/lights/light.png new file mode 100644 index 0000000000..e041f88f1c Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/lights/light.png differ diff --git a/Components/Environment/AWSIMEnvironment/lights/light_prefab.png b/Components/Environment/AWSIMEnvironment/lights/light_prefab.png new file mode 100644 index 0000000000..7f16ad753e Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/lights/light_prefab.png differ diff --git a/Components/Environment/AWSIMEnvironment/lights/lights_arrow.png b/Components/Environment/AWSIMEnvironment/lights/lights_arrow.png new file mode 100644 index 0000000000..767bd6b3c3 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/lights/lights_arrow.png differ diff --git a/Components/Environment/AWSIMEnvironment/lights/lights_collider.png b/Components/Environment/AWSIMEnvironment/lights/lights_collider.png new file mode 100644 index 0000000000..5e51801824 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/lights/lights_collider.png differ diff --git a/Components/Environment/AWSIMEnvironment/lights/lights_link.png b/Components/Environment/AWSIMEnvironment/lights/lights_link.png new file mode 100644 index 0000000000..ddf1dbc8a5 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/lights/lights_link.png differ diff --git a/Components/Environment/AWSIMEnvironment/lights/lights_materials.png b/Components/Environment/AWSIMEnvironment/lights/lights_materials.png new file mode 100644 index 0000000000..52af405829 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/lights/lights_materials.png differ diff --git a/Components/Environment/AWSIMEnvironment/lights/pedestian_lights_link.png b/Components/Environment/AWSIMEnvironment/lights/pedestian_lights_link.png new file mode 100644 index 0000000000..70e05ce6f1 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/lights/pedestian_lights_link.png differ diff --git a/Components/Environment/AWSIMEnvironment/lights/pedestrian_light.png b/Components/Environment/AWSIMEnvironment/lights/pedestrian_light.png new file mode 100644 index 0000000000..4b84fd26b8 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/lights/pedestrian_light.png differ diff --git a/Components/Environment/AWSIMEnvironment/lights/pedestrian_lights_materials.png b/Components/Environment/AWSIMEnvironment/lights/pedestrian_lights_materials.png new file mode 100644 index 0000000000..d5bf5a3a2b Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/lights/pedestrian_lights_materials.png differ diff --git a/Components/Environment/AWSIMEnvironment/lights/pedestrian_lights_prefab.png b/Components/Environment/AWSIMEnvironment/lights/pedestrian_lights_prefab.png new file mode 100644 index 0000000000..82729e4c85 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/lights/pedestrian_lights_prefab.png differ diff --git a/Components/Environment/AWSIMEnvironment/lights/sjk_lights_link.png b/Components/Environment/AWSIMEnvironment/lights/sjk_lights_link.png new file mode 100644 index 0000000000..6745087692 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/lights/sjk_lights_link.png differ diff --git a/Components/Environment/AWSIMEnvironment/link.png b/Components/Environment/AWSIMEnvironment/link.png new file mode 100644 index 0000000000..04aa35e169 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/link.png differ diff --git a/Components/Environment/AWSIMEnvironment/model_layer.png b/Components/Environment/AWSIMEnvironment/model_layer.png new file mode 100644 index 0000000000..eb20fd4c17 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/model_layer.png differ diff --git a/Components/Environment/AWSIMEnvironment/scene_manager.png b/Components/Environment/AWSIMEnvironment/scene_manager.png new file mode 100644 index 0000000000..cb94c3486b Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/scene_manager.png differ diff --git a/Components/Environment/AWSIMEnvironment/sjk1.png b/Components/Environment/AWSIMEnvironment/sjk1.png new file mode 100644 index 0000000000..0de8344f58 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/sjk1.png differ diff --git a/Components/Environment/AWSIMEnvironment/sjk2.png b/Components/Environment/AWSIMEnvironment/sjk2.png new file mode 100644 index 0000000000..0fb33cef59 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/sjk2.png differ diff --git a/Components/Environment/AWSIMEnvironment/sjk3.png b/Components/Environment/AWSIMEnvironment/sjk3.png new file mode 100644 index 0000000000..7ec5e9b837 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/sjk3.png differ diff --git a/Components/Environment/AWSIMEnvironment/sjk4.png b/Components/Environment/AWSIMEnvironment/sjk4.png new file mode 100644 index 0000000000..432eed37e8 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/sjk4.png differ diff --git a/Components/Environment/AWSIMEnvironment/sjk5.png b/Components/Environment/AWSIMEnvironment/sjk5.png new file mode 100644 index 0000000000..346f9c039d Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/sjk5.png differ diff --git a/Components/Environment/AWSIMEnvironment/sjk6.png b/Components/Environment/AWSIMEnvironment/sjk6.png new file mode 100644 index 0000000000..2158853f8b Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/sjk6.png differ diff --git a/Components/Environment/AWSIMEnvironment/vehicle_layer.png b/Components/Environment/AWSIMEnvironment/vehicle_layer.png new file mode 100644 index 0000000000..d7849e0245 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/vehicle_layer.png differ diff --git a/Components/Environment/AWSIMEnvironment/volume.png b/Components/Environment/AWSIMEnvironment/volume.png new file mode 100644 index 0000000000..1eda92ff07 Binary files /dev/null and b/Components/Environment/AWSIMEnvironment/volume.png differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/add_environment_script.gif b/Components/Environment/AddNewEnvironment/AddEnvironment/add_environment_script.gif new file mode 100644 index 0000000000..dd53523524 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/add_environment_script.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/directional_light_add_object.gif b/Components/Environment/AddNewEnvironment/AddEnvironment/directional_light_add_object.gif new file mode 100644 index 0000000000..b04c58528a Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/directional_light_add_object.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/directional_light_config.gif b/Components/Environment/AddNewEnvironment/AddEnvironment/directional_light_config.gif new file mode 100644 index 0000000000..9930cdfbac Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/directional_light_config.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/directional_light_search.png b/Components/Environment/AddNewEnvironment/AddEnvironment/directional_light_search.png new file mode 100644 index 0000000000..f0206c4bfd Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/directional_light_search.png differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/environment_add_3d_models.png b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_add_3d_models.png new file mode 100644 index 0000000000..009248e1a0 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_add_3d_models.png differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/environment_add_directional_light.png b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_add_directional_light.png new file mode 100644 index 0000000000..b2134b38d4 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_add_directional_light.png differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/environment_add_npc_pedestrianl.png b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_add_npc_pedestrianl.png new file mode 100644 index 0000000000..5f261db022 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_add_npc_pedestrianl.png differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/environment_add_volume.png b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_add_volume.png new file mode 100644 index 0000000000..43e8aff365 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_add_volume.png differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/environment_environment.png b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_environment.png new file mode 100644 index 0000000000..e1c099ad70 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_environment.png differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/environment_mgrs.png b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_mgrs.png new file mode 100644 index 0000000000..3062ca283a Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_mgrs.png differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/environment_save_prefab.gif b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_save_prefab.gif new file mode 100644 index 0000000000..aa49076912 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_save_prefab.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/environment_transformation.png b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_transformation.png new file mode 100644 index 0000000000..3feea25d1d Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/environment_transformation.png differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/fbx_change.gif b/Components/Environment/AddNewEnvironment/AddEnvironment/fbx_change.gif new file mode 100644 index 0000000000..4e9b348eb5 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/fbx_change.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/fbx_drag.gif b/Components/Environment/AddNewEnvironment/AddEnvironment/fbx_drag.gif new file mode 100644 index 0000000000..c25e7ce6d2 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/fbx_drag.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/index.html b/Components/Environment/AddNewEnvironment/AddEnvironment/index.html new file mode 100644 index 0000000000..12ba0fc614 --- /dev/null +++ b/Components/Environment/AddNewEnvironment/AddEnvironment/index.html @@ -0,0 +1,2949 @@ + + + + + + + + + + + + + + + + + + + + + + + Add Environment - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Add an Environment

+

Environment is an important part of a Scene in AWSIM. +Every aspect of the simulated surrounding world needs to be included in the Environment prefab - in this section you will learn how to develop it. +However, first Lanelet2 needs to be developed along with 3D models of the world, which will be the main elements of this prefab.

+
+

Tip

+

If you want to learn more about the Environment at AWSIM, please visit this page.

+
+

Create a Lanelet2

+

Before you start creating Lanelet2, we encourage you to read the documentation to find out what Lanelet2 is all about. Lanelet2 can be created using VectorMapBuilder (VMP) based on the PCD obtained from real-life LiDAR sensor.

+

When working with the VMP, it is necessary to ensure the most accurate mapping of the road situation using the available elements. +Especially important are TrafficLanes created in VMB as connected Road Nodes and StopLines created in VMB as Road Surface Stoplines.

+
+

Lanelet2 positioning

+

Lanelet2 should be created in MGRS coordinates of the real place you are recreating. +Please position your Lanelet2 relative to the origin (bottom left corner) of the MGRS Grid Zone with the 100 km Square ID in which the location lays. More details can be read here.

+

You can think of the Grid Zone as a local coordinate system. +Instead of making global (0,0) point (crossing of Equator and Prime Median) our coordinate system origin we take a closer one. +The MGRS Grid Zone with 100 km Square ID code designates a 100x100 [kmxkm] square on the map and we take its bottom left corner as our local origin.

+
+

Example

+

Lets examine one node from an example Lanelet2 map:

+
<node id="4" lat="35.68855194431519" lon="139.69142711058254">
+    <tag k="mgrs_code" v="54SUE815501"/>
+    <tag k="local_x" v="81596.1357"/>
+    <tag k="local_y" v="50194.0803"/>
+    <tag k="ele" v="34.137"/>
+</node>
+
+

The node with id="4" position is described as absolute coordinates given in the <node>. +In this example the coordinates are as follows lat="35.68855194431519" lon="139.69142711058254.

+

It is also described as local transformation defined as a translation relative to the origin of the MGRS Grid Zone with 100 km Square ID (bottom left corner). +The MGRS Grid Zone designation with 100 km Square ID in this case is equal to 54SUE. +In this example the offset in the X axis is as follows k="local_x" v="81596.1357" +and the offset in the Y axis is as follows k="local_y" v="50194.0803".

+

Note that elevation information is also included.

+
+
+

Create 3D models

+

You can create 3D models of an Environment as you wish. +It is advised however, to prepare the models in form of .fbx files. +Additionally you should include materials and textures in separate directories. +Many models are delivered in this format. +This file format allows you to import models into Unity with materials and replace materials while importing. You can learn more about it here.

+

You can see a .fbx model added and modified on the fly in the example of this section.

+

Guidelines

+

To improve the simulation performance of a scene containing your Environment prefab, please keep in mind some of these tips when creating 3D models:

+
    +
  1. +

    Prefer more smaller models over a few big ones.

    +

    In general it is beneficial for performance when you make one small mesh of a object like tree and reuse it on the scene placing many prefabs instead of making one giant mesh containing all trees on the given scene. +It is beneficial even in situations when you are not reusing the meshes. +Lets say you have a city with many buildings - and every one of those buildings is different - it is still advised to model those building individually and make them separate GameObjects.

    +
  2. +
  3. +

    Choose texture resolution appropriately.

    +

    Always have in mind what is the target usage of your texture. +Avoid making a high resolution texture for a small object or the one that will always be far away from the camera. +This way you can save some computing power by not calculating the details that will not be seen because of the screen resolution.

    +
    +

    Practical advice

    +

    You can follow these simple rules when deciding on texture quality (texel density):

    +
      +
    • For general objects choose 512px/m (so the minimum size of texture is 512/512)
    • +
    • For important objects that are close to the camera choose 1024px/m (so the minimum size of texture is 1024/1024)
    • +
    +
    +
  4. +
  5. +

    (optional) Add animation.

    +

    Add animations to correct objects. +If some element in the 3D model are interactive they should be divided into separate parts.

    +
  6. +
+

What's more, consider these tips related directly to the use of 3D models in AWSIM:

+
    +
  1. Creating a 3D model based on actual point cloud data makes it more realistic.
  2. +
  3. AWSIM is created using HDRP (High Definition Rendering Pipeline) which performs better when object meshes are merged.
  4. +
  5. Occlusion culling and flutter culling cannot be used because the sensors detection target will disappear.
  6. +
  7. Each traffic light should have a separate GameObject. Also, each light in the traffic light should be split into separate materials.
  8. +
+

Create an Environment prefab

+

In this part, you will learn how to create a Environment prefab - that is, develop a GameObject containing all the necessary elements and save it as a prefab.

+

1. Add 3D models

+

In this section we will add roads, buildings, greenery, signs, road markings etc. to our scene.

+

Most often your models will be saved in the .fbx format. +If so, you can customize the materials in the imported model just before importing it. +Sometimes it is necessary as models come with placeholder materials. +You can either

+
    +
  • replace materials for every added GameObject into the Scene,
  • +
  • or replace materials for one GameObject and save this object as a prefab to easily load it later.
  • +
+

In order to add 3D models from the .fbx file to the Scene please do the following steps:

+
    +
  1. In the Project view navigate to the directory where the model is located and click on the model file.
  2. +
  3. Now you can customize the materials used in the model in the Inspector view.
  4. +
  5. Drag the model into the Scene where you want to position it.
  6. +
  7. Move the Object in the Hierarchy tree appropriately.
  8. +
  9. (optional) Now you can save this model configuration as a prefab to easily reuse it. + Do this by dragging the Object from the Scene into the Project view. + When you get a warning make sure to select you want to create an original new prefab.
  10. +
+
+

Example

+

An example video of the full process of importing a model, changing the materials, saving new model as a prefab and importing the new prefab. +

+
+

When creating a complex Environment with many elements you should group them appropriately in the Hierarchy view. +This depends on the individual style you like more, but it is a good practice to add all repeating elements into one common Object. +E.g. all identical traffic lights grouped in TrafficLights Object. +The same can be done with trees, buildings, signs etc. +You can group Objects as you like.

+
+

Object hierarchy

+

When adding elements to the Environment that are part of the static world (like 3D models of buildings, traffic lights etc.) it is good practice to collect them in one parent GameObject called Map or something similar.

+

By doing this you can set a transformation of the parent GameObject Map to adjust the world pose in reference to e.g. loaded objects from Lanelet2.
+map_example

+
+
+

Remember to unpack

+

Please remember to unpack all Object added into the scene. +If you don't they will change materials together with the .fbx model file as demonstrated in the example below.

+

This is unwanted behavior. +When you import a model and change some materials, but leave the rest default and don't unpack the model, then your instances of this model on the scene may change when you change the original fbx model settings.

+

See the example below to visualize what is the problem.

+
+Example +

In this example we will

+
    +
  • Place the model on the Scene.
  • +
  • Then intentionally not unpack the model
  • +
  • Only then change the materials of the original fbx model, not the instance on the scene
  • +
+

drag model

+

Watch what happens, the instance on the Scene changes the materials together with the model. +This only happens if you don't unpack the model.

+

change material in model

+
+
+
+

Example Environment after adding 3D models

+

After completing this step you should have an Environment Object that looks similar to the one presented below.

+

environment hierarchy view

+

The Environment with 3D models can look similar to the one presented below.

+

environment add 3d models

+
+

2. Add an Environment Script

+

Add an Environment Script as component in the Environment object (see the last example in section before). +It does not change the appearance of the Environment, but is necessary for the simulation to work correctly.

+
    +
  1. +

    Click on the Add Component button in the Environment object.

    +

    Add environment script gif

    +
  2. +
  3. +

    Search for Environment and select it.

    +

    Search for environment script

    +
  4. +
  5. +

    Set the MGRS to the offset of your Environment as explained in this section.

    +

    environment mgrs

    +
  6. +
+
+

Info

+

Due to the differences between VectorMapBuilder and Unity, it may be necessary to set the transform of the Environment object. +The transform in Environment should be set in such a way that the TrafficLanes match the modeled roads. Most often it is necessary to set the positive 90 degree rotation over Y axis.

+

This step should be done after importing items from lanelet2. +Only then will you know if you have Environment misaligned with items from lanelet2.

+

environment transformation

+
+

3. Add a Directional Light

+
    +
  1. +

    Create a new child Object of the Environment and name it Directional Light.

    +

    add directional light

    +
  2. +
  3. +

    Click Add Component button, search for Light and select it.

    +

    directional light search

    +
  4. +
  5. +

    Change light Type to Directional.

    +
  6. +
  7. +

    Now you can configure the directional light as you wish. E.g. change the intensity or orientation.

    +

    directional light configure

    +
  8. +
+
+

Tip

+

For more details on lighting check out official Unity documentation.

+
+
+

Example Environment after adding Directional Light

+

environment add directional light

+
+

4. Add a Volume

+
    +
  1. +

    Create a new child object of the Environment and name it Volume.

    +

    volume add object

    +
  2. +
  3. +

    Click Add Component search for Volume and select it.

    +

    select volume

    +
  4. +
  5. +

    Change the Profile to Volume Profile and wait for changes to take effect.

    +

    volume configure

    +
  6. +
  7. +

    Now you can configure the Volume individually as you wish.

    +
  8. +
+
+

Tip

+

For more details on volumes checkout official Unity documentation.

+
+
+

Example Environment after adding Volume

+

environment add volume

+
+

5. Add NPCPedestrians

+
    +
  1. +

    Make NPCPedestrians parent object.

    +

    npcpedestrians make parent

    +
  2. +
  3. +

    Open Assets/AWSIM/Prefabs/NPCs/Pedestrians in Project view and drag a humanElegant into the NPCPedestrians parent object.

    +

    npcpedestrian find prefab

    +

    npcpedestrian add prefab

    +
  4. +
  5. +

    Click Add Component in the humanElegant object and search for Simple Pedestrian Walker Controller Script and select it.

    +

    npcpedestrian configure

    +

    npcpedestrian simple script search

    +

    This is a simple Script that makes the pedestrian walk straight and turn around indefinitely. +You can configure pedestrian behavior with 2 parameters.

    +
      +
    • Duration - how long will the pedestrian walk straight
    • +
    • Speed - how fast will the pedestrian walk straight
    • +
    +
    +

    Tip

    +

    The Simple Pedestrian Walker Controller Script is best suited to be used on pavements.

    +
    +
  6. +
  7. +

    Finally position the NPCPedestrian on the scene where you want it to start walking.

    +
    +

    Warning

    +

    Remember to set correct orientation, as the NPCPedestrian will walk straight from the starting position with the starting orientation.

    +
    +
  8. +
+
+

Example Environment after adding NPC Pedestrians

+

environment add npc pedestrians

+
+

6. Save an Environment prefab

+

After doing all the previous steps and having your Environment finished you can save it to prefab format.

+
    +
  1. Find an Environments directory in the Project view (Assets/AWSIM/Prefabs/Environments).
  2. +
  3. Drag the Environment Object into the Project view.
  4. +
  5. (optional) Change the prefab name to recognize it easily later.
  6. +
+

environment save prefab

+
+

Success

+

Once you've added the Environment, you need to add and configure TrafficLights. +For details please visit this tutorial.

+
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/map_example.png b/Components/Environment/AddNewEnvironment/AddEnvironment/map_example.png new file mode 100644 index 0000000000..f3a62dbd4e Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/map_example.png differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/model_configure_save.mp4 b/Components/Environment/AddNewEnvironment/AddEnvironment/model_configure_save.mp4 new file mode 100644 index 0000000000..7604190a59 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/model_configure_save.mp4 differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_add_parent.gif b/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_add_parent.gif new file mode 100644 index 0000000000..a906eab003 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_add_parent.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_add_prefab.gif b/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_add_prefab.gif new file mode 100644 index 0000000000..7046024d91 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_add_prefab.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_config.gif b/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_config.gif new file mode 100644 index 0000000000..fc24b9de0e Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_config.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_find_prefab.gif b/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_find_prefab.gif new file mode 100644 index 0000000000..bb8608403b Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_find_prefab.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_find_prefab2.gif b/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_find_prefab2.gif new file mode 100644 index 0000000000..8b1fdcf6e8 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_find_prefab2.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_search.png b/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_search.png new file mode 100644 index 0000000000..284b6893f8 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/npcpedestrian_search.png differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/search_environment_script.png b/Components/Environment/AddNewEnvironment/AddEnvironment/search_environment_script.png new file mode 100644 index 0000000000..15856d0c55 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/search_environment_script.png differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/volume_add_object.gif b/Components/Environment/AddNewEnvironment/AddEnvironment/volume_add_object.gif new file mode 100644 index 0000000000..6d83da2ef2 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/volume_add_object.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/volume_config.gif b/Components/Environment/AddNewEnvironment/AddEnvironment/volume_config.gif new file mode 100644 index 0000000000..f5e7d59235 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/volume_config.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddEnvironment/volume_search.png b/Components/Environment/AddNewEnvironment/AddEnvironment/volume_search.png new file mode 100644 index 0000000000..3d2a8c914e Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddEnvironment/volume_search.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_component_random_traffic_simulator.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_component_random_traffic_simulator.gif new file mode 100644 index 0000000000..9e9b8c327c Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_component_random_traffic_simulator.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_component_random_traffic_simulator.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_component_random_traffic_simulator.png new file mode 100644 index 0000000000..da0aad2873 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_component_random_traffic_simulator.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_npc_prefab.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_npc_prefab.gif new file mode 100644 index 0000000000..d09de8f462 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_npc_prefab.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_npc_prefab1.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_npc_prefab1.gif new file mode 100644 index 0000000000..2dd0916121 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_npc_prefab1.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_npc_prefab2.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_npc_prefab2.gif new file mode 100644 index 0000000000..a3490268fc Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_npc_prefab2.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_npc_prefab3.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_npc_prefab3.gif new file mode 100644 index 0000000000..ecc9b63077 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_npc_prefab3.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_random_traffic_simulator.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_random_traffic_simulator.gif new file mode 100644 index 0000000000..f9f2b4e8cc Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_random_traffic_simulator.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_traffic_lane1.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_traffic_lane1.gif new file mode 100644 index 0000000000..56cc231570 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_traffic_lane1.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_traffic_lane2.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_traffic_lane2.gif new file mode 100644 index 0000000000..31ee21a828 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_traffic_lane2.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_traffic_lane3.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_traffic_lane3.gif new file mode 100644 index 0000000000..f94b4da6fd Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_traffic_lane3.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_traffic_lane4.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_traffic_lane4.gif new file mode 100644 index 0000000000..df22e9e8dd Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/add_traffic_lane4.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/index.html b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/index.html new file mode 100644 index 0000000000..94750cac4d --- /dev/null +++ b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/index.html @@ -0,0 +1,2660 @@ + + + + + + + + + + + + + + + + + + + + + + + Add Random Traffic - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Add Random Traffic

+ +

To add a Random Traffic to your scene you need the Random Traffic Simulator Script.

+
    +
  1. +

    Create a new Game Object as a child of Environment and call it RandomTrafficSimulator.

    +

    create_random_traffic_simulator

    +
  2. +
  3. +

    Click a button Add Component in the Inspector to add a script.

    +

    add_component_random_traffic_simulator

    +
  4. +
  5. +

    A small window should pop-up. +Search for RandomTrafficSimulator script and add it by double clicking it or by pressing enter.

    +

    add_component_random_traffic_simulator

    +
  6. +
+

Basic Configuration

+

After clicking on the newly created RandomTrafficSimulator object in the Scene tree you should see something like this in the Inspector view.

+

random_traffic_simulator_inspector

+

Random Traffic Simulator, as the name suggests, generates traffic based on random numbers. +To replicate situations you can set a specific seed.

+

You can also set Vehicle Layer Mask and Ground Layer Mask. +It is important to set these layers correctly, as they are a base for vehicle physics. +If set incorrectly the vehicles may fall through the ground into the infinity.

+

random_traffic_simulator_layers

+

Add NPCVehicles

+

Random Traffic Simulator Script moves, spawns and despawns vehicles based on the configuration. +These settings can to be adjusted to your preference.

+
    +
  1. +

    Setting Max Vehicle Count.

    +

    This parameter sets a limit on how many vehicles can be added to the scene at one time.

    +
  2. +
  3. +

    NPC Prefabs

    +

    These are models of vehicles that should be spawned on the scene, to add NPC Prefabs please follow these steps:

    +
      +
    1. +

      To do this click on the "+" sign and in the new list element at the bottom and click on the small icon on the right to select a prefab.

      + +
    2. +
    3. +

      Change to the Assets tab in the small windows that popped-up.

      + +
    4. +
    5. +

      Search for the Vehicle prefab you want to add, e.g. Hatchback.

      + +
    6. +
    +

    add npc prefab gif

    +

    Available NPC prefabs are shown in the NPC Vehicle section.

    +
    +

    Control NPC Vehicle spawning

    +

    Random Traffic Simulator Script will on random select one prefab from Npc Prefabs list every time when there are not enough vehicles on the scene (the number of vehicles on the scene is smaller than the number specified in the Max Vehicle Count field).

    +

    You can control the odds of selecting one vehicle prefab over another by adding more than one instance of the same prefab to this list.

    +
    +
  4. +
+

Add spawnable lanes

+

Spawnable lanes are the lanes on which new vehicles can be spawned by the Random Traffic Simulator Script. +Best practice is to use beginnings of the lanes on the edges of the map as spawnable lanes.

+
+

Warning

+

Make sure you have a lanelet added into your scene. +The full tutorial on this topic can be found here.

+
+

Adding spawnable lanes is similar to Adding NPC Prefabs.

+
    +
  1. +

    Add an element to the Spawnable Lanes list by clicking on the "+" symbol or by selecting number of lanes directly.

    +

    Add npc list element gif

    +
  2. +
  3. +

    Now you can click on the small icon on the right of the list element and select a Traffic Lane you are interested in.

    +

    Select traffic lane gif

    +

    Unfortunately all Traffic Lanes have the same names so it can be difficult to know which one to use. +Alternatively you can do the following to add a traffic lane by visually selecting it in the editor:

    +
      +
    • +

      Lock RandomTrafficSimulator in the Inspector view.

      +

      Lock inspector view gif

      +
    • +
    • +

      Select the Traffic Lane you are interested in on the Scene and as it gets highlighted in the Hierarchy view you can now drag and drop this Traffic Lane into the appropriate list element.

      +

      Select traffic lane and drag it to the list gif

      +
    • +
    +
  4. +
+

Vehicles configuration

+

The last thing to configure is the behavior of NPCVehicles. +You can specify acceleration rate of vehicles and three values of deceleration.

+

Vehicle configuration picture

+
    +
  • +

    Acceleration

    +

    This value is used for every acceleration the vehicle performs (after stop line or traffic lights).

    +
  • +
  • +

    Deceleration

    +

    This deceleration value is used for most casual traffic situations like slowing down before stop line.

    +
  • +
  • +

    Sudden Deceleration

    +

    This deceleration rate is used for emergency situations - when using standard deceleration rate is not enough to prevent some accident from happening (e.g. vehicle on the intersection didn't give way when it was supposed to).

    +
  • +
  • +

    Absolute Deceleration

    +

    This deceleration rate is a last resort for preventing a crash from happening. +When no other deceleration is enough to prevent an accident this value is used. +This should be set to the highest value achievable by a vehicle.

    +
  • +
+
+

Question

+

This configuration is common for all vehicles managed by the Random Traffic Simulator Script.

+
+
+

Success

+

The last thing that needs to be done for RandomTraffic to work properly is to add intersections with traffic lights and configure their sequences. Details here.

+
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/random_traffic_simulator_inspector.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/random_traffic_simulator_inspector.png new file mode 100644 index 0000000000..5013484625 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/random_traffic_simulator_inspector.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/random_traffic_simulator_layers.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/random_traffic_simulator_layers.png new file mode 100644 index 0000000000..2f8243ceca Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/random_traffic_simulator_layers.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/vehicle_configuration.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/vehicle_configuration.png new file mode 100644 index 0000000000..e28b35b083 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddRandomTraffic/vehicle_configuration.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/box_collider_search.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/box_collider_search.png new file mode 100644 index 0000000000..0a0f8f1954 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/box_collider_search.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/index.html b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/index.html new file mode 100644 index 0000000000..1974ed07e8 --- /dev/null +++ b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/index.html @@ -0,0 +1,2731 @@ + + + + + + + + + + + + + + + + + + + + + + + Add Traffic Intersection - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Add Traffic Intersection

+ +

Every TrafficIntersection on the scene needs to be added as a GameObject. +Best practice is to create a parent object TrafficIntersections and add all instances of TrafficIntersection as its children. +You can do this the same as with Random Traffic Simulator.

+
+

Traffic Lights configuration

+

Before performing this step, check all TrafficLights for correct configuration and make sure that TrafficLights have added scripts. If you want to learn how to add and configure it check out this tutorial.

+
+

Add a Box Collider

+
    +
  1. +

    TrafficIntersection needs to be marked with a box collider. +First click on the Add Component button.

    +

    Add box collider gif

    +
  2. +
  3. +

    In the window that popped up search for Box Collider and select it.

    +

    Search for box collider

    +
  4. +
  5. +

    Then set the position and orientation and size of the Box Collider. +You can do this by manipulating Box Collider properties Center and Size in the Inspector view.

    +

    Set traffic intersection size

    +
    +

    Traffic Intersection Box Collider guidelines

    +

    When adding a Box Collider marking your Traffic Intersection please make sure that

    +
      +
    • It is not floating over the ground - there is no gap between the Box Collider and The Traffic Intersection
    • +
    • It is high enough to cover all Vehicles that will be passing through the Intersection
    • +
    • It accurately represents the shape, position and orientation of the Traffic Intersection
    • +
    +
    +
  6. +
+

Add a Traffic Intersection Script

+
    +
  1. +

    Click on the Add Component button.

    +

    Add traffic intersection script gif

    +
  2. +
  3. +

    In the window that popped up search for Traffic Intersection and select it.

    +

    Search for traffic intersection script

    +
  4. +
  5. +

    You need to set a proper Collider Mask in order for the script to work.

    +

    Set collider mask

    +
  6. +
+

Create traffic light groups

+

Traffic Light Groups are groups of traffic lights that are synchronized, meaning they light up with the same color and pattern at all times.

+

Traffic lights are divided into groups to simplify the process of creating a lighting sequence. +By default you will see 4 Traffic Light Groups, you can add and remove them to suit your needs.

+
    +
  1. +

    First choose from the drop-down menu called Group the Traffic Light Group name you want to assign to your Traffic Light Group.

    +

    +Traffic intersection add traffic light gif

    +
  2. +
  3. +

    Then add as many Traffic Lights as you want your group to have. +From the drop-down menu select the Traffic Lights you want to add.

    +

    +Traffic intersection add traffic light 2 gif

    +
    +

    Select Traffic Lights visually

    +

    If you have a lot of Traffic Lights it can be challenging to add them from the list. +You can select them visually from the Scene the same as you had selected Traffic Lanes in the Random Traffic Simulator.

    +
    +
  4. +
+

Create lighting sequences

+

Lighting Sequences is a list of commands based on which the Traffic Lights will operate on an intersection. +The elements in the Lighting Sequences list are changes (commands) that will be executed on the Traffic Light Groups.

+

Group Lighting Order should be interpreted as a command (or order) given to all Traffic Lights in selected Traffic Light Group. +In Group Lighting Orders you can set different traffic light status for every Traffic Light Group (in separate elements). +Lighting sequences list is processed in an infinite loop.

+

It should be noted that changes applied to one Traffic Light Group will remain the same until the next Group Lighting Order is given to this Traffic Light Group. +This means that if in one Group Lighting Order no command is sent to a Traffic Light Group then this Group will remain its current lighting pattern (color, bulb and status).

+

For every Lighting Sequences Element you have to specify the following

+
    +
  1. +

    Interval Sec

    +

    This is the time for which the sequence should wait until executing next order, so how long this state will be active.

    +
  2. +
  3. +

    For every element in Group Lighting Orders there needs to be specified

    +
      +
    1. Group to which this order will be applied
    2. +
    3. +

      List of orders (Bulb Data)

      +

      In other words - what bulbs should be turned on, their color and pattern.

      +
        +
      • Type - What type of bulb should be turned on
      • +
      • Color - What color this bulb should have (in most cases this will be the same as color of the bulb if specified)
      • +
      • Status - How the bulb should light up (selecting SOLID_OFF is necessary only when you want to turn the Traffic Light completely off, meaning no bulb will light up)
      • +
      +
      +

      Note

      +

      When applying the change to a Traffic Light

      +
        +
      • First all bulbs are turned off
      • +
      • Only after that changes made in the order are applied
      • +
      +

      This means it is only necessary to supply the data about what bulbs should be turned on. +E.g. you don't have to turn off a red bulb when turning on the green one.

      +
      +
    4. +
    +
  4. +
+
+

Warning

+

The first Element in the Lighting Sequences (in most cases) should contain bulb data for every Traffic Light Group. +Traffic Light Groups not specified in the first Element will not light up at the beginning of the scene.

+
+

Example

+

Lets consider the following lighting sequence element.

+

Example Group Lighting Orders

+

In the Lighting Sequence Element 5 we tell all Traffic Lights in the Vehicle Traffic Light Group 2 to light up their Green Bulb with the color Green and status Solid On which means that they will be turned on all the time. +We also implicitly tell them to turn all other Bulbs off.

+

In the same time we tell all Traffic Lights in the Pedestrian Traffic Light Group 2 to do the very same thing.

+

This state will be active for the next 15 seconds, and after that Traffic Intersection will move to the next Element in the Sequence.

+

Now lets consider the following Lighting Sequences Element 6.

+

Example Group Lighting Order 2

+

Here we order the Traffic Lights in the Pedestrian Traffic Light Group 2 to light up their Green Bulb with the color Green and status Flashing. +We also implicitly tell them to turn all other bulbs off, which were already off from the implicit change in Element 5, so this effectively does nothing.

+

Note that Lighting Sequences Element 6 has no orders for Vehicle Traffic Light Group 2. +This means that Traffic Lights in the Vehicle Traffic Light Group 2 will hold on to their earlier orders.

+

This state will be active for 5 seconds, which means that Traffic Lights in the Vehicle Traffic Light Group 2 will be lighting solid green for the total of 20 seconds.

+

How to test

+

To test how your Traffic Intersection behaves simply run the Scene as shown here (but don't launch Autoware). +To take a better look at the Traffic Lights you can change to the Scene view by pressing ctrl + 1 - now you can move the camera freely (to go back to the Game view simply press ctrl + 2).

+

As the time passes you can examine whether your Traffic Intersection is configured correctly.

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_add_box.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_add_box.gif new file mode 100644 index 0000000000..e5c75f13e6 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_add_box.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_add_script.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_add_script.gif new file mode 100644 index 0000000000..5c4ec86f72 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_add_script.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_add_traffic_light.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_add_traffic_light.gif new file mode 100644 index 0000000000..543cc6dfc7 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_add_traffic_light.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_add_traffic_light2.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_add_traffic_light2.gif new file mode 100644 index 0000000000..d59c4de8c0 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_add_traffic_light2.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_collider_mask.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_collider_mask.png new file mode 100644 index 0000000000..9dae4f30f3 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_collider_mask.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_search.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_search.png new file mode 100644 index 0000000000..c4c6995b2c Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_search.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_size.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_size.png new file mode 100644 index 0000000000..d8f9cdc06a Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersection_size.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersecton_example_sequence_element.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersecton_example_sequence_element.png new file mode 100644 index 0000000000..2c1205e93d Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersecton_example_sequence_element.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersecton_example_sequence_element2.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersecton_example_sequence_element2.png new file mode 100644 index 0000000000..a1d12ef34e Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/AddTrafficIntersection/traffic_intersecton_example_sequence_element2.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/add_stop_line.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/add_stop_line.gif new file mode 100644 index 0000000000..67373321e1 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/add_stop_line.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/add_stop_line_add_script.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/add_stop_line_add_script.gif new file mode 100644 index 0000000000..07be07de3f Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/add_stop_line_add_script.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/index.html b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/index.html new file mode 100644 index 0000000000..4fac655a66 --- /dev/null +++ b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/index.html @@ -0,0 +1,3055 @@ + + + + + + + + + + + + + + + + + + + + + + + Load Items From Lanelet - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Load items from lanelet2

+

To add RandomTraffic to the Environment, it is necessary to load elements from the lanelet2. +As a result of loading, TrafficLanes and StopLines will be added to the scene. Details of these components can be found here.

+
+

Warning

+

Before following this tutorial make sure you have added an Environment Script and set a proper MGRS offset position. This position is used when loading elements from the lanelet2!

+
+
    +
  1. +

    Click on the AWSIM button in the top menu of the Unity editor and navigate to AWSIM -> Random Traffic -> Load Lanelet.

    +

    load lanelet gif

    +
  2. +
  3. +

    In the window that pops-up select your osm file, change some Waypoint Settings to suit your needs and click Load.

    +

    load lanelet gif

    +
    +

    Waypoint Settings explanation

    +
      +
    • Resolution - resolution of resampling. Lower values provide better accuracy at the cost of processing time
    • +
    • Min Delta Length - minimum length(m) between adjacent points
    • +
    • Min Delta Angle - minimum angle(deg) between adjacent edges. Lowering this value produces a smoother curve
    • +
    +
    +
  4. +
  5. +

    Traffic Lanes and Stop Lanes should occur in the Hierarchy view. +If they appear somewhere else in your Hierarchy tree, then move them into the Environment object.

    +
  6. +
+

Complete loaded TrafficLanes

+

The Traffic Lanes that were loaded should be configures accordingly to the road situation. +The aspects you can configure

+ +

How to test

+

If you want to test your Traffic Lanes you have to try running a Random Traffic. +To verify one particular Traffic Lane or Traffic Lane connection you can make a new spawnable lane next to the Traffic Lane you want to test. +This way you can be sure NPCVehicles will start driving on the Traffic Lane you are interested in at the beginning.

+

Add a StopLine manually

+

When something goes wrong when loading data from lanelet2 or you just want to add another StopLine manually please do the following

+

1. Add a GameObject

+

Add a new GameObject StopLine in the StopLines parent object.

+

add stop line object

+

2. Add a StopLine Script

+

Add a StopLine Script by clicking 'Add Component' and searching for Stop Line.

+

add component

+

search stop line

+
+

Example

+

So far your Stop Line should look like the following

+

stop line inspector view

+
+

3. Set points

+

Set the position of points Element 0 and Element 1. +These Elements are the two end points of a Stop Line. +The Stop Line will span between these points.

+

You don't need to set any data in the 'Transform' section as it is not used anyway.

+
+

StopLine coordinate system

+

Please note that the Stop Line Script operates in the global coordinate system. +The transformations of StopLine Object and its parent Objects won't affect the Stop Line.

+
+Example +

In this example you can see that the Position of the Game Object does not affect the position and orientation of the Stop Line.

+

For a Game Object in the center of the coordinate system.

+

stop line in default position

+

The stop Line is in the specified position.

+

stop line in default position

+

However with the Game Object shifted in X axis.

+

stop line in new position

+

The Stop Line stays in the same position as before, not affected by any transformations happening to the Game Object.

+

stop line in new position

+
+
+

4. Has Stop Sign

+

Select whether there is a Stop Sign.

+

Select the Has Stop Sign tick-box confirming that this Stop Line has a Stop Sign. +The Stop Sign can be either vertical or horizontal.

+

stop line has stop sigh

+

5. Select a Traffic Light

+

Select from the drop-down menu the Traffic Light that is on the Traffic Intersection and is facing the vehicle that would be driving on the Traffic Lane connected with the Stop Line you are configuring.

+

In other words select the right Traffic Light for the Lane on which your Stop Line is placed.

+

stop line add traffic light

+
+

Select Traffic Lights visually

+

If you have a lot of Traffic Lights it can be challenging to add them from the list. +You can select them visually from the Scene the same as you had selected Traffic Lanes in the Random Traffic Simulator.

+
+

6. Configure the Traffic Lane

+

Every Stop Line has to be connected to a Traffic Lane. +This is done in the Traffic Lane configuration. +For this reason please check the Traffic Lane section for more details.

+

Add a TrafficLane manually

+

It is possible that something may go wring when reading a lanelet2 and you need to add an additional Traffic Lane or you just want to add it. +To add a Traffic Lane manually please follow the steps below.

+

1. Add a GameObject

+

Add a new Game Object called TrafficLane into the TrafficLanes parent Object.

+

traffic lane add object

+

2. Add a Traffic Lane Script

+

Click the 'Add Component' button and search for the Traffic lane script and select it.

+

traffic lane add component

+

traffic lane search

+
+

Example

+

So far your Traffic Lane should look like the following.

+

traffic lane configuration

+
+

3. Configure Waypoints

+

Now we will configure the 'Waypoints' list. +This list is an ordered list of nest points defining the Traffic Lane. +When you want to add a waypoint to a Traffic Lane just click on the + button or specify the number of waypoints on the list in the field with number to the right from 'Waypoints' identifier.

+

The order of elements on this list determines how waypoints are connected.

+

traffic lane add waypoints

+
+

Traffic Lane coordinate system

+

Please note that the Traffic Lane waypoints are located in the global coordinate system, any transformations set to a Game Object or paren Objects will be ignored.

+

This behavior is the same as with the Stop Line. +You can see the example provided in the Stop Line tutorial.

+
+
+

General advice

+
    +
  • Two waypoints should not be too far away from each other.
  • +
  • When creating a turn that is a curvature please keep in mind the angle that is created between two next waypoints connected. + The angles should be fairly small - this will translate to a smooth motion of vehicles.
  • +
+
+

4. Select the Turn Direction

+

You also need to select the Turn Direction. +This field describes what are the vehicles traveling on ths Traffic Lane doing in reference to other Traffic Lanes. +You need to select whether the vehicles are

+
    +
  • Driving straight (STRAIGHT)
  • +
  • Turning right (RIGHT)
  • +
  • Turning left (LEFT)
  • +
+

traffic lane select the turn direction

+

5. Configure Next Lanes

+

You need to add all Traffic Lanes that have their beginning in the end of this Traffic Lane into the Next Lanes list. +In other words if the vehicle can choose where he wants to drive (e.g. drive straight or drive left with choice of two different Traffic Lines).

+

To do this click the + sign in the Next Lanes list and in the element that appeared select the correct Traffic Lane.

+

traffic lane add next lane

+
+Next Lane example +

Lets consider the following Traffic Intersection.

+

traffic lane situation

+

In this example we will consider the Traffic Lane driving from the bottom of the screen and turning right. +After finishing driving in this Traffic Lane the vehicle has a choice of 4 different Traffic Lanes each turning into different lane on the parallel road.

+

All 4 Traffic Lanes are connected to the considered Traffic Lane. +This situation is reflected in the Traffic Lane configuration shown below.

+

traffic lane description

+
+
+

Select Traffic Lanes visually

+

If you have a lot of Traffic Lanes it can be challenging to add them from the list. +You can select them visually from the Scene the same as you had selected Traffic Lanes in the Random Traffic Simulator.

+
+

6. Configure Previous Lanes

+

Traffic Lane has to have previous Traffic Lanes configured. +This is done in the exact same way as configuring next lanes which was shown in the previous step. +Please do the same, but add Traffic Lanes that are before the configured one instead of the ones after into the Prev Lanes list.

+

7. Configure Right Of Way

+

Now we will configure the Right Of Way Lanes. +The Right Of Way Lanes is a list of Traffic Lanes that have a priority over the configured one. +The process of adding the Right Of Way Lanes is the same as with adding Next Lanes. +For this reason we ask you to see the aforementioned step for detailed description on how to do this (the only difference is that you add Traffic Lanes to the Right Of Way Lanes list).

+
+Right of way example +

In this example lets consider the Traffic Lane highlighted in blue from the Traffic Intersection below.

+

right of way situation

+

This Traffic Lane has to give way to all Traffic Lanes highlighted on yellow. +This means all of the yellow Traffic Lanes have to be added to the 'Right Of Way Lanes' list which is reflected on the configuration shown below.

+

right of way configuration

+
+

8. Add Stop Line

+

Adding a Stop Line is necessary only when at the end of the configured Traffic Lane the Stop Line is present. +If so, please select the correct Stop Line from the drop-down list.

+

traffic lane add stop line

+
+

Select Stop Line visually

+

If you have a lot of Stop Lines it can be challenging to add them from the list. +You can select them visually from the Scene the same as you had selected Traffic Lanes in the Random Traffic Simulator.

+
+

9. Add Speed Limit.

+

In the field called Speed Limit simply write the speed limit that is in effect on the configured Traffic Lane.

+

traffic lane set speed limit

+

10. Set the Right of Ways

+

To make the Right Of Ways list you configured earlier take effect simply click the 'Set RightOfWays' button.

+

traffic lane set right of ways

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/load_lanelet.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/load_lanelet.gif new file mode 100644 index 0000000000..8e4ce0dbae Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/load_lanelet.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/load_lanelet2.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/load_lanelet2.gif new file mode 100644 index 0000000000..f7a2f1f00b Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/load_lanelet2.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_add_traffic_light.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_add_traffic_light.gif new file mode 100644 index 0000000000..93d3990e8d Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_add_traffic_light.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_has_stop_sign.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_has_stop_sign.gif new file mode 100644 index 0000000000..79ae0652f6 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_has_stop_sign.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_inspector.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_inspector.png new file mode 100644 index 0000000000..f95247d50c Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_inspector.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_position11.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_position11.png new file mode 100644 index 0000000000..d86fe74dce Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_position11.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_position12.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_position12.png new file mode 100644 index 0000000000..91c137da03 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_position12.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_position21.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_position21.png new file mode 100644 index 0000000000..d00f1959fa Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_position21.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_position22.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_position22.png new file mode 100644 index 0000000000..5f7cdf46e5 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_position22.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_search.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_search.png new file mode 100644 index 0000000000..b450d1e298 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/stop_line_search.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_component.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_component.gif new file mode 100644 index 0000000000..93a5730c11 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_component.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_next_lane.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_next_lane.gif new file mode 100644 index 0000000000..c0157d54d1 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_next_lane.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_object.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_object.gif new file mode 100644 index 0000000000..9e359faf87 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_object.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_stop_line.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_stop_line.gif new file mode 100644 index 0000000000..0664b1b578 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_stop_line.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_waypoints.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_waypoints.gif new file mode 100644 index 0000000000..0c8f417a86 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_add_waypoints.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_configuration.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_configuration.png new file mode 100644 index 0000000000..b9da759da8 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_configuration.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_description.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_description.png new file mode 100644 index 0000000000..69c3918bc6 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_description.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_right_of_way_configuration.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_right_of_way_configuration.png new file mode 100644 index 0000000000..9921a0aee0 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_right_of_way_configuration.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_right_of_way_situation.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_right_of_way_situation.png new file mode 100644 index 0000000000..2b7f6f6ef8 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_right_of_way_situation.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_search.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_search.png new file mode 100644 index 0000000000..5be32b0adf Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_search.png differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_select_turn_direction.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_select_turn_direction.gif new file mode 100644 index 0000000000..93f28d37e0 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_select_turn_direction.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_set_right_of_ways.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_set_right_of_ways.gif new file mode 100644 index 0000000000..ac9f8b06d8 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_set_right_of_ways.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_set_speed_limit.gif b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_set_speed_limit.gif new file mode 100644 index 0000000000..c8248f73ad Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_set_speed_limit.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_situation.png b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_situation.png new file mode 100644 index 0000000000..930005942f Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddRandomTraffic/LoadItemsFromLanelet/traffic_lane_situation.png differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/index.html b/Components/Environment/AddNewEnvironment/AddTrafficLights/index.html new file mode 100644 index 0000000000..8267336c78 --- /dev/null +++ b/Components/Environment/AddNewEnvironment/AddTrafficLights/index.html @@ -0,0 +1,2680 @@ + + + + + + + + + + + + + + + + + + + + + + + Add TrafficLights - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Add TrafficLights

+

To add TrafficLights into your Environment follow steps below.

+
+

Tip

+

In the Environment you are creating there will most likely be many TrafficLights that should look and work the same way. +To simplify the process of creating an environment it is advised to create one TrafficLight of each type with this tutorial and then save them as prefabs that you will be able to reuse.

+
+

1. Add TrafficLight Object

+

Into your Map object in the Hierarchy view add a new Child Object and name it appropriately.

+

add traffic light object

+

2. Add a Mesh Filter and select meshes

+
    +
  1. +

    Click on the Add Component button.

    +

    add traffic light component

    +
  2. +
  3. +

    Search for Mesh filter and select it by clicking on it.

    +

    search mesh filter

    +
  4. +
  5. +

    For each TrafficLight specify the mesh you want to use.

    +

    traffic light mesh

    +
  6. +
+

3.Add a Mesh Renderer and specify materials

+
    +
  1. +

    The same way as above search for Mesh Renderer and select it.

    +

    search mesh renderer

    +
  2. +
  3. +

    Now you need to specify individual component materials.

    +

    For example in the Traffic.Lights.001 mesh there are four sub-meshes that need their individual materials.

    +

    To specify a material click on the selection button on Materials element and search for the material you want to use and select it.

    +

    specify material

    +

    Repeat this process until you specify all materials. +When you add one material more than there are sub-meshes you will see this warning. +Then just remove the last material and the TrafficLight is prepared.

    +

    too many traffic materials

    +
    +

    Info

    +

    Different material for every bulb is necessary for the color changing behavior that we expect from traffic lights. +Even though in most cases you will use the same material for every Bulb, having them as different elements is necessary. +Please only use models of TrafficLights that have different Materials Elements for every Bulb.

    +
    +
    +

    Materials order

    +

    When specifying materials remember the order in which they are used in the mesh. +Especially remember what Materials Elements are associated with every Bulb in the TrafficLight. +This information will be needed later.

    +
    +

    Example

    +

    In the case of Traffic.Lights.001 the bulb materials are ordered starting from the left side with index 1 and increasing to the right.

    +

    bulb 1

    +

    bulb 2

    +

    bulb 3

    +
    +
    +
  4. +
+

4. Add a Mesh Collider

+

The same way as above search for Mesh Collider and select it. +Collider may not seem useful, as the TrafficLight in many cases will be out of reach of vehicles. +It is however used for LiDAR simulation, so it is advised to always add colliders to Objects that should be detected by LiDARs.

+

search mesh collider

+

5. Position TrafficLight in the Environment

+

Finally after configuring all visual aspects of the TrafficLight you can position it in the environment. +Do this by dragging a TrafficLight with a square representing a plane or with an arrow representing one axis.

+

position

+

6. Add TrafficLight Script

+

The Traffic Light Script will enable you to control how the TrafficLight lights up and create sequences.

+
    +
  1. +

    Click on Add Component, search for the Traffic Light script and select it.

    +

    traffic light script

    +
  2. +
  3. +

    You should see the Bulb Emission config already configured. These are the colors that will be used to light up the Bulbs in TrafficLight. You may adjust them to suit your needs.

    +

    bulb emission config

    +
  4. +
  5. +

    You will have to specify Bulb material config, in which you should add elements with fields:

    +
      +
    • +

      Bulb Type - One of the predefined Bulb types that describes the Bulb (its color and pattern).

      +
    • +
    • +

      Material Index - Index of the material that you want to be associated with the Bulb Type. This is where you need to use the knowledge from earlier where we said you have to remember what Materials Element corresponds to which bulb sub-mesh.

      +
    • +
    +
    +

    Bulb configuration example

    +

    Here we specify an element Type as RED_BULB and associate it with Material that has an index 3. +This will result in associating the right most bulb with the name RED_BULB. +This information will be of use to us when specifying TrafficLights sequences.

    +

    traffic light bulb config

    +
    +
  6. +
+
+

Success

+

Once you have added TrafficLights to your Environment, you can start configuring RandomTraffic which will add moving vehicles to it! Details here.

+
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/mesh_collider_search.png b/Components/Environment/AddNewEnvironment/AddTrafficLights/mesh_collider_search.png new file mode 100644 index 0000000000..cada37533f Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/mesh_collider_search.png differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/mesh_filter_search.png b/Components/Environment/AddNewEnvironment/AddTrafficLights/mesh_filter_search.png new file mode 100644 index 0000000000..e48797a8de Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/mesh_filter_search.png differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/mesh_renderer_search.png b/Components/Environment/AddNewEnvironment/AddTrafficLights/mesh_renderer_search.png new file mode 100644 index 0000000000..cbc3562bd0 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/mesh_renderer_search.png differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_001.png b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_001.png new file mode 100644 index 0000000000..801d8968d8 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_001.png differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_1_bulb.png b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_1_bulb.png new file mode 100644 index 0000000000..6311ab9fd0 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_1_bulb.png differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_2_bulb.png b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_2_bulb.png new file mode 100644 index 0000000000..602b3ba059 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_2_bulb.png differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_3_bulb.png b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_3_bulb.png new file mode 100644 index 0000000000..84d9eb7176 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_3_bulb.png differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_add_component.gif b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_add_component.gif new file mode 100644 index 0000000000..16bdbe93aa Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_add_component.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_add_object.gif b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_add_object.gif new file mode 100644 index 0000000000..aae34ccda6 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_add_object.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_bulb_config.gif b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_bulb_config.gif new file mode 100644 index 0000000000..eaaad9f713 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_bulb_config.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_bulb_emissions_config.png b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_bulb_emissions_config.png new file mode 100644 index 0000000000..88acab8a63 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_bulb_emissions_config.png differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_position.gif b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_position.gif new file mode 100644 index 0000000000..7c75e9bd27 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_position.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_script_search.png b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_script_search.png new file mode 100644 index 0000000000..98320f18aa Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_script_search.png differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_select_material.gif b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_select_material.gif new file mode 100644 index 0000000000..9b687bbcd3 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_select_material.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_select_mesh.gif b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_select_mesh.gif new file mode 100644 index 0000000000..e2d44bebd8 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_select_mesh.gif differ diff --git a/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_too_many_materials.png b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_too_many_materials.png new file mode 100644 index 0000000000..da26c55d80 Binary files /dev/null and b/Components/Environment/AddNewEnvironment/AddTrafficLights/traffic_light_too_many_materials.png differ diff --git a/Components/Environment/CreatePCD/add_vehicle_object.gif b/Components/Environment/CreatePCD/add_vehicle_object.gif new file mode 100644 index 0000000000..8d3fef1101 Binary files /dev/null and b/Components/Environment/CreatePCD/add_vehicle_object.gif differ diff --git a/Components/Environment/CreatePCD/image_0.png b/Components/Environment/CreatePCD/image_0.png new file mode 100644 index 0000000000..efa77941be Binary files /dev/null and b/Components/Environment/CreatePCD/image_0.png differ diff --git a/Components/Environment/CreatePCD/image_1.png b/Components/Environment/CreatePCD/image_1.png new file mode 100644 index 0000000000..b21ca149c0 Binary files /dev/null and b/Components/Environment/CreatePCD/image_1.png differ diff --git a/Components/Environment/CreatePCD/image_2.png b/Components/Environment/CreatePCD/image_2.png new file mode 100644 index 0000000000..900594ab98 Binary files /dev/null and b/Components/Environment/CreatePCD/image_2.png differ diff --git a/Components/Environment/CreatePCD/image_3.png b/Components/Environment/CreatePCD/image_3.png new file mode 100644 index 0000000000..bbfffba40a Binary files /dev/null and b/Components/Environment/CreatePCD/image_3.png differ diff --git a/Components/Environment/CreatePCD/image_4.png b/Components/Environment/CreatePCD/image_4.png new file mode 100644 index 0000000000..b4ec491030 Binary files /dev/null and b/Components/Environment/CreatePCD/image_4.png differ diff --git a/Components/Environment/CreatePCD/image_5.png b/Components/Environment/CreatePCD/image_5.png new file mode 100644 index 0000000000..615c5c9b12 Binary files /dev/null and b/Components/Environment/CreatePCD/image_5.png differ diff --git a/Components/Environment/CreatePCD/image_6.png b/Components/Environment/CreatePCD/image_6.png new file mode 100644 index 0000000000..958c6cb2f6 Binary files /dev/null and b/Components/Environment/CreatePCD/image_6.png differ diff --git a/Components/Environment/CreatePCD/index.html b/Components/Environment/CreatePCD/index.html new file mode 100644 index 0000000000..52d162e092 --- /dev/null +++ b/Components/Environment/CreatePCD/index.html @@ -0,0 +1,3128 @@ + + + + + + + + + + + + + + + + + + + + + + + Create PCD - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Create PCD

+
+

This section

+

This section is still under development!

+
+ + +

PointCloudMapper

+

+

Description

+

PointCloudMapper is a tool for a vehicle based point cloud mapping in a simulation environment. +It is very useful when you need a point cloud based on some location, but don't have the possibility to physically map the real place. +Instead you can map the simulated environment.

+

Required Data

+

To properly perform the mapping, make sure you have the following files downloaded and configured:

+
    +
  • Lanelet2 format OSM data (*.osm file)
  • +
  • +

    3D model map of the area

    +
    +

    How to obtain a map

    +

    You can obtain the 3D model of the area by using a Environment prefab prepared for AWSIM or by creating your own. +You can learn how to create you own Environment prefab in this tutorial.

    +
    +
  • +
  • +

    Configured in-simulation vehicle object with sensors attached (only the LiDAR is necessary)

    + +
    +

    Vehicle model

    +

    For the sake of creating a PCD the vehicle model doesn't have to be accurate. +It will be just a carrier for LiDAR. +The model can even be a simple box as shown earlier in this tutorial. +Make sure it is not visible to the LiDAR, so it does not break the sensor readings.

    +
    +
  • +
+

Import OSM

+
    +
  1. +

    Drag and drop an OSM file into Unity project.

    +

    move osm file

    +
  2. +
  3. +

    OSM file will be imported as OsmDataContainer.

    +
  4. +
+

Setup an Environment

+

For mapping an Environment prefab is needed. +The easiest way is to create a new Scene and import the Environment prefab into it. +Details on how to do this can be found on this tutorial page.

+

Setup a Vehicle

+

Create a Vehicle GameObject in the Hierarchy view.

+

add vehicle object

+

Add visual elements (optional)

+

Add vehicle model by adding a Geometry Object as a child of Vehicle and adding all visual elements as children.

+

vehicle add geometry

+
+

Visual elements

+

You can learn how to add visual elements and required components like Mesh Filter or Mesh Renderer in this tutorial.

+
+

Add a Camera (optional)

+

Add a Camera component for enhanced visuals by adding a Main Camera Object as a child of Vehicle Object and attaching a Camera Component to it.

+
    +
  1. +

    Add a Main Camera Object.

    +

    vehicle camera add object

    +
  2. +
  3. +

    Add a Camera Component by clicking 'Add Component' button, searching for it and selecting it.

    +

    vehicle camera add component

    +
  4. +
  5. +

    Change the Transform for an even better visual experience.

    +
    +

    Camera preview

    +

    Observe how the Camera preview changes when adjusting the transformation.

    +
    +

    vehicle camera transform

    +
  6. +
+

Setup Vehicle Sensors (RGL)

+

This part of the tutorial shows how to add a LiDAR sensor using RGL.

+
+

RGL Scene Manager

+

Please make sure that RGLSceneManager is added to the scene. +For more details and instruction how to do it please visit this tutorial page.

+
+
    +
  1. +

    Create an empty Sensors GameObject as a child of the Vehicle Object.

    +

    add sensors object

    +
  2. +
  3. +

    Create a Lidar GameObject as a child of the Sensors Object.

    +

    add lidar object

    +
  4. +
  5. +

    Attach Lidar Sensor (script) to previously created Lidar Object by clicking on the 'Add Component' button, searching for the script and selecting it.

    +
    +

    Point Cloud Visualization

    +

    Please note that Point Cloud Visualization (script) will be added automatically with the Lidar Sensor (script).

    +
    +

    add lidar sensor script

    +

    lidar sensor search

    +
  6. +
  7. +

    Configure LiDAR pattern, e.g. by selecting one of the available presets.

    +
    +

    Example Lidar Sensor configuration

    +

    lidar sensor configuration example

    +
    +
    +

    Gaussian noise

    +

    Gaussian noise should be disabled to achieve a more accurate map.

    +
    +
  8. +
  9. +

    Attach RGL Mapping Adapter (script) to previously created Lidar Object by clicking on the 'Add Component' button, searching for the script and selecting it.

    +

    add rgl mapping adapter script

    +

    rgl mapping adapter search

    +
  10. +
  11. +

    Configure RGL Mapping Adapter - e.g. set Leaf Size for filtering.

    +
    +

    Example RGL Mapping Adapter configuration

    +

    rgl mapping adapter configuration example

    +
    +
    +

    Downsampling

    +

    Please note that downsampling is applied on the single LiDAR scans only. If you would like to filter merged scans use the external tool described below.

    +
    +
  12. +
+

Effect of Leaf Size to Point Cloud Data (PCD) generation

+

Downsampling aims to reduce PCD size which for large point clouds may achieve gigabytes in exchange for map details. It is essential to find the best balance between the size and acceptable details level.

+

A small Leaf Size results in a more detailed PCD, while a large Leaf Size could result in excessive filtering such that objects like buildings are not recorded in the PCD.

+

In the following examples, it can be observed that when a Leaf Size is 1.0, point cloud is very detailed. +When a Leaf Size is 100.0, buildings are filtered out and results in an empty PCD. +A Leaf Size of 10.0 results in a reasonable PCD in the given example.

+ + + + + + + + + + + + + + + +
Leaf Size = 1.0Leaf Size = 10.0Leaf Size = 100.0
+

Setup PointCloudMapper

+
    +
  1. +

    Create a PointCloudMapper GameObject in the Hierarchy view.

    +

    add point cloud mapper object

    +
  2. +
  3. +

    Attach Point Cloud Mapper script to previously created Point Cloud Mapper Object by clicking on the 'Add Component' button, searching for the script and selecting it.

    +

    add point cloud mapper script

    +

    point cloud mapper search

    +
  4. +
  5. +

    Configure the Point Cloud Mapper fields:

    +
      +
    • Osm Container - the OSM file you imported earlier
    • +
    • +

      World Origin - MGRS position of the origin of the scene

      +
      +

      World Origin coordinate system

      +

      Use ROS coordinate system for World Origin, not Unity.

      +
      +
    • +
    • +

      Capture Location Interval - Distance between consecutive capture points along lanelet centerline

      +
    • +
    • Output Pcd File Path - Output relative path from Assets folder
    • +
    • Target Vehicle - The vehicle you want to use for point cloud capturing that you created earlier
    • +
    +
    +

    Example Point Cloud Mapper configuration

    +

    point cloud mapper configuration example

    +
    +
    +

    Lanelet visualization

    +

    point cloud mapper disabled lanelet visualizer +It is recommended to disable Lanelet Visualizer by setting Material to None and Width equal to zero. Rendered Lanelet is not ignored by the LiDAR so it would be captured in the PCD.

    +
    +
  6. +
+

Effect of Capture Location Interval to PCD generation

+

If the Capture Location Interval is too small, it could result in a sparse PCD where some region of the map is captured well but the other regions aren't captured at all.

+

In the below example, Leaf Size of 0.2 was used. Please note that using a different combination of leaf size and Capture Location Interval may result in a different PCD.

+ + + + + + + + + + + + + + + +
Capture Location Interval = 6Capture Location Interval = 20Capture Location Interval = 100
+

Capture and Generate PCD

+

If you play simulation with a scene prepared with the steps above, PointCloudMapper will automatically start mapping. +The vehicle will warp along centerlines by intervals of CaptureLocationInterval and capture point cloud data. +PCD file will be written when you stop your scene or all locations in the route are captured.

+

If the Vehicle stops moving for longer and you see the following message in the bottom left corner - you can safely stop the scene.

+

pcd save success

+

The Point cloud *.pcd file is saved to the location you specified in the Point Cloud Mapper.

+

PCD postprocessing

+
+

Install required tool

+

The tool (DownsampleLargePCD) required for PCD conversion can be found under the link. README contains building instruction and usage.

+
+

The generated PCD file is typically too large. Therefore you need to downsample it. Also, it should be converted to ASCII format because Autoware accepts only this format. PointCloudMapper returns PCD in binary format.

+
    +
  1. Change the working directory to the location with DownsampleLargePCD tool.
  2. +
  3. +

    Use this tool to downsample and save PCD in ASCII format. +

    ./DownsampleLargePCD -in <PATH_TO_INPUT_PCD> -out <PATH_TO_OUTPUT_PCD> -leaf 0.2,0.2,0.2
    +

    +
      +
    • Assuming input PCD is in your working directory and named in_cloud.pcd and output PCD is to be named out_cloud.pcd the command will be: +
      ./DownsampleLargePCD -in in_cloud.pcd -out out_cloud.pcd -leaf 0.2,0.2,0.2
      +
    • +
    • You can also save PCD in binary format by adding -binary 1 option.
    • +
    +
  4. +
  5. +

    Your PCD is ready to use.

    +
  6. +
+
+

Converting PCD format without downsampling

+

If you don't want to downsample your PCD you can convert PCD file to ASCII format with pcl_convert_pcd_ascii_binary tool. This tool is available in the pcl-tools package and can be installed on Ubuntu with the following command: +

sudo apt install pcl-tools
+
+To convert your PCD use command: +
pcl_convert_pcd_ascii_binary <PATH_TO_INPUT_PCD> <PATH_TO_OUTPUT_PCD> 0
+

+
+

Verify the PCD

+

To verify your PCD you can launch the Autoware with the PCD file specified.

+
    +
  1. +

    Copy your PCD from the AWSIM project directory to the Autoware map directory.

    +
    cp <PATH_TO_PCD_FILE> <PATH_TO_AUTOWARE_MAP>/
    +
    +
  2. +
  3. +

    Source the ROS and Autoware

    +
    source /opt/ros/humble/setup.bash
    +source <PATH_TO_AUTOWARE>/install/setup.bash
    +
    +
  4. +
  5. +

    Launch the planning simulation with the map directory path (map_path) and PCD file (pointcloud_map_file) specified.

    +
    +

    PCD file location

    +

    The PCD file needs to be located in the Autoware map directory and as a pointcloud_map_file parameter you only supply the file name, not the path.

    +
    +
    +

    Absolute path

    +

    When launching Autoware never use ~/ to specify the home directory. +Either write the full absolute path ot use $HOME environmental variable.

    +
    +
    ros2 launch autoware_launch planning_simulator.launch.xml vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit map_path:=<ABSOLUTE_PATH_TO_AUTOWARE_MAP> pointcloud_map_file:=<PCD_FILE_NAME>
    +
    +
  6. +
  7. +

    Wait for the Autoware to finish loading and inspect the PCD visually given the Effect of Leaf Size and Effect of Capture Location Interval.

    +

    +
  8. +
+

Sample Scene

+

PointCloudMapping.unity is a sample scene for PointCloudMapper showcase. It requires setup of OSM data and 3D model map of the area according to the steps above.

+
+

Sample Mapping Scene

+

In this example you can see a correctly configured Point Cloud Mapping Scene.

+

+
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Environment/CreatePCD/lidar_sensor_configuration.png b/Components/Environment/CreatePCD/lidar_sensor_configuration.png new file mode 100644 index 0000000000..19cd639318 Binary files /dev/null and b/Components/Environment/CreatePCD/lidar_sensor_configuration.png differ diff --git a/Components/Environment/CreatePCD/lidar_sensor_search.png b/Components/Environment/CreatePCD/lidar_sensor_search.png new file mode 100644 index 0000000000..22b63dd32c Binary files /dev/null and b/Components/Environment/CreatePCD/lidar_sensor_search.png differ diff --git a/Components/Environment/CreatePCD/move_osm.gif b/Components/Environment/CreatePCD/move_osm.gif new file mode 100644 index 0000000000..7b3ae7b9a2 Binary files /dev/null and b/Components/Environment/CreatePCD/move_osm.gif differ diff --git a/Components/Environment/CreatePCD/move_osm2.gif b/Components/Environment/CreatePCD/move_osm2.gif new file mode 100644 index 0000000000..a358fa83cc Binary files /dev/null and b/Components/Environment/CreatePCD/move_osm2.gif differ diff --git a/Components/Environment/CreatePCD/pcd_save_success.png b/Components/Environment/CreatePCD/pcd_save_success.png new file mode 100644 index 0000000000..715a9e2214 Binary files /dev/null and b/Components/Environment/CreatePCD/pcd_save_success.png differ diff --git a/Components/Environment/CreatePCD/point_cloud_mapper_add_object2.gif b/Components/Environment/CreatePCD/point_cloud_mapper_add_object2.gif new file mode 100644 index 0000000000..d4e3d0f084 Binary files /dev/null and b/Components/Environment/CreatePCD/point_cloud_mapper_add_object2.gif differ diff --git a/Components/Environment/CreatePCD/point_cloud_mapper_add_script.gif b/Components/Environment/CreatePCD/point_cloud_mapper_add_script.gif new file mode 100644 index 0000000000..0d5b696b68 Binary files /dev/null and b/Components/Environment/CreatePCD/point_cloud_mapper_add_script.gif differ diff --git a/Components/Environment/CreatePCD/point_cloud_mapper_configuration2.png b/Components/Environment/CreatePCD/point_cloud_mapper_configuration2.png new file mode 100644 index 0000000000..93f6b6d6b5 Binary files /dev/null and b/Components/Environment/CreatePCD/point_cloud_mapper_configuration2.png differ diff --git a/Components/Environment/CreatePCD/point_cloud_mapper_disable_ll.png b/Components/Environment/CreatePCD/point_cloud_mapper_disable_ll.png new file mode 100644 index 0000000000..e8cb6fb06e Binary files /dev/null and b/Components/Environment/CreatePCD/point_cloud_mapper_disable_ll.png differ diff --git a/Components/Environment/CreatePCD/point_cloud_mapper_search.png b/Components/Environment/CreatePCD/point_cloud_mapper_search.png new file mode 100644 index 0000000000..c46919c65b Binary files /dev/null and b/Components/Environment/CreatePCD/point_cloud_mapper_search.png differ diff --git a/Components/Environment/CreatePCD/point_cloud_mapping_add_lidar.gif b/Components/Environment/CreatePCD/point_cloud_mapping_add_lidar.gif new file mode 100644 index 0000000000..4ea21ad1ed Binary files /dev/null and b/Components/Environment/CreatePCD/point_cloud_mapping_add_lidar.gif differ diff --git a/Components/Environment/CreatePCD/point_cloud_mapping_add_lidar_adapter_script.gif b/Components/Environment/CreatePCD/point_cloud_mapping_add_lidar_adapter_script.gif new file mode 100644 index 0000000000..a76b625e8a Binary files /dev/null and b/Components/Environment/CreatePCD/point_cloud_mapping_add_lidar_adapter_script.gif differ diff --git a/Components/Environment/CreatePCD/point_cloud_mapping_add_lidar_sensor_script.gif b/Components/Environment/CreatePCD/point_cloud_mapping_add_lidar_sensor_script.gif new file mode 100644 index 0000000000..fdd76dd9e1 Binary files /dev/null and b/Components/Environment/CreatePCD/point_cloud_mapping_add_lidar_sensor_script.gif differ diff --git a/Components/Environment/CreatePCD/point_cloud_mapping_add_sensors.gif b/Components/Environment/CreatePCD/point_cloud_mapping_add_sensors.gif new file mode 100644 index 0000000000..111da39a8a Binary files /dev/null and b/Components/Environment/CreatePCD/point_cloud_mapping_add_sensors.gif differ diff --git a/Components/Environment/CreatePCD/point_cloud_mapping_scene.mp4 b/Components/Environment/CreatePCD/point_cloud_mapping_scene.mp4 new file mode 100644 index 0000000000..8c8e8a3036 Binary files /dev/null and b/Components/Environment/CreatePCD/point_cloud_mapping_scene.mp4 differ diff --git a/Components/Environment/CreatePCD/point_cloud_matter_add_container.gif b/Components/Environment/CreatePCD/point_cloud_matter_add_container.gif new file mode 100644 index 0000000000..7f2c1b3b6a Binary files /dev/null and b/Components/Environment/CreatePCD/point_cloud_matter_add_container.gif differ diff --git a/Components/Environment/CreatePCD/rgl_mapping_adapter_configuration.png b/Components/Environment/CreatePCD/rgl_mapping_adapter_configuration.png new file mode 100644 index 0000000000..1b605dba21 Binary files /dev/null and b/Components/Environment/CreatePCD/rgl_mapping_adapter_configuration.png differ diff --git a/Components/Environment/CreatePCD/rgl_mapping_adapter_search.png b/Components/Environment/CreatePCD/rgl_mapping_adapter_search.png new file mode 100644 index 0000000000..dad4d9bfeb Binary files /dev/null and b/Components/Environment/CreatePCD/rgl_mapping_adapter_search.png differ diff --git a/Components/Environment/CreatePCD/vehicle_camera_add_component.gif b/Components/Environment/CreatePCD/vehicle_camera_add_component.gif new file mode 100644 index 0000000000..df589ad7e0 Binary files /dev/null and b/Components/Environment/CreatePCD/vehicle_camera_add_component.gif differ diff --git a/Components/Environment/CreatePCD/vehicle_camera_add_object.gif b/Components/Environment/CreatePCD/vehicle_camera_add_object.gif new file mode 100644 index 0000000000..4980816f88 Binary files /dev/null and b/Components/Environment/CreatePCD/vehicle_camera_add_object.gif differ diff --git a/Components/Environment/CreatePCD/vehicle_camera_transform.gif b/Components/Environment/CreatePCD/vehicle_camera_transform.gif new file mode 100644 index 0000000000..8697f174d1 Binary files /dev/null and b/Components/Environment/CreatePCD/vehicle_camera_transform.gif differ diff --git a/Components/Environment/CreatePCD/vehicle_geometry_add_object.gif b/Components/Environment/CreatePCD/vehicle_geometry_add_object.gif new file mode 100644 index 0000000000..731c9f5186 Binary files /dev/null and b/Components/Environment/CreatePCD/vehicle_geometry_add_object.gif differ diff --git a/Components/Environment/LaneletBoundsVisualizer/image_0.png b/Components/Environment/LaneletBoundsVisualizer/image_0.png new file mode 100644 index 0000000000..1db9ab6ed8 Binary files /dev/null and b/Components/Environment/LaneletBoundsVisualizer/image_0.png differ diff --git a/Components/Environment/LaneletBoundsVisualizer/image_1.png b/Components/Environment/LaneletBoundsVisualizer/image_1.png new file mode 100644 index 0000000000..3c1715e526 Binary files /dev/null and b/Components/Environment/LaneletBoundsVisualizer/image_1.png differ diff --git a/Components/Environment/LaneletBoundsVisualizer/image_2.png b/Components/Environment/LaneletBoundsVisualizer/image_2.png new file mode 100644 index 0000000000..77f02c3a44 Binary files /dev/null and b/Components/Environment/LaneletBoundsVisualizer/image_2.png differ diff --git a/Components/Environment/LaneletBoundsVisualizer/image_3.png b/Components/Environment/LaneletBoundsVisualizer/image_3.png new file mode 100644 index 0000000000..2cd0bc95aa Binary files /dev/null and b/Components/Environment/LaneletBoundsVisualizer/image_3.png differ diff --git a/Components/Environment/LaneletBoundsVisualizer/image_4.png b/Components/Environment/LaneletBoundsVisualizer/image_4.png new file mode 100644 index 0000000000..8ac246abb4 Binary files /dev/null and b/Components/Environment/LaneletBoundsVisualizer/image_4.png differ diff --git a/Components/Environment/LaneletBoundsVisualizer/image_5.png b/Components/Environment/LaneletBoundsVisualizer/image_5.png new file mode 100644 index 0000000000..765478103b Binary files /dev/null and b/Components/Environment/LaneletBoundsVisualizer/image_5.png differ diff --git a/Components/Environment/LaneletBoundsVisualizer/index.html b/Components/Environment/LaneletBoundsVisualizer/index.html new file mode 100644 index 0000000000..3bb8daf1fd --- /dev/null +++ b/Components/Environment/LaneletBoundsVisualizer/index.html @@ -0,0 +1,2540 @@ + + + + + + + + + + + + + + + + + + + + + + + LaneletBoundsVisualizer - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Lanelet Bounds Visualizer

+

Lanelet Bounds Visualizer is an Unity Editor extension allowing the user to load the left and right bounds of Lanelet to the Unity scene.

+

Usage

+

The lanelet bounds load process can be performed by opening AWSIM -> Visualize -> Load Lanelet Bounds at the top toolbar of Unity Editor.

+

+

A window shown below will pop up. Select your Osm Data Container to specify which OSM data to load the Lanelet from.

+

+

The user can select whether to load the raw Lanelet or to adjust the resolution of the Lanelet by specifying the waypoint settings.

+

To load the raw Lanelet, simply click the Load Raw Lanelet button.

+

If the user wishes to change the resolution of the Lanelet, adjust the parameters of the Waypoint Settings as described below, and click the Load with Waypoint Settings button.

+
    +
  • Resolution : resolution of resampling. Lower values provide better accuracy at the cost of processing time.
  • +
  • Min Delta Length : minimum length(m) between adjacent points.
  • +
  • Min Delta Angle : minimum angle(deg) between adjacent edges. Lowering this value produces a smoother curve.
  • +
+

Once the Lanelet is successfully loaded, Lanelet bounds will be generated as a new GameObject named LaneletBounds.

+

To visualize the LaneletBounds, make sure Gizmos is turned on and select the LaneletBounds GameObject. +

+

Important Notes

+

Generally speaking, visualizing Lanelet Bounds will result in a very laggy simulation. Therefore, it is recommended to hide the LaneletBounds GameObject when not used. The lag of the simulation becomes worse as you set the resolution of the Lanelet Bounds higher, so it is also recommended to set the resolution within a reasonable range.

+

It is also important to note that no matter how high you set the resolution to be, it will not be any better than the original Lanelet (i.e. the raw data). Rather, the computational load will increase and the simulation will become more laggy. If the user wishes to get the highest quality of Lanelet Bounds, it is recommended to use the Load Raw Lanelet button.

+

In short, Waypoint Setting parameters should be thought of as parameters to decrease the resolution from the original Lanelet to decrease the computational load and thus, reducing the lag of the simulation.

+ + + + + + + + + + + + + + + +
Higher ResolutionRaw LaneletLower Resolution
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Environment/SmokeSimulator/image_0.png b/Components/Environment/SmokeSimulator/image_0.png new file mode 100644 index 0000000000..6500dd9bba Binary files /dev/null and b/Components/Environment/SmokeSimulator/image_0.png differ diff --git a/Components/Environment/SmokeSimulator/image_1.png b/Components/Environment/SmokeSimulator/image_1.png new file mode 100644 index 0000000000..0ad5c67f85 Binary files /dev/null and b/Components/Environment/SmokeSimulator/image_1.png differ diff --git a/Components/Environment/SmokeSimulator/image_2.png b/Components/Environment/SmokeSimulator/image_2.png new file mode 100644 index 0000000000..d7a6a62257 Binary files /dev/null and b/Components/Environment/SmokeSimulator/image_2.png differ diff --git a/Components/Environment/SmokeSimulator/image_3.png b/Components/Environment/SmokeSimulator/image_3.png new file mode 100644 index 0000000000..1102ada04e Binary files /dev/null and b/Components/Environment/SmokeSimulator/image_3.png differ diff --git a/Components/Environment/SmokeSimulator/image_4.png b/Components/Environment/SmokeSimulator/image_4.png new file mode 100644 index 0000000000..5061e45466 Binary files /dev/null and b/Components/Environment/SmokeSimulator/image_4.png differ diff --git a/Components/Environment/SmokeSimulator/index.html b/Components/Environment/SmokeSimulator/index.html new file mode 100644 index 0000000000..80c8532935 --- /dev/null +++ b/Components/Environment/SmokeSimulator/index.html @@ -0,0 +1,2591 @@ + + + + + + + + + + + + + + + + + + + + + + + SmokeSimulator - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Smoke Simulator

+

+Simulating smoke in AWSIM may be useful when one wants to simulate exhaust gases from vehicles, smoke from emergency flare, etc.

+

In Unity, it is common to use Particle System to simulate smokes. +However, smoke simulated by Particle System cannot be sensed by RGL in AWSIM although in reality, smokes are detected by LiDAR.

+

Smoke Simulator was developed to simulate smokes that can be detected by RGL in Unity. +Smoke Simulator works by instantiating many small cubic GameObjects called Smoke Particles and allows each particle to be detected by RGL.

+

This document describes how to use the Smoke Simulator.

+

Setting Smoke Simulator

+

1.Create an empty GameObject

+

2.Attach SmokeGenerator.cs to the previously created GameObject.

+

+

3.Adjust the parameters of the SmokeGenerator as described below:

+
    +
  • Max Particle: Specifies the maximum number of particles created by the Smoke Generator
  • +
  • Particle Range Radius: Specifies the radius of a circle, centered at the GameObject, which defines the region in which Smoke Particles are generated in
  • +
  • Particle Size: Specifies the edge of a Smoke Particle
  • +
  • Average Lifetime: Specifies the average lifetime of a Smoke Particle
  • +
  • +

    Variation Lifetime: Specifies the variation of lifetime of Smoke Particles.

    +

    The lifetime of a Smoke Particle is calculated as follows:

    +
    `lifetime` = `Average Lifetime` + Random.Range(-`Variation Lifetime`, `Variation Lifetime`)
    +
    +
  • +
  • +

    Physics: These parameters can be adjusted to specify the behavior of the smoke particles.

    +
      +
    • Initial Plane Velocity: Specifies the velocity of a SmokeParticle in the x-z plane
    • +
    • Initial Vertical Velocity: Specifies the velocity of a SmokeParticle in the vertical direction
    • +
    • Plane Acceleration: Specifies the acceleration of a SmokeParticle in the x-z plane
    • +
    • Vertical Acceleration: Specifies the acceleration of a SmokeParticle in the vertical direction
    • +
    +
  • +
+

4.(Optional): You may also specify the Material of Smoke Particles. If this field is unspecified, a default material is used

+

+

Example of Different Smokes

+

Thin Smoke

+

+

Heavy Smoke

+

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Environment/V2I/add_component.gif b/Components/Environment/V2I/add_component.gif new file mode 100644 index 0000000000..0c98c28ca4 Binary files /dev/null and b/Components/Environment/V2I/add_component.gif differ diff --git a/Components/Environment/V2I/add_component_1.gif b/Components/Environment/V2I/add_component_1.gif new file mode 100644 index 0000000000..31aedfb20f Binary files /dev/null and b/Components/Environment/V2I/add_component_1.gif differ diff --git a/Components/Environment/V2I/add_component_2.gif b/Components/Environment/V2I/add_component_2.gif new file mode 100644 index 0000000000..c242437a78 Binary files /dev/null and b/Components/Environment/V2I/add_component_2.gif differ diff --git a/Components/Environment/V2I/add_component_3.gif b/Components/Environment/V2I/add_component_3.gif new file mode 100644 index 0000000000..e627ca521d Binary files /dev/null and b/Components/Environment/V2I/add_component_3.gif differ diff --git a/Components/Environment/V2I/add_prefab.gif b/Components/Environment/V2I/add_prefab.gif new file mode 100644 index 0000000000..036461e153 Binary files /dev/null and b/Components/Environment/V2I/add_prefab.gif differ diff --git a/Components/Environment/V2I/index.html b/Components/Environment/V2I/index.html new file mode 100644 index 0000000000..10c5949aea --- /dev/null +++ b/Components/Environment/V2I/index.html @@ -0,0 +1,2666 @@ + + + + + + + + + + + + + + + + + + + + + + + V2I - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

V2I (Vehicle-to-Infrastructure)

+

V2I is a component that simulates V2I communication protocol which allows to exchange data between vehicles and road infrastructure. In the current version of AWSIM, the V2I component publishes information about traffic lights.

+

How to add V2I to the environment

+

Assign Lanelet2 WayID and RelationID to TrafficLight object

+
    +
  1. +

    Load items from lanelet2 following the instruction

    +
  2. +
  3. +

    Verify if Traffic Light Lanelet ID component has been added to Traffic Light game objects. +verify traffic light lanelet id

    +
  4. +
  5. +

    Verify if WayID and RelationID has been correctly assigned. You can use Vector Map Builder as presented below +verify lanelet ids

    +
  6. +
+

Add manually Traffic Light Lanelet ID component (alternatively)

+

If for some reason, Traffic Light Lanelet ID component is not added to Traffic Light object.

+
    +
  1. +

    Add component manually

    +

    add component 1

    +
  2. +
  3. +

    Fill Way ID

    +

    add component 2

    +
  4. +
  5. +

    Fill Relation ID

    +

    add component 3

    +
  6. +
+

Add V2I prefab

+

add prefab

+

Select EGO transform

+

select ego transform 1 +select ego transform 2 +select ego transform 3

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
Output HzintTopic publication frequency
Ego Vehicle TransformtransformEgo Vehicle object transform
Ego Distance To Traffic SignalsdoubleMaximum distance between Traffic Light and Ego
Traffic Signal IDenumPossibility to select if as traffic_signal_id field in msg is Relation ID or Way ID
Traffic Signals TopicstringTopic name
+
+

Note

+

V2I feature can be used as Traffic Light ground truth information, and for that usage Way ID is supposed to be selected.

+
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Environment/V2I/select_ego_transform_1.png b/Components/Environment/V2I/select_ego_transform_1.png new file mode 100644 index 0000000000..4a31d2c6e8 Binary files /dev/null and b/Components/Environment/V2I/select_ego_transform_1.png differ diff --git a/Components/Environment/V2I/select_ego_transform_2.gif b/Components/Environment/V2I/select_ego_transform_2.gif new file mode 100644 index 0000000000..50ab828b9b Binary files /dev/null and b/Components/Environment/V2I/select_ego_transform_2.gif differ diff --git a/Components/Environment/V2I/select_ego_transform_3.png b/Components/Environment/V2I/select_ego_transform_3.png new file mode 100644 index 0000000000..45a153a1f2 Binary files /dev/null and b/Components/Environment/V2I/select_ego_transform_3.png differ diff --git a/Components/Environment/V2I/verify_lanelet_ids.png b/Components/Environment/V2I/verify_lanelet_ids.png new file mode 100644 index 0000000000..b1d1ce06d8 Binary files /dev/null and b/Components/Environment/V2I/verify_lanelet_ids.png differ diff --git a/Components/Environment/V2I/verify_traffic_light_lanelet_id.png b/Components/Environment/V2I/verify_traffic_light_lanelet_id.png new file mode 100644 index 0000000000..14cea9c2a0 Binary files /dev/null and b/Components/Environment/V2I/verify_traffic_light_lanelet_id.png differ diff --git a/Components/ROS2/AddACustomROS2Message/index.html b/Components/ROS2/AddACustomROS2Message/index.html new file mode 100644 index 0000000000..bc56145856 --- /dev/null +++ b/Components/ROS2/AddACustomROS2Message/index.html @@ -0,0 +1,2904 @@ + + + + + + + + + + + + + + + + + + + + + + + Add custom ROS2 msg - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Add a custom ROS2 message

+

If you want to use custom message in AWSIM, you need to generate the appropriate files, to do this you have to build ROS2ForUnity yourself - please follow the steps below. Remember to start with prerequisities though.

+
+

ROS2ForUnity role

+

For a better understanding of the role of ROS2ForUnity and the messages used, we encourage you to read this section.

+
+
+

custom_msgs

+

In order to simplify this tutorial, the name of the package containing the custom message is assumed to be custom_msgs - remember to replace it with the name of your package.

+
+

Prerequisites

+

ROS2ForUnity depends on a ros2cs - a C# .NET library for ROS2.
+This library is already included so you don't need to install it, but there are a few prerequisites that must be resolved first.

+

Please select your system and resolve all prerequisites:

+
+
+
+
    +
  • ros2cs prerequisites for Ubuntu
  • +
  • ROS2 version is humble and is located in /opt/ros/humble
  • +
  • Your package with custom message is located in the home directory ~/custom_msgs or is hosted on git repository.
  • +
  • Shell - commands have to be executed from the bash shell
  • +
+
+
+
    +
  • +

    ros2cs prerequisites for Windows

    +
    +

    Question

    +

    Tests are not working ('charmap' codec can't decode byte) on Windows - look at troubleshooting here

    +
    +
  • +
  • +

    ROS2 version is humble and is located in C:\ros2_humble

    +
  • +
  • Your package with custom message package is located in the home directory C:\custom_msgs or is hosted on git repository.
  • +
  • Shell - commands should be executed from the powershell shell
  • +
+
+
+
+

1. Workspace preparation

+
    +
  1. +

    Clone ROS2ForUnity repository by execute command:

    +
    +
    +
    +
    git clone https://github.com/RobotecAI/ros2-for-unity ~/
    +
    +
    +

    Warning

    +

    The cloned ROS 2 For Unity repository must be located in the home directory ~/.

    +
    +
    +
    +
    git clone https://github.com/RobotecAI/ros2-for-unity /C
    +
    +
    +

    Warning

    +

    The cloned ROS 2 For Unity repository must be located in the home directory C:\.

    +
    +
    +
    +
    +
  2. +
  3. +

    Pull dependent repositories by execute commands:

    +
    +
    +
    +
    cd ~/ros2-for-unity
    +. /opt/ros/humble/setup.bash
    +./pull_repositories.sh
    +
    +
    +
    +
    cd C:\ros2-for-unity
    +C:\ros2_humble\local_setup.ps1
    +.\pull_repositories.ps1
    +
    +
    +
    +
    +
  4. +
+

2. Setup custom_msgs package

+

The method to add a custom package to build depends on where it is located. The package can be on your local machine or just be hosted on a git repository.
+Please, choose the appropriate option and follow the instructions.

+ + +

2.1. Package contained on local machine

+
    +
  1. +

    Copy the custom_msgs package with custom message to the folder to src/ros2cs/custom_messages directory

    +
    +
    +
    +
    cp -r ~/custom_msgs ~/ros2-for-unity/src/ros2cs/custom_messages/
    +
    +
    +
    +
    Copy-Item 'C:\custom_msgs' -Destination 'C:\ros2-for-unity\src\custom_messages'
    +
    +
    +
    +
    +
  2. +
+

2.2. Package hosted on git repository

+
    +
  1. Open ros2-for-unity/ros2_for_unity_custom_messages.repos file in editor.
  2. +
  3. +

    Modify the contents of the file shown below, uncomment and set:

    +
      +
    • <package_name> - to your package name - so in this case custom_msgs,
    • +
    • <repo_url> - to repository address,
    • +
    • <repo_branch> - to desired branch. +
      repositories:
      +#  src/ros2cs/custom_messages/<package_name>:
      +#    type: git
      +#    url: <repo_url>
      +#    version: <repo_branch>
      +
    • +
    +
    +

    Example

    +

    Below is an example of a file configured to pull 2 packages (custom_msgs,autoware_auto_msgs) of messages hosted on a git repository. +

    # NOTE: Use this file if you want to build with custom messages that reside in a separate remote repo.
    +# NOTE: use the following format
    +
    +repositories:
    +    src/ros2cs/custom_messages/custom_msgs:
    +        type: git
    +        url: https://github.com/tier4/custom_msgs.git
    +        version: main
    +    src/ros2cs/custom_messages/autoware_auto_msgs:
    +        type: git
    +        url: https://github.com/tier4/autoware_auto_msgs.git
    +        version: tier4/main
    +

    +
    +
  4. +
  5. +

    Now pull the repositories again (also the custom_msgs package repository)

    +
    +
    +
    +
    cd ~/ros2-for-unity
    +./pull_repositories.sh
    +
    +
    +
    +
    cd C:\ros2-for-unity
    +.\pull_repositories.ps1
    +
    +
    +
    +
    +
  6. +
+

3. Build ROS 2 For Unity

+

Build ROS2ForUnity with custom message packages using the following commands:

+
+
+
+
cd ~/ros2-for-unity
+./build.sh --standalone
+
+
+
+
cd C:\ros2-for-unity
+.\build.ps1 -standalone
+
+
+
+
+

4. Install custom_msgs to AWSIM

+

New ROS2ForUnity build, which you just made in step 3, contains multiple libraries that already exist in the AWSIM.
+To install custom_msgs and not copy all other unnecessary files, you should get the custom_msgs related libraries only.

+

You can find them in following directories and simply copy to the analogous directories in AWSIM/Assets/Ros2ForUnity folder, or use the script described here.

+
+
+
+
    +
  • ros2-for-unity/install/asset/Ros2ForUnity/Plugins which names matches custom_msgs_*
  • +
  • ros2-for-unity/install/asset/Ros2ForUnity/Plugins/Linux/x86_64/ which names matches libcustom_msgs_*
  • +
+
+
+
    +
  • ros2-for-unity/install/asset/Ros2ForUnity/Plugins which names matches custom_msgs_*
  • +
  • ros2-for-unity/install/asset/Ros2ForUnity/Plugins/Windows/x86_64/ which names matches custom_msgs_*
  • +
+
+
+
+

Automation of copying message files

+
+
+
+

To automate the process, you can use a script that copies all files related to your custom_msgs package.

+
    +
  1. Create a file named copy_custom_msgs.sh in directory ~/ros2-for-unity/ and paste the following content into it. +
    #!/bin/bash
    +echo "CUSTOM_MSGS_PACKAGE_NAME: $1"
    +echo "AWSIM_DIR_PATH: $2"
    +find ./install/asset/Ros2ForUnity/Plugins -maxdepth 1 -name "$1*"    -type f -exec cp {} $2/Assets/Ros2ForUnity/Plugins \;
    +find ./install/asset/Ros2ForUnity/Plugins/Linux/x86_64 -maxdepth 1 -name     "lib$1*" -type f -exec cp {} $2/Assets/Ros2ForUnity/Plugins/Linux/x86_64 \;
    +
  2. +
  3. Save the file and give it executable rights with the command: +
    chmod a+x copy_msgs.sh
    +
  4. +
  5. +

    Run the script with two arguments: +

    ./copy_custom_msgs.sh <CUSTOM_MSGS_PACKAGE_NAME> <AWSIM_DIR_PATH>
    +

    +
  6. +
  7. +

    <CUSTOM_MSGS_PACKAGE_NAME> - the first one which is the name of the package with messages - in this case custom_msgs,

    +
  8. +
  9. <AWSIM_DIR_PATH> - the second which is the path to the cloned AWSIM repository.
  10. +
+
+

Example

+
./copy_custom_msgs.sh custom_msgs ~/unity/AWSIM/
+
+
+
+
+

To automate the process, you can use these commands with changed:

+
    +
  • <CUSTOM_MSGS_PACKAGE_NAME> - the name of your package with messages - in this case custom_msgs,
  • +
  • <AWSIM_DIR_PATH> - to path to the cloned AWSIM repository +
    Get-ChildItem C:\ros2-for-unity\install\asset\Ros2ForUnity\Plugins\* -Include @('<CUSTOM_MSGS_PACKAGE_NAME>*') | Copy-Item -Destination <AWSIM_DIR_PATH>\Assets\Ros2ForUnity\Plugins
    +Get-ChildItem C:\ros2-for-unity\install\asset\Ros2ForUnity\Plugins\Windows\x86_64\* -Include @('<CUSTOM_MSGS_PACKAGE_NAME>*') | Copy-Item -Destination <AWSIM_DIR_PATH>\Assets\Ros2ForUnity\Plugins\Windows\x86_64
    +
  • +
+
+

Example

+
Get-ChildItem C:\ros2-for-unity\install\asset\Ros2ForUnity\Plugins\* -Include @('custom_msgs*') | Copy-Item -Destination C:\unity\AWSIM\Assets\Ros2ForUnity\Plugins
+Get-ChildItem C:\ros2-for-unity\install\asset\Ros2ForUnity\Plugins\Windows\x86_64\* -Include @('custom_msgs*') | Copy-Item -Destination C:\unity\AWSIM\Assets\Ros2ForUnity\Plugins\Windows\x86_64
+
+
+
+
+
+

5. Test

+

Make sure that the package files custom_msgs have been properly copied to the AWSIM/Assets/Ros2ForUnity. +Then try to create a message object as described in this section and check in the console of Unity Editor if it compiles without errors.

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/ROS2/ROS2ForUnity/clock_publisher.png b/Components/ROS2/ROS2ForUnity/clock_publisher.png new file mode 100644 index 0000000000..c38bc204f2 Binary files /dev/null and b/Components/ROS2/ROS2ForUnity/clock_publisher.png differ diff --git a/Components/ROS2/ROS2ForUnity/index.html b/Components/ROS2/ROS2ForUnity/index.html new file mode 100644 index 0000000000..1433ec737e --- /dev/null +++ b/Components/ROS2/ROS2ForUnity/index.html @@ -0,0 +1,3142 @@ + + + + + + + + + + + + + + + + + + + + + + + ROS2 For Unity - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

ROS2 For Unity

+

Ros2ForUnity (R2FU) module is a communication solution that effectively connects Unity and the ROS2 ecosystem, maintaining a strong integration. +Unlike other solutions, it doesn't rely on bridging communication but rather utilizes the ROS2 middleware stack (specifically the rcl layer and below), enabling the inclusion of ROS2 nodes within Unity simulations.

+

R2FU is used in AWSIM for many reasons. +First of all, because it offers high-performance integration between Unity and ROS2, with improved throughput and lower latencies compared to bridging solutions. +It provides real ROS2 functionality for simulation entities in Unity, supports standard and custom messages, and includes convenient abstractions and tools, all wrapped as a Unity asset. +For a detailed description, please see README.

+

Prerequisites

+

This asset can be prepared in two flavours:

+
    +
  • standalone mode - where no ROS2 installation is required on target machine, e.g., your Unity simulation server. +All required dependencies are installed and can be used e.g. as a complete set of Unity plugins.
  • +
  • overlay mode - where the ROS2 installation is required on target machine. +Only asset libraries and generated messages are installed therefore ROS2 instance must be sourced.
  • +
+

By default, asset R2FU in AWSIM is prepared in standalone mode.

+
+

Warning

+

To avoid internal conflicts between the standalone libraries, and sourced ones, ROS2 instance shouldn't be sourced before running AWSIM or the Unity Editor.

+
+
+

Can't see topics

+

There are no errors but I can't see topics published by R2FU

+
    +
  • Make sure your DDS (Localhost settings) config is correct.
  • +
  • Sometimes ROS2 daemon brakes up when changing network interfaces or ROS2 version.
  • +
+
+

Try to stop it forcefully (pkill -9 ros2_daemon) and restart (ros2 daemon start).

+

Concept

+

Describing the concept of using R2FU in AWSIM, we distinguish:

+
    +
  • ROS2Node - it is the equivalent of a node in ROS2, it has its own name, it can have any number of subscribers, publishers, service servers and service clients. +In the current AWSIM implementation, there is only one main node.
  • +
  • ROS2Clock - it is responsible for generating the simulation time using the selected source.
  • +
  • SimulatorROS2Node - it is a class that is directly responsible for AWSIM<->ROS2 communication, and contains one instance each of ROS2Node and ROS2Clock, so it creates the main AWSIM node in ROS2 and simulates the time from the selected source (currently UnityTimeSource is used). +It is initialized at the moment of running the scene in Unity - thanks to the RuntimeInitializeOnLoadMethod mark.
  • +
  • Publisher - it is the equivalent of the publisher in ROS2, it uses a single topic on which it can publish a selected type of message, and it has a selected QoS profile. +Each publisher in AWSIM is created in ROS2Node object of class SimulatorROS2Node.
  • +
  • Subscriber - it is the equivalent of the subscriber in ROS2, it uses a single topic from which it subscribes to the selected type of message, and it has a selected QoS profile. +Each subscriber in AWSIM is created in ROS2Node object of class SimulatorROS2Node.
  • +
+ + + +

The SimulatorROS2Node implementation, thanks to the use of R2FU, allows you to add communication via ROS2 to any Unity component. +For example, we can receive control commands from any other ROS2 node and publish the current state of Ego, such as its position in the environment.

+
+

Simulation time

+

If you want to use system time (ROS2 time) instead of Unity time, use ROS2TimeSource instead of UnityTimeSource in the SimulatorROS2Node class.

+
+

Package structure

+

Ros2ForUnity asset contains:

+
    +
  • Plugins - dynamically loaded libraries for Windows and Linux (*.dll and *.so files). +In addition to the necessary libraries, here are the libraries created as a result of generation the types of ROS2 messages that are used in communication.
  • +
  • Scripts - scripts for using R2FU in Unity - details below.
  • +
  • Extension Scripts - scripts for using R2FU in AWSIM, provide abstractions of a single main Node and simplify the interface - details below. +These scripts are not in the library itself, but directly in the directory Assets/AWSIM/Scripts/ROS/**.
  • +
+

Scripts

+
    +
  • ROS2UnityCore - the principal class for handling ROS2 nodes and executables. +Spins and executes actions (e.g. clock, sensor publish triggers) in a dedicated thread.
  • +
  • ROS2UnityComponent - ROS2UnityCore adapted to work as a Unity component.
  • +
  • ROS2Node - a class representing a ROS2 node, it should be constructed through ROS2UnityComponent class, which also handles spinning.
  • +
  • ROS2ForUnity - an internal class responsible for handling checking, proper initialization and shutdown of ROS2 communication,
  • +
  • ROS2ListenerExample - an example class provided for testing of basic ROS2->Unity communication.
  • +
  • ROS2TalkerExample - an example class provided for testing of basic Unity->ROS2 communication.
  • +
  • ROS2PerformanceTest - an example class provided for performance testing of ROS2<->Unity communication.
  • +
  • Sensor - an abstract base class for ROS2-enabled sensor.
  • +
  • Transformations - a set of transformation functions between coordinate systems of Unity and ROS2.
  • +
  • PostInstall - an internal class responsible for installing R2FU metadata files.
  • +
  • Time scripts - a set of classes that provide the ability to use different time sources:
      +
    • ROS2Clock - ROS2 clock class that for interfacing between a time source (Unity or ROS2 system time) and ROS2 messages.
    • +
    • ROS2TimeSource - acquires ROS2 time (system time by default).
    • +
    • UnityTimeSource - acquires Unity time.
    • +
    • DotnetTimeSource - acquires Unity DateTime based clock that has resolution increased using Stopwatch.
    • +
    • ITimeSource - interface for general time extraction from any source.
    • +
    • TimeUtils - utils for time conversion.
    • +
    +
  • +
+

Extension Scripts

+

Additionally, in order to adapt AWSIM to the use of R2FU, the following scripts are used:

+
    +
  • SimulatorROS2Node - it is a class that is directly responsible for AWSIM<->ROS2 communication.
  • +
  • +

    ClockPublisher - allows the publication of the simulation time from the clock running in the SimulatorROS2Node. +It must be added as a component to the scene in order to publish the current time when the scene is run.

    +

    clock_publisher

    +
  • +
  • +

    QoSSettings - it is the equivalent of ROS2 QoS, which allows to specify the QoS for subscribers and publishers in AWSIM. +It uses the QualityOfServiceProfile implementation from the Ros2cs library.

    +
  • +
  • ROS2Utility - it is a class with utils that allow, for example, to convert positions in the ROS2 coordinate system to the AWSIM coordinate system.
  • +
  • DiagnosticsManager - prints diagnostics for desired elements described in *.yaml config file.
  • +
+

Default message types

+

The basic ROS2 msgs types that are supported in AWSIM by default include:

+ +

In order for the message package to be used in Unity, its *.dll and *.so libraries must be generated using R2FU.

+
+

Custom message

+

If you want to generate a custom message to allow it to be used in AWSIM please read this tutorial.

+
+

Use of generated messages in Unity

+

Each message type is composed of other types - which can also be a complex type. +All of them are based on built-in C# types. +The most common built-in types in messages are bool, int, double and string. +These types have their communication equivalents using ROS2.

+

A good example of a complex type that is added to other complex types in order to specify a reference - in the form of a timestamp and a frame - is std_msgs/Header. +This message has the following form:

+
builtin_interfaces/msg/Time stamp
+string frame_id
+
+
+

ROS2 directive

+

In order to work with ROS2 in Unity, remember to add the directive using ROS2; at the top of the file to import types from this namespace.

+
+

Create an object

+

The simplest way to create an object of Header type is:

+
var header = new std_msgs.msg.Header()
+{
+    Frame_id = "map"
+}
+
+

It is not required to define the value of each field. +As you can see, it creates an object, filling only frame_id field - and left the field of complex builtin_interfaces/msg/Time type initialized by default. +Time is an important element of any message, how to fill it is written here.

+

Accessing and filling in message fields

+

As you might have noticed in the previous example, a ROS2 message in Unity is just a structure containing the same fields - keep the same names and types. +Access to its fields for reading and filling is the same as for any C# structure.

+
var header2 = new std_msgs.msg.Header();
+header2.Frame_id = "map";
+header2.Stamp.sec = "1234567";
+Debug.Log($"StampSec: {header2.Stamp.sec} and Frame: {header2.Frame_id}");
+
+
+

Field names

+

There is one always-present difference in field names. +The first letter of each message field in Unity is always uppercase - even if the base ROS2 message from which it is generated is lowercase.

+
+

Filling a time

+

In order to complete the time field of the Header message, we recommend the following methods in AWSIM:

+
    +
  1. +

    When the message has no Header but only the Time type:

    +
    var header2 = new std_msgs.msg.Header();
    +header2.Stamp = SimulatorROS2Node.GetCurrentRosTime();
    +
    +
  2. +
  3. +

    When the message has a Header - like for example autoware_auto_vehicle_msgs/VelocityReport:

    +
    velocityReportMsg = new autoware_auto_vehicle_msgs.msg.VelocityReport()
    +{
    +    Header = new std_msgs.msg.Header()
    +    {
    +        Frame_id = "map",
    +    }
    +};
    +var velocityReportMsgHeader = velocityReportMsg as MessageWithHeader;
    +SimulatorROS2Node.UpdateROSTimestamp(ref velocityReportMsgHeader);
    +
    +
  4. +
+

These methods allow to fill the Time field in the message object with the simulation time - from ROS2Clock

+

Create a message with array

+

Some message types contain an array of some type. +An example of such a message is nav_msgs/Path, which has a PoseStamped array. +In order to fill such an array, you must first create a List<T>, fill it and then convert it to a raw array.

+
var posesList = new List<geometry_msgs.msg.PoseStamped>();
+for(int i=0; i<=5;++i)
+{
+    var poseStampedMsg = new geometry_msgs.msg.PoseStamped();
+    poseStampedMsg.Pose.Position.X = i;
+    poseStampedMsg.Pose.Position.Y = 5-i;
+    var poseStampedMsgHeader = poseStampedMsg as MessageWithHeader;
+    SimulatorROS2Node.UpdateROSTimestamp(ref poseStampedMsgHeader);
+    posesList.Add(poseStampedMsg);
+}
+var pathMsg = new nav_msgs.msg.Path(){Poses=posesList.ToArray()};
+var pathMsgHeader = pathMsg as MessageWithHeader;
+SimulatorROS2Node.UpdateROSTimestamp(ref pathMsgHeader);
+// pathMsg is ready
+
+

Publish on the topic

+

In order to publish messages, a publisher object must be created. +The static method CreatePublisher of the SimulatorROS2Node makes it easy. +You must specify the type of message, the topic on which it will be published and the QoS profile.
+Below is an example of autoware_auto_vehicle_msgs.msg.VelocityReport type message publication with a frequency of 30Hz on /vehicle/status/velocity_status topic, the QoS profile is (Reliability=Reliable, Durability=Volatile, History=Keep last, Depth=1):

+
using UnityEngine;
+using ROS2;
+
+namespace AWSIM
+{
+    public class VehicleReportRos2Publisher : MonoBehaviour
+    {
+        float timer = 0;
+        int publishHz = 30;
+        QoSSettings qosSettings = new QoSSettings()
+        {
+            ReliabilityPolicy = ReliabilityPolicy.QOS_POLICY_RELIABILITY_RELIABLE,
+            DurabilityPolicy = DurabilityPolicy.QOS_POLICY_DURABILITY_VOLATILE,
+            HistoryPolicy = HistoryPolicy.QOS_POLICY_HISTORY_KEEP_LAST,
+            Depth = 1,
+        };
+        string velocityReportTopic = "/vehicle/status/velocity_status";
+        autoware_auto_vehicle_msgs.msg.VelocityReport velocityReportMsg;
+        IPublisher<autoware_auto_vehicle_msgs.msg.VelocityReport> velocityReportPublisher;
+
+        void Start()
+        {
+            // Create a message object and fill in the constant fields
+            velocityReportMsg = new autoware_auto_vehicle_msgs.msg.VelocityReport()
+            {
+                Header = new std_msgs.msg.Header()
+                {
+                    Frame_id = "map",
+                }
+            };
+
+            // Create publisher with specific topic and QoS profile
+            velocityReportPublisher = SimulatorROS2Node.CreatePublisher<autoware_auto_vehicle_msgs.msg.VelocityReport>(velocityReportTopic, qosSettings.GetQoSProfile());
+        }
+
+         bool NeedToPublish()
+        {
+            timer += Time.deltaTime;
+            var interval = 1.0f / publishHz;
+            interval -= 0.00001f;
+            if (timer < interval)
+                return false;
+            timer = 0;
+            return true;
+        }
+
+        void FixedUpdate()
+        {
+            // Provide publications with a given frequency
+            if (NeedToPublish())
+            {
+                // Fill in non-constant fields
+                velocityReportMsg.Longitudinal_velocity = 1.00f;
+                velocityReportMsg.Lateral_velocity = 0.00f;
+                velocityReportMsg.Heading_rate = 0.00f;
+
+                // Update Stamp
+                var velocityReportMsgHeader = velocityReportMsg as MessageWithHeader;
+                SimulatorROS2Node.UpdateROSTimestamp(ref velocityReportMsgHeader);
+
+                // Publish
+                velocityReportPublisher.Publish(velocityReportMsg);
+            }
+        }
+    }
+}
+
+

Upper limit to publish rate

+

The above example demonstrates the implementation of the 'publish' method within the FixedUpdate Unity event method. However, this approach has certain limitations. The maximum output frequency is directly tied to the current value of Fixed TimeStep specified in the Project Settings. Considering that the AWSIM is targeting a frame rate of 60 frames per second (FPS), the current Fixed TimeStep is set to 1/60s. And this impose 60Hz as a limitation on the publish rate for any sensor, which is implemented within FixedUpdate method. In case a higher output frequency be necessary, an alternative implementation must be considered or adjustments made to the Fixed TimeStep setting in the Editor->Project Settings->Time.

+

The table provided below presents a list of sensors along with examples of topics that are constrained by the Fixed TimeStep limitation.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ObjectTopic
GNSS Sensor/sensing/gnss/pose
IMU Sensor/sensing/imu/tamagawa/imu_raw
Traffic Camera/sensing/camera/traffic_light/image_raw
Pose Sensor/awsim/ground_truth/vehicle/pose
OdometrySensor/awsim/ground_truth/localization/kinematic_state
LIDAR/sensing/lidar/top/pointcloud_raw
Vehicle Status/vehicle/status/velocity_status
+

If the sensor or any other publishing object within AWSIM does not have any direct correlation with physics (i.e., does not require synchronization with physics), it can be implemented without using the FixedUpdate method. Consequently, this allows the bypass of upper limits imposed by the Fixed TimeStep.

+

The table presented below shows a list of objects that are not constrained by the Fixed TimeStep limitation.

+ + + + + + + + + + + + + +
ObjectTopic
Clock/clock
+

Subscribe to the topic

+

In order to subscribe messages, a subscriber object must be created. +The static method CreateSubscription of the SimulatorROS2Node makes it easy. +You must specify the type of message, the topic from which it will be subscribed and the QoS profile. +In addition, the callback must be defined, which will be called when the message is received - in particular, it can be defined as a lambda expression.
+Below is an example of std_msgs.msg.Bool type message subscription on /vehicle/is_vehicle_stopped topic, the QoS profile is “system default”: +

using UnityEngine;
+using ROS2;
+
+namespace AWSIM
+{
+    public class VehicleStoppedSubscriber : MonoBehaviour
+    {
+        QoSSettings qosSettings = new QoSSettings();
+        string isVehicleStoppedTopic = "/vehicle/is_vehicle_stopped";
+        bool isVehicleStopped = false;
+        ISubscription<std_msgs.msg.Bool> isVehicleStoppedSubscriber;
+
+        void Start()
+        {
+            isVehicleStoppedSubscriber = SimulatorROS2Node.CreateSubscription<std_msgs.msg.Bool>(isVehicleStoppedTopic, VehicleStoppedCallback, qosSettings.GetQoSProfile());
+        }
+
+        void VehicleStoppedCallback(std_msgs.msg.Bool msg)
+        {
+            isVehicleStopped = msg.Data;
+        }
+
+        void OnDestroy()
+        {
+            SimulatorROS2Node.RemoveSubscription<std_msgs.msg.Bool>(isVehicleStoppedSubscriber);
+        }
+    }
+}
+

+ + + + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/ROS2/ROS2TopicList/index.html b/Components/ROS2/ROS2TopicList/index.html new file mode 100644 index 0000000000..9301068785 --- /dev/null +++ b/Components/ROS2/ROS2TopicList/index.html @@ -0,0 +1,2755 @@ + + + + + + + + + + + + + + + + + + + + + + + ROS2 topic list - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

ROS2 topic list

+

The following is a summary of the ROS2 topics that the AWSIM node subscribes to and publishes on.

+
+

Ros2ForUnity

+

AWSIM works with ROS2 thanks to the use of Ros2ForUnity - read the details here.
+If you want to generate a custom message to allow it to be used in AWSIM please read this tutorial.

+
+

List of subscribers

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryTopicMessage typeframe_idHzQoS

Control

Ackermann Control/control/command/control_cmdautoware_auto_control_msgs/AckermannControlCommand-60Reliable,
TransientLocal,
KeepLast/1
Gear/control/command/gear_cmdautoware_auto_vehicle_msgs/GearCommand-10Reliable,
TransientLocal,
KeepLast/1
Turn Indicators/control/command/turn_indicators_cmdautoware_auto_vehicle_msgs/TurnIndicatorsCommand-10Reliable,
TransientLocal,
KeepLast/1
Hazard Lights/control/command/hazard_lights_cmdautoware_auto_vehicle_msgs/HazardLightsCommand-10Reliable,
TransientLocal,
KeepLast/1
Emergency/control/command/emergency_cmdtier4_vehicle_msgs/msg/VehicleEmergencyStamped-60Reliable,
TransientLocal,
KeepLast/1

Control mode

Engage/vehicle/engageautoware_auto_vehicle_msgs/Engage--Reliable,
TransientLocal,
KeepLast/1
+

List of publishers

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryTopicMessage typeframe_idHzQoS

Clock

Clock/clockrosgraph_msgs/Clock-100Best effort,
Volatile,
Keep last/1

Sensors

Camera/sensing/camera/traffic_light/camera_infosensor_msgs/CameraInfotraffic_light_left_camera/camera_link10Best effort,
Volatile,
Keep last/1
Camera/sensing/camera/traffic_light/image_rawsensor_msgs/Imagetraffic_light_left_camera/camera_link10Best effort,
Volatile,
Keep last/1
GNSS/sensing/gnss/posegeometry_msgs/Posegnss_link1Reliable,
Volatile,
Keep last/1
GNSS/sensing/gnss/pose_with_covariancegeometry_msgs/PoseWithCovarianceStampedgnss_link1Reliable,
Volatile,
Keep last/1
IMU/sensing/imu/tamagawa/imu_rawsensor_msgs/Imutamagawa/imu_link30Reliable,
Volatile,
Keep last/1000
Top LiDAR/sensing/lidar/top/pointcloud_rawsensor_msgs/PointCloud2sensor_kit_base_link10Best effort,
Volatile,
Keep last/5
Top LiDAR/sensing/lidar/top/pointcloud_raw_exsensor_msgs/PointCloud2sensor_kit_base_link10Best effort,
Volatile,
Keep last/5

Vehicle Status

Velocity/vehicle/status/velocity_statusautoware_auto_vehicle_msgs/VelocityReportbase_line30Reliable,
Volatile,
Keep last/1
Steering/vehicle/status/steering_statusautoware_auto_vehicle_msgs/SteeringReport-30Reliable,
Volatile,
Keep last/1
Control Mode/vehicle/status/control_modeautoware_auto_vehicle_msgs/ControlModeReport-30Reliable,
Volatile,
Keep last/1
Gear/vehicle/status/gear_statusautoware_auto_vehicle_msgs/GearReport-30Reliable,
Volatile,
Keep last/1
Turn Indicators/vehicle/status/turn_indicators_statusautoware_auto_vehicle_msgs/TurnIndicatorsReport-30Reliable,
Volatile,
Keep last/1
Hazard Lights/vehicle/status/hazard_lights_statusautoware_auto_vehicle_msgs/HazardLightsReport-30Reliable,
Volatile,
Keep last/1

Ground Truth

Pose/awsim/ground_truth/vehicle/posegeometry_msgs/PoseStampedbase_link100Reliable,
Volatile,
Keep last/1
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/clock_publisher_disable.png b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/clock_publisher_disable.png new file mode 100644 index 0000000000..4dc3d29c60 Binary files /dev/null and b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/clock_publisher_disable.png differ diff --git a/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/entities.png b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/entities.png new file mode 100644 index 0000000000..f0f68137ad Binary files /dev/null and b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/entities.png differ diff --git a/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/follow_camera.png b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/follow_camera.png new file mode 100644 index 0000000000..5015c5a427 Binary files /dev/null and b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/follow_camera.png differ diff --git a/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/index.html b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/index.html new file mode 100644 index 0000000000..017b4fe775 --- /dev/null +++ b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/index.html @@ -0,0 +1,2809 @@ + + + + + + + + + + + + + + + + + + + + + + + Preparing the connection between AWSIM and scenario_simulator_v2 - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Preparing the connection between AWSIM and scenario_simulator_v2

+

This tutorial describes: +- how to modify scenario to work with AWSIM +- how to prepare the AWSIM scene to work with scenario_simulator_v2

+

Scenario preparation to work with AWSIM

+

To prepare the scenario to work with AWSIM add model3d field to entity specification

+

It is utilized as an asset key to identify the proper prefab.

+

model_3d_added.png

+

Match the parameters of the configured vehicle to match the entities parameters in AWSIM as close as it is required. Especially the bounding box is crucial to validate the collisions correctly.

+

Default AWSIM asset catalog

+

AWSIM currently supports the following asset key values.

+

The list can be extended if required. Appropriate values should be added to asst key list in the ScenarioSimulatorConnector component and the vehicle parameters in scenario simulator should match them.

+

Ego Vehicle Entity (with sensor)

+ + + + + + + + + + + + + + + + + + + + + + + +
model3dboundingbox size (m)wheel base(m)front tread(m)rear tread(m)tier diameter(m)max steer(deg)
lexus_rx450hwidth : 1.920
height : 1.700
length : 4.890
2.1051.6401.6300.76635
+

NPC Vehicle Entity

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
model3dboundingbox size (m)wheel base(m)front tread(m)rear tread(m)tier diameter(m)max steer(deg)
taxiwidth : 1.695
height : 1.515
length : 4.590
2.6801.4601.4000.63535
truck_2twidth : 1.695
height : 1.960
length : 4.685
2.4901.3951.2400.67340
hatchbackwidth : 1.695
height 1.515
length : 3.940
2.5501.4801.4750.60035
vanwidth : 1.880
height : 2.285
length : 4.695
2.5701.6551.6500.60035
small_carwidth : 1.475
height 1.800
length : 3.395
2.5201.3051.3050.55735
+

NPC Pedestrian Entity

+ + + + + + + + + + + + + +
model3dboundingbox size (m)
humanwidth : 0.400
height : 1.800
length : 0.300
+

Misc Object Entity

+ + + + + + + + + + + + + +
model3dboundingbox size (m)
sign_boardwidth : 0.31
height : 0.58
length : 0.21
+

Scenarios limitations

+

Vast majority of features supported by scenario_simulator_v2 are supported with AWSIM as well. Currently supported features are described in the scenario_simulator_v2's documentation.

+

Features which are not supported when connected with AWSIM are listed below.

+
    +
  1. Controller properties used by attach_*_sensor
      +
    • pointcloudPublishingDelay
    • +
    • isClairvoyant
    • +
    • detectedObjectPublishingDelay
    • +
    • detectedObjectPositionStandardDeviation
    • +
    • detectedObjectMissingProbability
    • +
    • randomSeed
    • +
    +
  2. +
+

If those features are curcial for the scenario's execution, the scenario might not work properly.

+

AWSIM scene preparation to work with scenario_simulator_v2

+
    +
  1. Disable random traffic and any pre-spawned NPCs
  2. +
  3. Disable V2I traffic lights publishing
  4. +
  5. Remove EgoVehicle object in the scene
  6. +
  7. Remove TimeScaleSettingsUI, VehicleSettingsUI and TrafficSettingsUI from Canvas -> RightScrollView -> Viewport -> Content
  8. +
+

removed_objects.png

+
    +
  1. Disable the Clock Publisher script component in the ClockPublisher object
  2. +
+

clock_publisher_disable.png

+
    +
  1. Add ScenarioSimulatorConnector prefab to the scene - located in Assets/ScenarioSimulatorConnector
  2. +
+

scene_tree.png

+
    +
  1. Configure Ego Follow Camera field in ScenarioSimulatorConnector - most likely Main Camera object from the scene
  2. +
+

follow_camera.png

+
    +
  1. Configure Vehicle Information UI field in ScenarioSimulatorConnector - most likely VehicleInformationUI object from the scene
  2. +
+

vehicle_information_ui.png

+
    +
  1. If necessary update the asset_id to prefab mapping - key in the map can be used in the scenario
  2. +
+

entities.png

+
    +
  1. Configure Type in the TimeSourceSelector component to SS2
  2. +
+

time_selector_ss2.png

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/model_3d_added.png b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/model_3d_added.png new file mode 100644 index 0000000000..77597c145a Binary files /dev/null and b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/model_3d_added.png differ diff --git a/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/removed_objects.png b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/removed_objects.png new file mode 100644 index 0000000000..0a9ac275dd Binary files /dev/null and b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/removed_objects.png differ diff --git a/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/scene_tree.png b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/scene_tree.png new file mode 100644 index 0000000000..62ca50aae8 Binary files /dev/null and b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/scene_tree.png differ diff --git a/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/scene_tree_time_selector.png b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/scene_tree_time_selector.png new file mode 100644 index 0000000000..4d7fe0e9fe Binary files /dev/null and b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/scene_tree_time_selector.png differ diff --git a/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/time_selector_ss2.png b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/time_selector_ss2.png new file mode 100644 index 0000000000..91f0066978 Binary files /dev/null and b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/time_selector_ss2.png differ diff --git a/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/vehicle_information_ui.png b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/vehicle_information_ui.png new file mode 100644 index 0000000000..bc245a1dff Binary files /dev/null and b/Components/ScenarioSimulation/PreparingTheConnectionBetweenAWSIMAndScenarioSimulator/vehicle_information_ui.png differ diff --git a/Components/ScenarioSimulation/SetupUnityProjectForScenarioSimulation/index.html b/Components/ScenarioSimulation/SetupUnityProjectForScenarioSimulation/index.html new file mode 100644 index 0000000000..8eb1ce110f --- /dev/null +++ b/Components/ScenarioSimulation/SetupUnityProjectForScenarioSimulation/index.html @@ -0,0 +1,2614 @@ + + + + + + + + + + + + + + + + + + + + + + + Setup Unity project for scenario simulation - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Running AWSIM from Unity Editor with scenario_simulator_v2

+

Below you can find instructions on how to setup the scenario execution using scenario_simulator_v2 with AWSIM run from Unity Editor as a simulator +The instruction assumes using the Ubuntu OS.

+

Prerequisites

+
    +
  1. +

    Build Autoware by following "Build Autoware with scenario_simulator_v2" section from the scenario simulator and AWSIM quick start guide

    +
  2. +
  3. +

    Follow Setup Unity Project tutorial

    +
  4. +
+

Running the demo

+
    +
  1. Open AutowareSimulationScenarioSimulator.unity scene placed under Assets/AWSIM/Scenes/Main directory
  2. +
  3. Run the simulation by clicking Play button placed at the top section of Editor.
  4. +
  5. Launch scenario_test_runner. +
    source install/setup.bash
    +ros2 launch scenario_test_runner scenario_test_runner.launch.py                        \
    +architecture_type:=awf/universe  record:=false                                         \
    +scenario:='$(find-pkg-share scenario_test_runner)/scenario/sample_awsim.yaml'          \
    +sensor_model:=awsim_sensor_kit  vehicle_model:=sample_vehicle                          \
    +launch_simple_sensor_simulator:=false autoware_launch_file:="e2e_simulator.launch.xml" \
    +initialize_duration:=260 port:=8080
    +
  6. +
+

ss2_awsim.png

+

Other sample scenarios

+

Conventional traffic lights demo

+

This scenario controls traffic signals in the scene based on OpenSCENARIO. It can be used to verify whether traffic light recognition pipeline works well in Autoware.

+
ros2 launch scenario_test_runner scenario_test_runner.launch.py                                           \
+architecture_type:=awf/universe  record:=false                                                            \
+scenario:='$(find-pkg-share scenario_test_runner)/scenario/sample_awsim_conventional_traffic_lights.yaml' \
+sensor_model:=awsim_sensor_kit  vehicle_model:=sample_vehicle                                             \
+launch_simple_sensor_simulator:=false autoware_launch_file:="e2e_simulator.launch.xml"                    \
+initialize_duration:=260 port:=8080
+
+

V2I traffic lights demo

+

This scenario publishes V2I traffic signals information based on OpenSCENARIO. It can be used to verify Autoware responds to V2I traffic lights information correctly.

+
ros2 launch scenario_test_runner scenario_test_runner.launch.py                                  \
+architecture_type:=awf/universe  record:=false                                                   \
+scenario:='$(find-pkg-share scenario_test_runner)/scenario/sample_awsim_v2i_traffic_lights.yaml' \
+sensor_model:=awsim_sensor_kit  vehicle_model:=sample_vehicle                                    \
+launch_simple_sensor_simulator:=false autoware_launch_file:="e2e_simulator.launch.xml"           \
+initialize_duration:=260 port:=8080
+
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/ScenarioSimulation/SetupUnityProjectForScenarioSimulation/ss2_awsim.png b/Components/ScenarioSimulation/SetupUnityProjectForScenarioSimulation/ss2_awsim.png new file mode 100644 index 0000000000..165adc96f1 Binary files /dev/null and b/Components/ScenarioSimulation/SetupUnityProjectForScenarioSimulation/ss2_awsim.png differ diff --git a/Components/Sensors/CameraSensor/InspectorSetup.png b/Components/Sensors/CameraSensor/InspectorSetup.png new file mode 100644 index 0000000000..6d8a1ae5f2 Binary files /dev/null and b/Components/Sensors/CameraSensor/InspectorSetup.png differ diff --git a/Components/Sensors/CameraSensor/SceneObjectHierarchy.png b/Components/Sensors/CameraSensor/SceneObjectHierarchy.png new file mode 100644 index 0000000000..24b2451a82 Binary files /dev/null and b/Components/Sensors/CameraSensor/SceneObjectHierarchy.png differ diff --git a/Components/Sensors/CameraSensor/components.png b/Components/Sensors/CameraSensor/components.png new file mode 100644 index 0000000000..68360d27a7 Binary files /dev/null and b/Components/Sensors/CameraSensor/components.png differ diff --git a/Components/Sensors/CameraSensor/compute.png b/Components/Sensors/CameraSensor/compute.png new file mode 100644 index 0000000000..e35a1164f7 Binary files /dev/null and b/Components/Sensors/CameraSensor/compute.png differ diff --git a/Components/Sensors/CameraSensor/gui.png b/Components/Sensors/CameraSensor/gui.png new file mode 100644 index 0000000000..c1154bf722 Binary files /dev/null and b/Components/Sensors/CameraSensor/gui.png differ diff --git a/Components/Sensors/CameraSensor/index.html b/Components/Sensors/CameraSensor/index.html new file mode 100644 index 0000000000..61ffea1b6c --- /dev/null +++ b/Components/Sensors/CameraSensor/index.html @@ -0,0 +1,2904 @@ + + + + + + + + + + + + + + + + + + + + + + + Camera Sensor - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

CameraSensor

+

Introduction

+

CameraSensor is a component that simulates an RGB camera. +Autonomous vehicles can be equipped with many cameras used for various purposes. +In the current version of AWSIM, the camera is used primarily to provide the image to the traffic light recognition module in Autoware.

+

Prefab

+

Prefab can be found under the following path:

+
Assets/AWSIM/Prefabs/Sensors/CameraSensor.prefab
+
+ +

The mentioned single CameraSensor has its own frame traffic_light_left_camera/camera_link in which its data is published. +The sensor prefab is added to this frame. +The traffic_light_left_camera/camera_link link is added to the base_link object located in the URDF.

+

link

+

A detailed description of the URDF structure and sensors added to prefab Lexus RX450h 2015 is available in this section.

+

CameraSensorHolder (script)

+

InspectorSetup

+

CameraSensorHolder (script) allows the sequential rendering of multiple camera sensors. +To utilize it, each CameraSensor object should be attached as a child object of the CameraSensorHolder. +SceneObjectHierarchy

+

Elements configurable from the editor level

+
    +
  • Camere Sensors - a collection of camera sensors used for rendering
  • +
  • Publish Hz - the frequency at which camera rendering, image processing and callbacks are executed
  • +
  • Render In Queue - camera sensors rendering sequence type: in queue (one after another) or all at the same frame
  • +
+

CameraSensor Components

+

components

+

For the CameraSensor to work properly, the GameObject to which the scripts are added must also have:

+ +
+

TrafficLights recognition

+

In case of problems with the recognition of traffic lights in Autoware, it may help to increase the image resolution and focal length of the camera in AWSIM.

+
+
+

Camera settings

+

If you would like to adjust the image captured by the camera, we encourage you to read this manual.

+
+

The CameraSensor functionality is split into two scripts:

+
    +
  • Camera Sensor (script) - acquires the image from the Unity camera, transforms it and saves to the BGR8 format, this format along with the camera parameters is its script output - script also calls the callback for it.
  • +
  • Camera Ros2 Publisher (script) - provides the ability to publish CameraSensor output as Image and CameraInfo messages type published on a specific ROS2 topics.
  • +
+

Scripts can be found under the following path:

+
Assets/AWSIM/Scripts/Sensors/CameraSensor/*
+
+

In the same location there are also *.compute files containing used ComputeShaders.

+

CameraSensor (script)

+

script

+

Camera Sensor (script) is a core camera sensor component. +It is responsible for applying OpenCV distortion and encoding to BGR8 format. +The distortion model is assumed to be Plumb Bob. +The script renders the image from the camera to Texture2D and transforms it using the distortion parameters. +This image is displayed in the GUI and further processed to obtain the list of bytes in BGR8 format on the script output.

+

The script uses two ComputeShaders, they are located in the same location as the scripts:

+
    +
  • CameraDistortion - to correct the image using the camera distortion parameters,
  • +
  • +

    RosImageShader - to encode two pixels color (bgr8 - 3 bytes) into one (uint32 - 4 bytes) in order to produce ROS Image BGR8 buffer.

    +

    compute

    +
  • +
+ + + + + + + + + + + + + + + +
APItypefeature
DoRendervoidRenders the Unity camera, applies OpenCV distortion to rendered image and update output data.
+

Elements configurable from the editor level

+
    +
  • Output Hz - frequency of output calculation and callback (default: 10Hz)
  • +
  • Image On GUI:
      +
    • Show - if camera image should be show on GUI (default: true)
    • +
    • Scale - scale of reducing the image from the camera, 1 - will give an image of real size, 2 - twice smaller, etc. (default: 4)
    • +
    • X Axis - position of the upper left corner of the displayed image in the X axis, 0is the left edge (default: 0)
    • +
    • Y Axis - position of the upper left corner of the displayed image in the Y axis, 0 is the upper edge (default: 0)
    • +
    +
  • +
  • Camera parameters
      +
    • Width - image width (default: 1920)
    • +
    • Height - image height (default: 1080)
    • +
    • K1, K2, P1, P2, K3 - camera distortion coefficients for Plum Bob model
      (default: 0, 0, 0, 0, 0)
    • +
    +
  • +
  • Camera Object - reference to the basic Camera component (default: None)
  • +
  • Distortion Shader - reference to ComputeShader asset about Distortion Shader functionality (default: None)
  • +
  • Ros Image Shader - reference to ComputeShader asset about Ros Image Shader functionality +(default: None)
  • +
+

Output Data

+

The sensor computation output format is presented below:

+ + + + + + + + + + + + + + + + + + + + +
CategoryTypeDescription
ImageDataBufferbyte[ ]Buffer with image data.
CameraParametersCameraParametersSet of the camera parameters.
+

CameraRos2Publisher (script)

+

script_ros2

+

Converts the data output from CameraSensor to ROS2 Image +and CameraInfo type messages and publishes them. +The conversion and publication is performed using the Publish(CameraSensor.OutputData outputData) method, +which is the callback triggered by Camera Sensor (script) for the current output.

+

Due to the fact that the entire image is always published, the ROI field of the message is always filled with zeros. +The script also ensures that binning is assumed to be zero and the rectification matrix is the identity matrix.

+
+

Warning

+

The script uses the camera parameters set in the CameraSensor script - remember to configure them depending on the camera you are using.

+
+

Elements configurable from the editor level

+
    +
  • Image Topic - the ROS2 topic on which the Image message is published
    (default: "/sensing/camera/traffic_light/image_raw")
  • +
  • Camera Info Topic - the ROS2 topic on which the CameraInfo message is published
    (default: "/sensing/camera/traffic_light/camera_info")
  • +
  • Frame id - frame in which data is published, used in Header
    (default: "traffic_light_left_camera/camera_link")
  • +
  • Qos Settings - Quality of service profile used in the publication
    (default: Best effort, Volatile, Keep last, 1)
  • +
+

Published Topics

+
    +
  • Frequency: 10Hz
  • +
  • QoS: Best effort, Volatile, Keep last/1
  • +
+ + + + + + + + + + + + + + + + + + + + + + + +
CategoryTopicMessage typeframe_id
Camera info/sensing/camera/traffic_light/camera_infosensor_msgs/CameraInfotraffic_light_left_camera/camera_link
Camera image/sensing/camera/traffic_light/image_rawsensor_msgs/Imagetraffic_light_left_camera/camera_link
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Sensors/CameraSensor/link.png b/Components/Sensors/CameraSensor/link.png new file mode 100644 index 0000000000..951c7796ec Binary files /dev/null and b/Components/Sensors/CameraSensor/link.png differ diff --git a/Components/Sensors/CameraSensor/main_component.png b/Components/Sensors/CameraSensor/main_component.png new file mode 100644 index 0000000000..bb36567b05 Binary files /dev/null and b/Components/Sensors/CameraSensor/main_component.png differ diff --git a/Components/Sensors/CameraSensor/script.png b/Components/Sensors/CameraSensor/script.png new file mode 100644 index 0000000000..8d20572d71 Binary files /dev/null and b/Components/Sensors/CameraSensor/script.png differ diff --git a/Components/Sensors/CameraSensor/script_ros2.png b/Components/Sensors/CameraSensor/script_ros2.png new file mode 100644 index 0000000000..483b2cc212 Binary files /dev/null and b/Components/Sensors/CameraSensor/script_ros2.png differ diff --git a/Components/Sensors/GNSSSensor/components.png b/Components/Sensors/GNSSSensor/components.png new file mode 100644 index 0000000000..632481e563 Binary files /dev/null and b/Components/Sensors/GNSSSensor/components.png differ diff --git a/Components/Sensors/GNSSSensor/index.html b/Components/Sensors/GNSSSensor/index.html new file mode 100644 index 0000000000..62d9192877 --- /dev/null +++ b/Components/Sensors/GNSSSensor/index.html @@ -0,0 +1,2781 @@ + + + + + + + + + + + + + + + + + + + + + + + GNSS Sensor - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

GnssSensor

+

Introduction

+

GnssSensor is a component which simulates the position of vehicle computed by the Global Navigation Satellite System based on the transformation of the GameObject to which this component is attached. +The GnssSensor outputs the position in the MGRS coordinate system.

+

Prefab

+

Prefab can be found under the following path:

+
Assets/AWSIM/Prefabs/Sensors/GnssSensor.prefab
+
+ +

GnssSensor has its own frame gnss_link in which its data is published. +The sensor prefab is added to this frame. +The gnss_link frame is added to the sensor_kit_base_link in the base_link object located in the URDF.

+

link

+

A detailed description of the URDF structure and sensors added to prefab Lexus RX450h 2015 is available in this section.

+

Components

+

components

+

The GnssSensor functionality is split into two components:

+
    +
  • Gnss Sensor (script) - it calculates the position as its output and calls the callback for it.
  • +
  • Gnss Ros2 Publisher (script) - provides the ability to publish GnssSensor output as PoseStamped and PoseWithCovarianceStamped published on a specific ROS2 topics.
  • +
+

Scripts can be found under the following path:

+
Assets/AWSIM/Prefabs/Sensors/Gnss/*
+
+

Gnss Sensor (script)

+

script

+

This is the main script in which all calculations are performed:

+
    +
  1. the position of the Object in Unity is read,
  2. +
  3. this position is transformed to the ROS2 coordinate system (MGRS offset is added here),
  4. +
  5. the result of the transformation is saved as the output of the component,
  6. +
  7. for the current output a callback is called (which can be assigned externally).
  8. +
+

Elements configurable from the editor level

+
    +
  • Output Hz - frequency of output calculation and callback (default: 100Hz)
  • +
+

Output Data

+ + + + + + + + + + + + + + + +
CategoryTypeDescription
PositionVector3Position in the MGRS coordinate system.
+

Gnss Ros2 Publisher (script)

+

script_ros2

+

Converts the data output from GnssSensor to ROS2 PoseStamped and PoseWithCovarianceStamped messages. +These messages are published on two separate topics for each type. +The conversion and publication is performed using the Publish(GnssSensor.OutputData outputData) method, which is the callback triggered by Gnss Sensor (script) for the current output update.

+
+

Covariance matrix

+

The row-major representation of the 6x6 covariance matrix is filled with 0 and does not change during the script run.

+
+

Elements configurable from the editor level

+
    +
  • Pose Topic - the ROS2 topic on which the message PoseStamped type is published
    (default: "/sensing/gnss/pose")
  • +
  • Pose With Covariance Stamped Topic - the ROS2 topic on which the message PoseWithCovarianceStamped type is published
    (default: "/sensing/gnss/pose_with_covariance")
  • +
  • Frame id - frame in which data are published, used in Header
    (default: "gnss_link")
  • +
  • Qos Settings - Quality of service profile used in the publication
    (default is assumed as "system_default": Reliable, Volatile, Keep last, 1)
  • +
+

Published Topics

+
    +
  • Frequency: 1Hz
  • +
  • QoS: Reliable, Volatile, Keep last/1
  • +
+ + + + + + + + + + + + + + + + + + + + + + + +
CategoryTopicMessage typeframe_id
Pose/sensing/gnss/posegeometry_msgs/Posegnss_link
Pose with Covariance/sensing/gnss/pose_with_covariancegeometry_msgs/PoseWithCovarianceStampedgnss_link
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Sensors/GNSSSensor/link.png b/Components/Sensors/GNSSSensor/link.png new file mode 100644 index 0000000000..464059e942 Binary files /dev/null and b/Components/Sensors/GNSSSensor/link.png differ diff --git a/Components/Sensors/GNSSSensor/script.png b/Components/Sensors/GNSSSensor/script.png new file mode 100644 index 0000000000..38432efb77 Binary files /dev/null and b/Components/Sensors/GNSSSensor/script.png differ diff --git a/Components/Sensors/GNSSSensor/script_ros2.png b/Components/Sensors/GNSSSensor/script_ros2.png new file mode 100644 index 0000000000..588b4ab302 Binary files /dev/null and b/Components/Sensors/GNSSSensor/script_ros2.png differ diff --git a/Components/Sensors/IMUSensor/components.png b/Components/Sensors/IMUSensor/components.png new file mode 100644 index 0000000000..65a2826c79 Binary files /dev/null and b/Components/Sensors/IMUSensor/components.png differ diff --git a/Components/Sensors/IMUSensor/index.html b/Components/Sensors/IMUSensor/index.html new file mode 100644 index 0000000000..3e2ed1717f --- /dev/null +++ b/Components/Sensors/IMUSensor/index.html @@ -0,0 +1,2782 @@ + + + + + + + + + + + + + + + + + + + + + + + IMU Sensor - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

IMUSensor

+

Introduction

+

IMUSensor is a component that simulates an IMU (Inertial Measurement Unit) sensor. +Measures acceleration (\({m}/{s^2}\)) and angular velocity (\({rad}/{s}\)) based on the transformation of the GameObject to which this component is attached.

+

Prefab

+

Prefab can be found under the following path:

+
Assets/AWSIM/Prefabs/Sensors/IMUSensor.prefab
+
+ +

IMUSensor has its own frame tamagawa/imu_link in which its data is published. +The sensor prefab is added to this frame. +The tamagawa/imu_link link is added to the sensor_kit_base_link in the base_link object located in the URDF.

+

link

+

A detailed description of the URDF structure and sensors added to prefab Lexus RX450h 2015 is available in this section.

+

Components

+

components

+

The IMUSensor functionality is split into two scripts:

+
    +
  • IMU Sensor (script) - it calculates the acceleration and angular velocity as its output and calls the callback for it.
  • +
  • Imu Ros2 Publisher (script) - provides the ability to publish IMUSensor output as Imu message type published on a specific ROS2 topics.
  • +
+

Scripts can be found under the following path:

+
Assets/AWSIM/Scripts/Sensors/Imu/*
+
+

IMU Sensor (script)

+

script

+

This is the main script in which all calculations are performed:

+
    +
  • the angular velocity is calculated as the derivative of the orientation with respect to time,
  • +
  • acceleration is calculated as the second derivative of position with respect to time,
  • +
  • in the calculation of acceleration, the gravitational vector is considered - which is added.
  • +
+
+

Warning

+

If the angular velocity about any axis is NaN (infinite), then angular velocity is published as vector zero.

+
+

Elements configurable from the editor level

+
    +
  • Output Hz - frequency of output calculation and callback (default: 30Hz)
  • +
+

Output Data

+ + + + + + + + + + + + + + + + + + + + +
CategoryTypeDescription
LinearAccelerationVector3Measured acceleration (m/s^2)
AngularVelocityVector3Measured angular velocity (rad/s)
+

Imu Ros2 Publisher (script)

+

script_ros2

+

Converts the data output from IMUSensor to ROS2 Imu type message and publishes it. +The conversion and publication is performed using the Publish(IMUSensor.OutputData outputData) method, which is the callback triggered by IMU Sensor (script) for the current output.

+
+

Warning

+

In each 3x3 covariance matrices the row-major representation is filled with 0 and does not change during the script run. +In addition, the field orientation is assumed to be {1,0,0,0} and also does not change.

+
+

Elements configurable from the editor level

+
    +
  • Topic - the ROS2 topic on which the message is published
    (default: "/sensing/imu/tamagawa/imu_raw")
  • +
  • Frame id - frame in which data is published, used in Header
    (default: tamagawa/imu_link")
  • +
  • Qos Settings - Quality of service profile used in the publication
    (default: Reliable, Volatile, Keep last, 1000)
  • +
+

Published Topics

+
    +
  • Frequency: 30Hz
  • +
  • QoS: Reliable, Volatile, Keep last/1000
  • +
+ + + + + + + + + + + + + + + + + +
CategoryTopicMessage typeframe_id
IMU data/sensing/imu/tamagawa/imu_rawsensor_msgs/Imutamagawa/imu_link
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Sensors/IMUSensor/link.png b/Components/Sensors/IMUSensor/link.png new file mode 100644 index 0000000000..39608a2d76 Binary files /dev/null and b/Components/Sensors/IMUSensor/link.png differ diff --git a/Components/Sensors/IMUSensor/script.png b/Components/Sensors/IMUSensor/script.png new file mode 100644 index 0000000000..4aaa3b7ec3 Binary files /dev/null and b/Components/Sensors/IMUSensor/script.png differ diff --git a/Components/Sensors/IMUSensor/script_ros2.png b/Components/Sensors/IMUSensor/script_ros2.png new file mode 100644 index 0000000000..df252f340c Binary files /dev/null and b/Components/Sensors/IMUSensor/script_ros2.png differ diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/done.png b/Components/Sensors/LiDARSensor/AddNewLiDAR/done.png new file mode 100644 index 0000000000..4b670f7998 Binary files /dev/null and b/Components/Sensors/LiDARSensor/AddNewLiDAR/done.png differ diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/img/AddPrefabLidar.png b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/AddPrefabLidar.png new file mode 100644 index 0000000000..ea596fe3b8 Binary files /dev/null and b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/AddPrefabLidar.png differ diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarConfiguration.png b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarConfiguration.png new file mode 100644 index 0000000000..96a5ae89c4 Binary files /dev/null and b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarConfiguration.png differ diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarFocalDistanceParamter.png b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarFocalDistanceParamter.png new file mode 100644 index 0000000000..f447b1b54f Binary files /dev/null and b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarFocalDistanceParamter.png differ diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarLaserArray.png b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarLaserArray.png new file mode 100644 index 0000000000..7f36278887 Binary files /dev/null and b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarLaserArray.png differ diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarOriginParameter.png b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarOriginParameter.png new file mode 100644 index 0000000000..68e497fc39 Binary files /dev/null and b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarOriginParameter.png differ diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarSceneDevelop.png b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarSceneDevelop.png new file mode 100644 index 0000000000..2c4107bfe4 Binary files /dev/null and b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/LidarSceneDevelop.png differ diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/img/PrefabLidarObject.png b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/PrefabLidarObject.png new file mode 100644 index 0000000000..f8c050260e Binary files /dev/null and b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/PrefabLidarObject.png differ diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/img/PublisherProp.png b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/PublisherProp.png new file mode 100644 index 0000000000..7732ca2be1 Binary files /dev/null and b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/PublisherProp.png differ diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/img/RGLSceneManagerModes.png b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/RGLSceneManagerModes.png new file mode 100644 index 0000000000..571caae2fd Binary files /dev/null and b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/RGLSceneManagerModes.png differ diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/img/ReadableMeshSetting.png b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/ReadableMeshSetting.png new file mode 100644 index 0000000000..56be05f038 Binary files /dev/null and b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/ReadableMeshSetting.png differ diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/img/VisualizationProp.png b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/VisualizationProp.png new file mode 100644 index 0000000000..9676aeb2b3 Binary files /dev/null and b/Components/Sensors/LiDARSensor/AddNewLiDAR/img/VisualizationProp.png differ diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/index.html b/Components/Sensors/LiDARSensor/AddNewLiDAR/index.html new file mode 100644 index 0000000000..75c60cb0c3 --- /dev/null +++ b/Components/Sensors/LiDARSensor/AddNewLiDAR/index.html @@ -0,0 +1,2651 @@ + + + + + + + + + + + + + + + + + + + + + + + Add New LiDAR - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Add a new LiDAR

+

RGLUnityPlugin (RGL) comes with a number of the most popular LiDARs model definitions and ready-to-use prefabs. However, there is a way to create your custom LiDAR. This section describes how to add a new LiDAR model that works with RGL, then create a prefab for it and add it to the scene.

+
+

Supported LiDARs

+

Not all lidar types are supported by RGL. Unfortunately, in the case of MEMs LiDARs, there is a non-repetitive phenomenon - for this reason, the current implementation is not able to reproduce their work.

+
+

1. Add a new LiDAR model

+

The example shows the addition of a LiDAR named NewLidarModel.

+

To add a new LiDAR model, perform the following steps:

+
    +
  1. +

    Navigate to Assets/RGLUnityPlugin/Scripts/LidarModels.

    +
  2. +
  3. +

    Add its name to the LidarModels.cs at the end of the enumeration. The order of enums must not be changed to keep existing prefabs working.

    +

    lidar_models

    +
  4. +
  5. +

    Now, it is time to define the laser (also called a channel) distribution of the LiDAR.

    +
    +

    Info

    +

    If your LiDAR:

    +
    - has a uniform laser distribution
    +- has the equal range for all of the lasers
    +- fire all of the rays (beams) at the same time
    +
    +

    You can skip this step and use our helper method to generate a simple uniform laser array definition (more information in the next step).

    +
    +
      +
    1. +

      Laser distribution is represented by LaserArray consists of:

      +
        +
      • +

        centerOfMeasurementLinearOffsetMm - 3D translation from the game object's origin to LiDAR's origin. Preview in 2D:

        +

        +
      • +
      • +

        focalDistanceMm - Distance from the sensor center to the focal point where all laser beams intersect.

        +

        +
      • +
      • +

        lasers - array of lasers (channels) with a number of parameters:

        +
          +
        • horizontalAngularOffsetDeg - horizontal angle offset of the laser (Azimuth)
        • +
        • verticalAngularOffsetDeg - vertical angle offset of the laser (Elevation)
        • +
        • verticalLinearOffsetMm - vertical offset of the laser (translation from origin)
        • +
        • ringId - Id of the ring (in most cases laser Id)
        • +
        • timeOffset - time offset of the laser firing in milliseconds (with reference to the first laser in the array)
        • +
        • minRange - minimum range of the laser (set if lasers have different ranges)
        • +
        • maxRange - maximum range of the laser (set if lasers have different ranges)
        • +
        +
      • +
      +
    2. +
    3. +

      To define a new laser distribution create a new class in the LaserArrayLibrary.cs

      +

      lidar_array

      +
        +
      • Add a new public static instance of LaserArray with the definition.
      • +
      +

      In this example, NewLidarModel laser distribution consists of 5 lasers with

      +
      - elevations: 15, 10, 0, -10, -15 degrees
      +- azimuths: 1.4, -1.4, 1.4, -1.4, 1.4 degrees
      +- ring Ids: 1, 2, 3, 4, 5
      +- time offsets: 0, 0.01, 0.02, 0.03, 0.04 milliseconds
      +- an equal range that will be defined later
      +
      +
      +

      Coordinate system

      +

      Keep in mind that Unity has a left-handed coordinate system, while most of the LiDAR's manuals use a right-handed coordinate system. In that case, reverse sign of the values of the angles.

      +
      +
    4. +
    +
  6. +
  7. +

    The last step is to create a LiDAR configuration by adding an entry to LidarConfigurationLibrary.cs

    +

    lidar_configuration

    +

    Add a new item to the ByModel dictionary that collects LiDAR model enumerations with their BaseLidarConfiguration choosing one of the implementations:

    +
      +
    • UniformRangeLidarConfiguration - lidar configuration for uniformly distributed rays along the horizontal axis with a uniform range for all the rays (it contains minRange and maxRange parameters additionally)
    • +
    • LaserBasedRangeLidarConfiguration - lidar configuration for uniformly distributed rays along the horizontal axis with ranges retrieved from lasers description
    • +
    • Or create your custom implementations in LidarConfiguration.cs like:
        +
      • HesaiAT128LidarConfiguration
      • +
      • HesaiQT128C2XLidarConfiguration
      • +
      • HesaiPandar128E4XLidarConfiguration
      • +
      +
    • +
    +
    +

    Lidar configuration parameters descrition

    +

    Please refer to this section for the detailed description of all configuration parameters.

    +
    +
  8. +
  9. +

    Done. New LiDAR preset should be available via Unity Inspector.

    +

    done

    +

    Frame rate of the LiDAR can be set in the Automatic Capture Hz parameter.

    +

    Note: In the real-world LiDARs, frame rate affects horizontal resolution. Current implementation separates these two parameters. Keep in mind to change it manually.

    +
  10. +
+

2. Create new LiDAR prefab

+
    +
  1. Create an empty object and name it appropriately according to the LiDAR model.
  2. +
  3. Attach script LidarSensor.cs to created object.
  4. +
  5. Set the new added LiDAR model in Model Preset field, check if the configuration loads correctly. You can now customize it however you like.
  6. +
  7. (Optional) Attach script PointCloudVisualization.cs for visualization purposes.
  8. +
  9. For publishing point cloud via ROS2 attach script RglLidarPublisher.cs script to created object.
  10. +
  11. Set the topics on which you want the data to be published and their frame.
  12. +
  13. Save the prefab in the project.
  14. +
+

3. Test your prefab

+
    +
  1. Create a new scene (remember to add the SceneManager) or use one of the existing sample scenes.
  2. +
  3. +

    Add the prepared LiDAR prefab by drag the prefab file and drop it into a scene.

    +

    +
  4. +
  5. +

    A LiDAR GameObject should be instantiated automatically

    +

    +
  6. +
  7. +

    Now you can run the scene and check how your LiDAR works.

    +
  8. +
+
+

Success

+

We encourage you to develop a vehicle using the new LiDAR you have added - learn how to do this here.

+
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Sensors/LiDARSensor/AddNewLiDAR/lidar_models.png b/Components/Sensors/LiDARSensor/AddNewLiDAR/lidar_models.png new file mode 100644 index 0000000000..f9693de3ba Binary files /dev/null and b/Components/Sensors/LiDARSensor/AddNewLiDAR/lidar_models.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/InstanceSegDictMapping.png b/Components/Sensors/LiDARSensor/LiDARSensor/InstanceSegDictMapping.png new file mode 100644 index 0000000000..e32f510445 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/InstanceSegDictMapping.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/InstanceSegOutput.png b/Components/Sensors/LiDARSensor/LiDARSensor/InstanceSegOutput.png new file mode 100644 index 0000000000..cbc1ecfeed Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/InstanceSegOutput.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/LidarVisualizationOnScene.png b/Components/Sensors/LiDARSensor/LiDARSensor/LidarVisualizationOnScene.png new file mode 100644 index 0000000000..80366d4b6f Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/LidarVisualizationOnScene.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/bandwidth.png b/Components/Sensors/LiDARSensor/LiDARSensor/bandwidth.png new file mode 100644 index 0000000000..1730f74b84 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/bandwidth.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/components.png b/Components/Sensors/LiDARSensor/LiDARSensor/components.png new file mode 100644 index 0000000000..468ae5c575 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/components.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/at128e2x.png b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/at128e2x.png new file mode 100644 index 0000000000..584af9ff91 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/at128e2x.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/os1-64.png b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/os1-64.png new file mode 100644 index 0000000000..0e23e43243 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/os1-64.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/pandar128e4x.png b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/pandar128e4x.png new file mode 100644 index 0000000000..98a5f77642 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/pandar128e4x.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/pandar40p.png b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/pandar40p.png new file mode 100644 index 0000000000..e3cf046fd9 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/pandar40p.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/pandarqt.png b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/pandarqt.png new file mode 100644 index 0000000000..e87a10fda0 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/pandarqt.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/pandarxt32.png b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/pandarxt32.png new file mode 100644 index 0000000000..c911f3f7a4 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/pandarxt32.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/qt1238c2x.png b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/qt1238c2x.png new file mode 100644 index 0000000000..55551c841a Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/qt1238c2x.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/vlp16.png b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/vlp16.png new file mode 100644 index 0000000000..ea6252e2e1 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/vlp16.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/vlp32.png b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/vlp32.png new file mode 100644 index 0000000000..a67ed76845 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/vlp32.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/vls128.png b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/vls128.png new file mode 100644 index 0000000000..3f70eb92af Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/imgs_prefabs/vls128.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/index.html b/Components/Sensors/LiDARSensor/LiDARSensor/index.html new file mode 100644 index 0000000000..8b2c718ff7 --- /dev/null +++ b/Components/Sensors/LiDARSensor/LiDARSensor/index.html @@ -0,0 +1,3239 @@ + + + + + + + + + + + + + + + + + + + + + + + LiDAR Sensor - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

LidarSensor

+

Introduction

+

LidarSensor is the component that simulates the LiDAR (Light Detection and Ranging) sensor. +LiDAR works by emitting laser beams that bounce off objects in the environment, and then measuring the time it takes for the reflected beams to return, allowing the sensor to create a 3D map of the surroundings. +This data is used for object detection, localization, and mapping.

+

LiDAR in an autonomous vehicle can be used for many purposes. +The ones mounted on the top of autonomous vehicles are primarily used

+
    +
  • to scan the environment for localization in space
  • +
  • to detect and identify obstacles such as approaching vehicles, pedestrians or other objects in the driving path.
  • +
+

LiDARs placed on the left and right sides of the vehicle are mainly used to monitor the traffic lane and detect vehicles moving in adjacent lanes, enabling safe maneuvers such as lane changing or turning.

+

LidarSensor component is a part of RGLUnityPlugin that integrates the external RobotecGPULidar (RGL) library with Unity. RGL also allows to provide additional information about objects, more about it here.

+
+

Use RGL in your scene

+

If you want to use RGL in your scene, make sure the scene has an SceneManager component added and all objects meet the usage requirements.

+
+
+

RGL default scenes

+

If you would like to see how LidarSensor works using RGL or run some tests, we encourage you to familiarize yourself with the RGL test scenes section.

+
+
+

Supported LiDARs

+

The current scripts implementation allows you to configure the prefab for any mechanical LiDAR. +You can read about how to do it here. +MEMS-based LiDARs due to their different design are not yet fully supported.

+
+

Prefabs

+

Prefabs can be found under the following path:

+
Assets/AWSIM/Prefabs/Sensors/RobotecGPULidars/*
+
+

The table of available prefabs can be found below:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LiDARPathAppearance
HESAI Pandar40PHesaiPandar40P.prefab
HESAI PandarQT64HesaiPandarQT64.prefab
HESAI PandarXT32HesaiPandarXT32.prefab
HESAI QT128C2XHesaiQT128C2X.prefab
HESAI Pandar128E4XHesaiPandar128E4X.prefab
HESAI AT128 E2XHesaiAT128E2X.prefab
Ouster OS1-64OusterOS1-64.prefab
Velodyne VLP-16VelodyneVLP16.prefab
Velodyne VLC-32CVelodyneVLP32C.prefab
Velodyne VLS-128-APVelodyneVLS128.prefab
+ +

link

+

LidarSensor is configured in default vehicle EgoVehicle prefab. +It is added to URDF object as a child of sensor_kit_base_link. +LidarSensor placed in this way does not have its own frame, and the data is published relative to sensor_kit_base_link. +More details about the location of the sensors in the vehicle can be found here.

+

A detailed description of the URDF structure and sensors added to prefab Lexus RX450h 2015 is available in this section.

+
+

Additional LiDARs

+

For a LiDAR placed on the left side, right side or rear, an additional link should be defined.

+
+

Components and Resources

+

components

+

The LiDAR sensor simulation functionality is split into three components:

+
    +
  • Lidar Sensor (script) - provides lidar configuration, creates RGL pipeline to simulate lidar, and performs native RGL raytrace calls,
  • +
  • Rgl Lidar Publisher (script) - extends RGL pipeline with nodes to publish ROS2 messages.
  • +
  • Point Cloud Visualization (script) - visualizes point cloud collected by sensor.
  • +
+

Moreover, the scripts use Resources to provide configuration for prefabs of supported lidar models:

+
    +
  • LaserModels - provides a list of supported models,
  • +
  • LaserArrayLibrary - provides data related to laser array construction for supported models,
  • +
  • LaserConfigurationLibrary - provides full configuration, with ranges and noise for supported models.
  • +
+

These are elements of the RGLUnityPlugin, you can read more here.

+

Lidar Sensor (script)

+

script

+

This is the main component that creates the RGL node pipeline for the LiDAR simulation. +The pipeline consists of:

+
    +
  • setting ray pattern,
  • +
  • transforming rays to represent pose of the sensor on the scene,
  • +
  • applying Gaussian noise,
  • +
  • performing raytracing,
  • +
  • removing non-hits from the result point cloud,
  • +
  • transforming point cloud to sensor frame coordinate system.
  • +
+

Elements configurable from the editor level

+
    +
  • Automatic Capture Hz - the rate of sensor processing (default: 10Hz)
  • +
  • Model Preset - allows selecting one of the built-in LiDAR models (default: RangeMeter)
  • +
  • Return Type - allows selecting multi-return mode (note: this requires more computation). Modes other than "not divergent" require positive beam divergence.
  • +
  • Apply Distance Gaussian Noise - enable/disable distance Gaussian noise (default: true)
  • +
  • Apply Angular Gaussian Noise - enable/disable angular Gaussian noise (default: true)
  • +
  • Apply Velocity Distortion - enable/disable velocity distortion (default: false)
  • +
  • +

    Configuration:

    +
      +
    • Laser Array - geometry description of lidar's array of lasers, should be prepared on the basis of the manual for a given model of LiDAR (default: loaded from LaserArrayLibrary)
    • +
    • Horizontal Resolution - the horiontal resolution of laser array firings
    • +
    • Min H Angle - minimum horizontal angle, left (default: 0)
    • +
    • Max H Angle - maximum horizontal angle, right (default: 0)
    • +
    • Laser Array Cycle Time - time between two consecutive firings of the whole laser array in milliseconds (default: 0); used for velocity distortion feature.
    • +
    • Horizontal Beam Divergence - represents horizontal deviation of photons from a single beam emitted by a LiDAR sensor (in degrees);
    • +
    • Vertical Beam Divergence - represents vertical deviation of photons from a single beam emitted by a LiDAR sensor (in degrees);
    • +
    • Noise Params:
        +
      • Angular Noise Type - angular noise type
        (default: Ray Based)
      • +
      • Angular Noise St Dev - angular noise standard deviation in degree
        (default: 0.05729578)
      • +
      • Angular Noise Mean - angular noise mean in degrees
        (default: 0)
      • +
      • Distance Noise St Dev Base - distance noise standard deviation base in meters
        (default: 0.02)
      • +
      • Distance Noise Rise Per Meter - distance noise standard deviation rise per meter
        (default: 0)
      • +
      • Distance Noise Mean - distance noise mean in meters
        (default: 0)
      • +
      +
    • +
    • +

      Output Restriction Params:

      +
        +
      • Apply Restriction - enable/disable fault injection (default: false)
      • +
      • Rectangular Restriction Masks - list of rectangular masks used for output restriction; each mask is represented via ranges of angles in horizontal and vertical dimensions
      • +
      • Enable Periodic Restriction - change mode from static to periodic (default: false)
      • +
      • Restriction Period - time of whole period in seconds
      • +
      • Restriction Duty Rate - rate of time with masked output
      • +
      • Enable Restriction Randomizer - enable/disable random periodic mode (default: false)
      • +
      • Min Random Period - lower bound of time period in seconds used in random mode
      • +
      • Max Random Period - upper bound of time period in seconds used in random mode
      • +
      +
    • +
    • +

      Additional options (available for some Lidar Model Preset)

      +
        +
      • Min Range - minimum range of the sensor (if not avaiable, the range is different for each laser in Laser Array)
      • +
      • Max Range - maximum range of the sensor (if not avaiable, the range is different for each laser in Laser Array)
      • +
      • High Resolution Mode Enabled - whether to activate high resolution mode (available for Hesai Pandar 128E4X LiDAR model)
      • +
      +
    • +
    +
  • +
+

Output Data

+

LidarSensor provides public methods to extend this pipeline with additional RGL nodes. +In this way, other components can request point cloud processing operations and receive data in the desired format.

+

Example of how to get XYZ point cloud data:

+
    +
  1. To obtain point cloud data from another component you have to create a new RGLNodeSequence with RGL node to yield XYZ field and connect it to LidarSensor: +
    rglOutSubgraph = new RGLNodeSequence().AddNodePointsYield("OUT_XYZ", RGLField.XYZ_F32);
    +lidarSensor = GetComponent<LidarSensor>();
    +lidarSensor.ConnectToWorldFrame(rglOutSubgraph); // you can also connect to Lidar frame using ConnectToLidarFrame
    +// You can add a callback to receive a notification when new data is ready
    +lidarSensor.onNewData += HandleLidarDataMethod;
    +
  2. +
  3. To get data from RGLNodeSequence call GetResultData: +
    Vector3[] xyz = new Vector3[0];
    +rglOutSubgraph.GetResultData<Vector3>(ref xyz);
    +
  4. +
+

Rgl Lidar Publisher (script)

+

script_ros2

+

RglLidarPublisher extends the main RGL pipeline created in LidarSensor with RGL nodes that produce point clouds in specific format and publish them to the ROS2 topic. +Thanks to the ROS2 integration with RGL, point clouds can be published directly from the native library. +RGL creates ROS2 node named /RobotecGPULidar with publishers generated by RGL nodes.

+

Currently, RglLidarPublisher implements ROS2 publishers for two message types:

+ +

PointCloud2 message allows publishing point clouds with different points attributes (described by fields parameter). In order to easily select different frequently used field sets RglLidarPublisher has several field presets defined:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PresetDescriptionFields
Pcl 2424-byte point cloud format used by AutowareXYZ_VEC3_F32, PADDING_32, INTENSITY_F32, RING_ID_U16, PADDING_16
PointXYZIRCEADTPointXYZIRCEADT format used by AutowareXYZ_VEC3_F32, INTENSITY_U8, RETURN_TYPE_U8, RING_ID_U16, ELEVATION_F32, AZIMUTH_F32, DISTANCE_F32, TIME_STAMP_U32
Pcl 4848-byte extended version point cloud format used by Autoware (legacy)XYZ_VEC3_F32, PADDING_32, INTENSITY_F32, RING_ID_U16, PADDING_16, AZIMUTH_F32, DISTANCE_F32, RETURN_TYPE_U8, PADDING_8, PADDING_16, PADDING_32, TIME_STAMP_F64
ML Instance SegmentationMachine learning format for instance/semantic segmentation tasksXYZ_VEC3_F32, ENTITY_ID_I32, INTENSITY_F32
Radar Smart MicroFormat used in Radar Smart MicroXYZ_VEC3_F32, RADIAL_SPEED_F32, POWER_F32, RCS_F32, NOISE_F32, SNR_F32
CustomEmpty format that allows the user to define its fieldsets
+
+

PointXYZIRCEADT format

+

For a better understanding of the PointXYZIRCEADT format, we encourage you to familiarize yourself with the point cloud pre-processing process in Autoware, which is described here.

+
+

Elements configurable from the editor level

+
    +
  • Frame ID - frame in which data are published, used in Header (default: "world")
  • +
  • Qos - Quality of service profile used in the publication
      +
    • Reliability Policy - Reliability policy (default: Best effort)
    • +
    • Durability Policy - Durability policy (default: Volatile)
    • +
    • History Policy - History policy (default: Keep last)
    • +
    • History Depth - History depth. If history policy is Keep all, depth is ignored. (default: 5)
    • +
    +
  • +
  • Point Cloud 2 Publishers - List of sensor_msgs/PointCloud2 message publishers
      +
    • Topic - Topic name to publish on
    • +
    • Publish - If false, publishing will be stopped
    • +
    • Fields Preset - allows selecting one of the pre-defined fieldsets (choose Custom to define your own)
    • +
    • Fields - List of fields to be present in the message
    • +
    +
  • +
  • Radar Scan Publishers - List of radar_msgs/RadarScan message publishers
      +
    • Topic - Topic name to publish on
    • +
    • Publish - If false, publishing will be stopped
    • +
    +
  • +
+
+

Elements configurable in simulation runtime

+

Once the simulation starts, only the Publish flag is handled. All of the publishers are initialized on the simulation startup and updates of their parameters are not supported in runtime. Any changes to the publishing configuration are ignored.

+
+

Default Publishing Topics

+
    +
  • Frequency: 10Hz
  • +
  • QoS: Best effort, Volatile, Keep last/5
  • +
+ + + + + + + + + + + + + + + + + + + + + + + +
CategoryTopicMessage typeframe_id
PointCloud 24-byte format/lidar/pointcloudsensor_msgs/PointCloud2world
PointXYZIRCEADT format/lidar/pointcloud_exsensor_msgs/PointCloud2world
+

Point Cloud Visualization (script)

+

script_visualization

+

A component visualizing a point cloud obtained from RGL in the form of a Vector3 list as colored points in the Unity scene. +Based on the defined color table, it colors the points depending on the height at which they are located.

+

The obtained points are displayed as the vertices of mesh, and their coloring is possible thanks to the use of PointCloudMaterial material which can be found in the following path:

+
Assets/RGLUnityPlugin/Resources/PointCloudMaterial.mat
+
+

Point Cloud Visualization preview:

+

+

Elements configurable from the editor level

+
    +
  • Point Shape - the shape of the displayed points (default: Box)
  • +
  • Point Size - the size of the displayed points (default: 0.05)
  • +
  • Colors - color list used depending on height
    (default: 6 colors: red, orange, yellow, green, blue, violet)
  • +
  • Auto Compute Coloring Heights - automatic calculation of heights limits for a list of colors (default: false)
  • +
  • Min Coloring Height - minimum height value from which color matching is performed, below this value all points have the first color from the list (default: 0)
  • +
  • Max Coloring Height - maximum height value from which color matching is performed, above this value all points have the last color from the list (default: 20)
  • +
+

Read material information

+

To ensure the publication of the information described in this section, GameObjects must be adjusted accordingly. This tutorial describes how to do it.

+

Intensity Texture

+

RGL Unity Plugin allows assigning an Intensity Texture to the GameObjects to produce a point cloud containing information about the lidar ray intensity of hit. It can be used to distinguish different levels of an object's reflectivity.

+

Output data

+

Point cloud containing intensity is published on the ROS2 topic via RglLidarPublisher component. The intensity value is stored in the intensity field of the sensor_msgs/PointCloud2 message.

+

Instance segmentation

+

RGL Unity Plugin allows assigning an ID to GameObjects to produce a point cloud containing information about hit objects. It can be used for instance/semantic segmentation tasks. This tutorial describes how to do it.

+
+

LidarInstanceSegmentationDemo

+

If you would like to see how LidarInstanceSegmentationDemo works using RGL or run some tests, we encourage you to familiarize yourself with this section.

+
+

Output data

+

Point cloud containing hit objects IDs is published on the ROS2 topic via RglLidarPublisher component. The publisher for such point cloud format is not added by default. Add a new PointCloud2 publisher with ML Instance Segmentation fields preset or create your format by selecting Custom preset (remember to add ENTITY_ID_I32 field which holds objects IDs).

+

+

Dictionary mapping

+

The resulting simulation data contains only the id of objects without their human-readable names. To facilitate the interpretation of such data, a function has been implemented to save a file with a dictionary mapping instance ID to GameObject names. It writes pairs of values in the yaml format:

+
    +
  • The name of the GameObject
  • +
  • Category ID of SemanticCategory component
  • +
+

To enable saving dictionary mapping set output file path to the Semantic Category Dictionary File property in the Scene Manager component:

+

+

The dictionary mapping file will be saved at the end of the simulation.

+

LiDAR output restriction

+

Describes LiDAR faults modeled as a set of rectangular masks obstructing part of the rays.

+

Example set of parameters for output restriction resulting in one rectangular mask obstructing rays:

+

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/lidar_meshes.png b/Components/Sensors/LiDARSensor/LiDARSensor/lidar_meshes.png new file mode 100644 index 0000000000..3898eec42f Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/lidar_meshes.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/link.png b/Components/Sensors/LiDARSensor/LiDARSensor/link.png new file mode 100644 index 0000000000..ce39cacfa0 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/link.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/output_restriction_example.png b/Components/Sensors/LiDARSensor/LiDARSensor/output_restriction_example.png new file mode 100644 index 0000000000..880fcacd23 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/output_restriction_example.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/script.png b/Components/Sensors/LiDARSensor/LiDARSensor/script.png new file mode 100644 index 0000000000..44349bd382 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/script.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/script_ros2.png b/Components/Sensors/LiDARSensor/LiDARSensor/script_ros2.png new file mode 100644 index 0000000000..40abb17f68 Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/script_ros2.png differ diff --git a/Components/Sensors/LiDARSensor/LiDARSensor/script_visualization.png b/Components/Sensors/LiDARSensor/LiDARSensor/script_visualization.png new file mode 100644 index 0000000000..da95f947ef Binary files /dev/null and b/Components/Sensors/LiDARSensor/LiDARSensor/script_visualization.png differ diff --git a/Components/Sensors/LiDARSensor/RGLUnityPlugin/index.html b/Components/Sensors/LiDARSensor/RGLUnityPlugin/index.html new file mode 100644 index 0000000000..79154980d8 --- /dev/null +++ b/Components/Sensors/LiDARSensor/RGLUnityPlugin/index.html @@ -0,0 +1,2735 @@ + + + + + + + + + + + + + + + + + + + + + + + RGLUnityPlugin - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

RGLUnityPlugin

+

Robotec GPU Lidar (RGL) is an open source high performance lidar simulator running on CUDA-enabled GPUs. +It is a cross-platform solution compatible with both Windows and Linux operating systems. +RGL utilizes RTX cores for acceleration, whenever they are accessible.

+

RGL is used in AWSIM for performance reasons. +Thanks to it, it is possible to perform a large number of calculations using the GPU, which is extremely helpful due to the size of the scenes. +AWSIM is integrated with RGL out-of-the-box - using RGLUnityPlugin asset.

+
+

Warning

+

If you want to use RGL in your scene, make sure the scene has an RGLSceneManager component added and all objects meet the usage requirements.

+
+

Concept

+

Describing the concept of using RGL in AWSIM, we distinguish:

+
    +
  • +

    Mesh - a handle to the on-GPU data of the 3D model of objects that in AWSIM are provided in the form of Mesh Filter component. +RGLUnityPlugin supports two types of meshes: static (rendered by Mesh Renderer) and animated (rendered by Skinned Mesh Renderer). +Static meshes could be shared between Entities.

    +
  • +
  • +

    Entity - represents a 3D object on the scene with its position and rotation. +It consists of a lightweight reference to a Mesh and a transformation matrix of the object.

    +
  • +
  • +

    Scene - a location where raytracing occurs. +It is a set of entites uploaded by SceneManager script to the RGL Native Library.

    +
  • +
  • +

    Node - performs specific operations such as setting rays for raytracing, transforming rays, performing raytracing, and manipulating output formats. +In AWSIM, the main sequence of RGL nodes that simulates LiDAR is created in the LidarSensor script. +Other scripts usually create nodes to get requested output or preprocess point cloud, and then connect those nodes to the LidarSensor.

    +
  • +
  • +

    Graph - a collection of connected Nodes that can be run to calculate results. +It allows users to customize functionality and output format by adding or removing Nodes.

    +
  • +
+

Producing a point cloud is based on the use of a Scene containing Entities with Meshes, and placing an Ego Entity with LiDAR sensor that creates a Graph describing ray pattern and performing raytracing. +In subsequent frames of the simulation, SceneManager synchronizes the scene between Unity and RGL, and LiDAR sensor updates rays pose on the scene and triggers Graph to perform raytracing and format desired output.

+

Package structure

+

RGLUnityPlugin asset contains:

+
    +
  • Plugins - dynamically loaded libraries for Windows and Linux (*.dll and *.so files).
  • +
  • Resources - visualization shader and material.
  • +
  • Scripts - scripts for using RGL in the Unity - details below.
  • +
+

Scripts

+
    +
  • SceneManager - responsible for syncing the scene between Unity and RGL.
  • +
  • LidarSensor - provide lidar configuration and create RGL pipeline to simulate lidar.
  • +
  • RadarSensor - provide radar configuration and create RGL pipeline to simulate radar.
  • +
  • PointCloudVisualization - visualize point cloud on the Unity scene.
  • +
  • IntensityTexture - adds slot for Intensity Texture ID to the GameObject
  • +
  • SemanticCategory - adds category ID to the GameObject
  • +
  • RGLDebugger - provides configuration for Native RGL debug tools (logging and tape).
  • +
  • A set of classes providing tools to define LiDAR specification (mostly: ray poses):
      +
    • LidarModels - enumeration with supported LiDARs models.
    • +
    • LidarConfiguration - top-level configuration class, horizontal ranges, distance range, laser array.
    • +
    • LidarConfigurationLibrary - provides a number of pre-defined LidarConfigurations.
    • +
    • LaserArray - definition of a (vertical) array of lasers.
    • +
    • LaserArrayLibrary - provides a number of pre-defined LaserArrays.
    • +
    • Laser - describes offsets of a single laser within a LaserArray.
    • +
    • LidarNoiseParams - describes a LiDAR noise that can be simulated
    • +
    • LidarOutputRestrictions - Describes LiDAR faults modeled as a set of rectangular masks obstructing part of the rays
    • +
    +
  • +
  • A set of classes providing tools to define radar specification:
      +
    • RadarModels - enumeration with supported radar models.
    • +
    • RadarConfiguration - top-level configuration class, horizontal ranges, distance range, radar parameters.
    • +
    • LidarConfigurationLibrary - provides a number of pre-defined RadarConfigurations.
    • +
    • RadarNoiseParams - describes a radar noise that can be simulated
    • +
    +
  • +
  • LowLevelWrappers scripts - provides some convenience code to call Native RGL functions.
  • +
  • Utilities scripts - miscellaneous utilities to make rest of the code clearer.
  • +
+

SceneManager

+

Each scene needs SceneManager component to synchronize models between Unity and RGL. +On every frame, it detects changes in the Unity's scene and propagates the changes to native RGL code. +When necessary, it obtains 3D models from GameObjects on the scene, and when they are no longer needed, it removes them.

+

Three different strategies to interact with in-simulation 3D models are implemented. +SceneManager uses one of the following policies to construct the scene in RGL:

+
    +
  • Only Colliders - data is computed based on the colliders only, which are geometrical primitives or simplified Meshes. +This is the fastest option, but will produce less accurate results, especially for the animated entities.
  • +
  • Regular Meshes And Colliders Instead Of Skinned - data is computed based on the regular meshes for static Entities (with MeshRenderers component) and the colliders for animated Entities (with SkinnedMeshRenderer component). +This improves accuracy for static Entities with a negligible additional performance cost.
  • +
  • Regular Meshes And Skinned Meshes - uses regular meshes for both static and animated Entities. +This incurs additional performance, but produces the most realistic results.
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Mesh Source StrategyStatic EntityAnimated Entity (NPC)
Only CollidersColliderCollider
Regular Meshes And Colliders Instead Of SkinnedRegular MeshCollider
Regular Meshes And Skinned MeshesRegular MeshRegular Mesh
+

Mesh source can be changed in the SceneManager script properties:

+

+
+

Performance

+

SceneManager performance depends on mesh source option selected.

+
+

Usage requirements

+

Objects, to be detectable by RGL, must fulfill the following requirements:

+
    +
  1. Contain one of the components: Collider, Mesh Renderer, or Skinned Mesh Renderer - it depends on SceneManager mesh source parameter.
  2. +
  3. +

    Be readable from CPU-accessible memory - it can be achieved using the Read/Write Enabled checkbox in mesh settings.

    +
    +

    Readable objects

    +

    Primitive Objects are readable by default.

    +
    +
    +

    Example

    +

    The activated Readable option in the mesh should look like this.

    +

    +
    +
  4. +
+ + + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Sensors/LiDARSensor/RGLUnityPlugin/readable.png b/Components/Sensors/LiDARSensor/RGLUnityPlugin/readable.png new file mode 100644 index 0000000000..56be05f038 Binary files /dev/null and b/Components/Sensors/LiDARSensor/RGLUnityPlugin/readable.png differ diff --git a/Components/Sensors/LiDARSensor/RGLUnityPlugin/scene_manager.png b/Components/Sensors/LiDARSensor/RGLUnityPlugin/scene_manager.png new file mode 100644 index 0000000000..571caae2fd Binary files /dev/null and b/Components/Sensors/LiDARSensor/RGLUnityPlugin/scene_manager.png differ diff --git a/Components/Sensors/LiDARSensor/RGLUnityPlugin/scene_manager_.png b/Components/Sensors/LiDARSensor/RGLUnityPlugin/scene_manager_.png new file mode 100644 index 0000000000..162ad64211 Binary files /dev/null and b/Components/Sensors/LiDARSensor/RGLUnityPlugin/scene_manager_.png differ diff --git a/Components/Sensors/LiDARSensor/ReadMaterialInformation/InstanceSegDictMapping.png b/Components/Sensors/LiDARSensor/ReadMaterialInformation/InstanceSegDictMapping.png new file mode 100644 index 0000000000..e32f510445 Binary files /dev/null and b/Components/Sensors/LiDARSensor/ReadMaterialInformation/InstanceSegDictMapping.png differ diff --git a/Components/Sensors/LiDARSensor/ReadMaterialInformation/InstanceSegExample1.png b/Components/Sensors/LiDARSensor/ReadMaterialInformation/InstanceSegExample1.png new file mode 100644 index 0000000000..1b555d219e Binary files /dev/null and b/Components/Sensors/LiDARSensor/ReadMaterialInformation/InstanceSegExample1.png differ diff --git a/Components/Sensors/LiDARSensor/ReadMaterialInformation/InstanceSegExample2.png b/Components/Sensors/LiDARSensor/ReadMaterialInformation/InstanceSegExample2.png new file mode 100644 index 0000000000..07dbad6264 Binary files /dev/null and b/Components/Sensors/LiDARSensor/ReadMaterialInformation/InstanceSegExample2.png differ diff --git a/Components/Sensors/LiDARSensor/ReadMaterialInformation/InstanceSegExample3.png b/Components/Sensors/LiDARSensor/ReadMaterialInformation/InstanceSegExample3.png new file mode 100644 index 0000000000..aa36194981 Binary files /dev/null and b/Components/Sensors/LiDARSensor/ReadMaterialInformation/InstanceSegExample3.png differ diff --git a/Components/Sensors/LiDARSensor/ReadMaterialInformation/IntensityTextureProperties.png b/Components/Sensors/LiDARSensor/ReadMaterialInformation/IntensityTextureProperties.png new file mode 100644 index 0000000000..e8e2e412b0 Binary files /dev/null and b/Components/Sensors/LiDARSensor/ReadMaterialInformation/IntensityTextureProperties.png differ diff --git a/Components/Sensors/LiDARSensor/ReadMaterialInformation/IntensityTextureSlot.png b/Components/Sensors/LiDARSensor/ReadMaterialInformation/IntensityTextureSlot.png new file mode 100644 index 0000000000..ccb99f923c Binary files /dev/null and b/Components/Sensors/LiDARSensor/ReadMaterialInformation/IntensityTextureSlot.png differ diff --git a/Components/Sensors/LiDARSensor/ReadMaterialInformation/index.html b/Components/Sensors/LiDARSensor/ReadMaterialInformation/index.html new file mode 100644 index 0000000000..2fd3a7f128 --- /dev/null +++ b/Components/Sensors/LiDARSensor/ReadMaterialInformation/index.html @@ -0,0 +1,2572 @@ + + + + + + + + + + + + + + + + + + + + + + + Read Material Information - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Read Material Information

+ +

RGL Unity Plugin allows to:

+
    +
  • assigning an Intensity Texture to the GameObjects to produce a point cloud containing information about the lidar ray intensity of hit. It can be used to distinguish different levels of an object's reflectivity.
  • +
  • assigning an ID to GameObjects to produce a point cloud containing information about hit objects. It can be used for instance/semantic segmentation tasks. +Below describes how to ensure the publication of this information.
  • +
+

Add Intensity Texture assignment

+

To enable reading material information, add IntensityTexture component to every GameObject that is expected to have non-default intensity values.

+

+

After that desired texture has to be inserted into the Intensity Texture slot.

+

The texture has to be in R8 format. That means 8bit in the red channel (255 possible values).

+

+

When the texture is assigned, the intensity values will be read from the texture and added to the point cloud if and only if the mesh component in the GameObject has a set of properly created texture coordinates.

+

The expected number of texture coordinates is equal to the number of vertices in the mesh. The quantity of indices is not relevant. In other cases, the texture will be no read properly.

+

Add ID assignment

+

To enable segmentation, add SemanticCategory component to every GameObject that is expected to have a distinct ID. All meshes that belong to a given object will inherit its ID. +ID inheritance mechanism allows IDs to be overwritten for individual meshes/objects. +This solution also enables the creation of coarse categories (e.g., Pedestrians, Vehicles)

+
+

Example

+

SemanticCategory component is assigned to the Taxi GameObject. All meshes in the Taxi GameObject will have the same instance ID as Taxi:* +

+
+
+

Example

+

The driver has its own SemanticCategory component, so his instance ID will differ from the rest of the meshes: +

+
+
+

Example

+

SemanticCategory component is assigned to the Vehicles GameObject that contains all of the cars on the scene: +

+
+

Dictionary mapping

+

The resulting simulation data contains only the id of objects without their human-readable names. To facilitate the interpretation of such data, a function has been implemented to save a file with a dictionary mapping instance ID to GameObject names. It writes pairs of values in the yaml format:

+
    +
  • The name of the GameObject
  • +
  • Category ID of SemanticCategory component
  • +
+

To enable saving dictionary mapping set output file path to the Semantic Category Dictionary File property in the Scene Manager component:

+

+

The dictionary mapping file will be saved at the end of the simulation.

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Sensors/RadarSensor/components.png b/Components/Sensors/RadarSensor/components.png new file mode 100644 index 0000000000..b8a142cd4d Binary files /dev/null and b/Components/Sensors/RadarSensor/components.png differ diff --git a/Components/Sensors/RadarSensor/index.html b/Components/Sensors/RadarSensor/index.html new file mode 100644 index 0000000000..fe6b443a74 --- /dev/null +++ b/Components/Sensors/RadarSensor/index.html @@ -0,0 +1,2763 @@ + + + + + + + + + + + + + + + + + + + + + + + Radar Sensor - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

RadarSensor

+

Introduction

+

The RadarSensor component simulates a radar sensor that detect objects in the environment. +Real-world radar sensors work by emitting radio waves and detecting the waves that are reflected back from objects in +the environment.

+

RadarSensor implements simplified a model of wave propagation and reflection using GPU-accelerated ray casting and +post-processing +to obtain radar-specific information such as radial (aka doppler) +speed, RCS, +power level, noise level and signal-to-noise ratio.

+

RadarSensor component is a part of RGLUnityPlugin that integrates the external +RobotecGPULidar (RGL) library with Unity.

+
+

Use RGL in your scene

+

If you want to use RGL in your scene, make sure the scene has +an SceneManager component added and all objects meet +the usage requirements.

+
+

Prefabs

+

Prefabs can be found under the following path:

+

Assets/AWSIM/Prefabs/Sensors/RobotecGPULidars/*

+ + + + + + + + + + + + + + + +
RadarPathAppearance
SmartmicroDRVEGRD169SmartmicroDRVEGRD169.prefab
+

Components

+

components

+

The Radar sensor simulation functionality is split into three components:

+
    +
  • Radar Sensor (script) - provides radar configuration and creates RGL pipeline to simulate radar.
  • +
  • Rgl Lidar Publisher (script) - extends RGL pipeline with nodes to publish ROS2 messages (see).
  • +
  • Point Cloud Visualization (script) - visualizes point cloud collected by sensor (see).
  • +
+

Radar Sensor (script)

+

radar_component.png

+

This is the component that creates the RGL node pipeline for the radar simulation. +The pipeline consists of:

+
    +
  • setting ray pattern,
  • +
  • transforming rays to represent pose of the sensor on the scene,
  • +
  • applying noise,
  • +
  • performing raytracing,
  • +
  • performs point cloud post-processing to achieve radar-like output
  • +
+

Elements configurable from the editor level

+
    +
  • Automatic Capture Hz - the rate of sensor processing
  • +
  • Model Preset - allows selecting one of the built-in radar models
  • +
  • Configuration:
      +
    • Min Azimuth Angle - minimum azimuth angle (in degrees)
    • +
    • Max Azimuth Angle - maximum azimuth angle (in degrees)
    • +
    • Min Elevation Angle - minimum elevation angle (in degrees)
    • +
    • Max Elevation Angle - maximum elevation angle (in degrees)
    • +
    • Frequency - frequency of the wave propagation by the radar (in GHz)
    • +
    • Power Transmitted - power transmitted by the radar (in dBm)
    • +
    • Cumulative Device Gain - gain of the radar's antennas and any other gains of the device (in dBi)
    • +
    • Received Noise Mean - mean of the received noise (in dB)
    • +
    • Received Noise St Dev - standard deviation of the received noise (in dB)
    • +
    • Scope Parameters - radar ability to separate (distinguish) different detections varies with the distance (e.g. by employing multiple frequency bands). Scope parameters allow to configure separation thresholds for different distance ranges (scopes):
        +
      • Begin Distance - begin of the distance interval where the following parameters are used (in meters)
      • +
      • End Distance - end of the distance interval where the following parameters are used (in meters)
      • +
      • Distance Separation Threshold - minimum distance between two points to be considered as separate detections (in meters)
      • +
      • Radial Speed Seperation Threshold - minimum radial speed difference between two points to be considered as separate detections (in meters per seconds)
      • +
      • Azimuth Separation Threshold - minimum azimuth difference between two points to be considered as separate detections (in degrees)
      • +
      +
    • +
    +
  • +
+

Output Data

+

RadarSensor provides public methods to extend this pipeline with additional RGL nodes. +In this way, other components can request point cloud processing operations and receive data in the desired format.

+

Example of how to get XYZ point cloud data:

+
    +
  1. To obtain point cloud data from another component you have to create a new RGLNodeSequence with RGL node to yield XYZ field and connect it to RadarSensor: +
    rglOutSubgraph = new RGLNodeSequence().AddNodePointsYield("OUT_XYZ", RGLField.XYZ_F32);
    +radarSensor = GetComponent<RadarSensor>();
    +radarSensor.ConnectToWorldFrame(rglOutSubgraph); // you can also connect to radar frame using ConnectToRadarFrame
    +// You can add a callback to receive a notification when new data is ready
    +radarSensor.onNewData += HandleRadarDataMethod;
    +
  2. +
  3. To get data from RGLNodeSequence call GetResultData: +
    Vector3[] xyz = new Vector3[0];
    +rglOutSubgraph.GetResultData<Vector3>(ref xyz);
    +
  4. +
+

ROS 2 topic content

+

RadarSensor uses RglLidarPublisher for publishing two types of ROS 2 messages:

+ +

The content of these messages is presented in the table below.

+ + + + + + + + + + + + + + + + + + + + +
Message typeData which the message hasComment
PointCloud2Position
Radial speed
Power
RCS
Noise
SNR
Calculated in Radar node from RGL
RadarScanRange
Azimuth
Elevation
Radial speed
Amplitude
Calculated in Radar node from RGL
+

Example

+

On the screenshot below (scene RadarSceneDevelopSample) radar detections are shown as blue boxes.

+

RadarTestScene.png

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Sensors/RadarSensor/prefab_smartmicroDRVEGRD169.png b/Components/Sensors/RadarSensor/prefab_smartmicroDRVEGRD169.png new file mode 100644 index 0000000000..ea4ee9feba Binary files /dev/null and b/Components/Sensors/RadarSensor/prefab_smartmicroDRVEGRD169.png differ diff --git a/Components/Sensors/RadarSensor/radar_component.png b/Components/Sensors/RadarSensor/radar_component.png new file mode 100644 index 0000000000..2385107f49 Binary files /dev/null and b/Components/Sensors/RadarSensor/radar_component.png differ diff --git a/Components/Sensors/RadarSensor/radar_test_scene.png b/Components/Sensors/RadarSensor/radar_test_scene.png new file mode 100644 index 0000000000..89d75be91d Binary files /dev/null and b/Components/Sensors/RadarSensor/radar_test_scene.png differ diff --git a/Components/Sensors/VehicleStatusSensor/components.png b/Components/Sensors/VehicleStatusSensor/components.png new file mode 100644 index 0000000000..f4651bc11f Binary files /dev/null and b/Components/Sensors/VehicleStatusSensor/components.png differ diff --git a/Components/Sensors/VehicleStatusSensor/index.html b/Components/Sensors/VehicleStatusSensor/index.html new file mode 100644 index 0000000000..3fa44bcf7a --- /dev/null +++ b/Components/Sensors/VehicleStatusSensor/index.html @@ -0,0 +1,2713 @@ + + + + + + + + + + + + + + + + + + + + + + + Vehicle Status Sensor - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+ +
+
+ + + +
+
+ + + + + + + +

VehicleStatusSensor

+

Introduction

+

VehicleStatusSensor is a component that is designed to aggregate information about the current state of the vehicle. +It aggregates information about:

+
    +
  • Control mode - currently active control mode, e.g. AUTONOMOUS or MANUAL.
  • +
  • Gear status - currently engaged gearbox gear, e.g. DRIVE or REVERSE.
  • +
  • Steering status - current angle of the steering tire in radians left, e.g. 0.1745 (10°).
  • +
  • Turn indicators status - current status of the direction indicators, e.g. DISABLE or ENABLE_LEFT.
  • +
  • Hazard lights status - current status of the hazard lights, e.g. DISABLE or ENABLE.
  • +
  • Velocity status - current lateral, longitudinal and heading velocities values, e.g {0.2, 0.0, 0.0}.
  • +
+

Prefab

+

Prefab can be found under the following path:

+
Assets/AWSIM/Prefabs/Sensors/VehicleStatusSensor.prefab
+
+ +

This sensor is added directly to the URDF link in the EgoVehicle prefab.

+

link

+

A detailed description of the URDF structure and sensors added to prefab Lexus RX450h 2015 is available in this section.

+

Components

+

components

+

All features are implemented within the Vehicle Report Ros2 Publisher (script) which can be found under the following path:

+
Assets/AWSIM/Prefabs/Sensors/*
+
+

Vehicle Report Ros2 Publisher (script)

+

script

+

The script is responsible for updating and publishing each of the aggregated data on a separate topic. +Therefore, it has 6 publishers publishing the appropriate type of message with a constant frequency - one common for all data.

+

Elements configurable from the editor level

+
    +
  • * Report Topic - topic on which suitable type of information is published
    (default: listed in the table below)
  • +
  • Publish Hz - frequency of publications on each topic
    (default: 30Hz)
  • +
  • Frame ID - frame in which data is published, used in Header
    (default: base_link)
  • +
  • QoS- Quality of service profile used in the publication
    (default assumed as "system_default": Reliable, Volatile, Keep last/1)
  • +
  • Vehicle - the object from which all published data are read
    (default: None)
  • +
+
+

Vehicle configuration

+

An important element of the script configuration that must be set is the scene Object (Vehicle). +It will be used for reading all the data needed. +The appropriate EgoVehicle object should be selected.

+

If you can't select the right object, make sure it's set up correctly - it has got added all the scripts needed for EgoVehicle.

+
+

Published topics

+
    +
  • Frequency: 30Hz
  • +
  • QoS: Reliable, Volatile, Keep last/1
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryTopicMessage typeframe_id
Control mode/vehicle/status/control_modeautoware_auto_vehicle_msgs/ControlModeReport-
Gear status/vehicle/status/gear_statusautoware_auto_vehicle_msgs/GearReport -
Steering status/vehicle/status/steering_statusautoware_auto_vehicle_msgs/SteeringReport-
Turn indicators status/vehicle/status/turn_indicators_statusautoware_auto_vehicle_msgs/TurnIndicatorsReport-
Hazard lights status/vehicle/status/hazard_lights_statusautoware_auto_vehicle_msgs/HazardLightsReport-
Velocity status/vehicle/status/velocity_statusautoware_auto_vehicle_msgs/VelocityReportbase_line
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Sensors/VehicleStatusSensor/link.png b/Components/Sensors/VehicleStatusSensor/link.png new file mode 100644 index 0000000000..2346b9cb22 Binary files /dev/null and b/Components/Sensors/VehicleStatusSensor/link.png differ diff --git a/Components/Sensors/VehicleStatusSensor/script.png b/Components/Sensors/VehicleStatusSensor/script.png new file mode 100644 index 0000000000..7d91474b3f Binary files /dev/null and b/Components/Sensors/VehicleStatusSensor/script.png differ diff --git a/Components/Traffic/NPCs/Pedestrian/animator.mp4 b/Components/Traffic/NPCs/Pedestrian/animator.mp4 new file mode 100644 index 0000000000..59b16766fa Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/animator.mp4 differ diff --git a/Components/Traffic/NPCs/Pedestrian/animator.png b/Components/Traffic/NPCs/Pedestrian/animator.png new file mode 100644 index 0000000000..087067e3f0 Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/animator.png differ diff --git a/Components/Traffic/NPCs/Pedestrian/animator_param.png b/Components/Traffic/NPCs/Pedestrian/animator_param.png new file mode 100644 index 0000000000..aa9d111c2e Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/animator_param.png differ diff --git a/Components/Traffic/NPCs/Pedestrian/collider.png b/Components/Traffic/NPCs/Pedestrian/collider.png new file mode 100644 index 0000000000..217f3dea9c Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/collider.png differ diff --git a/Components/Traffic/NPCs/Pedestrian/collider_example.png b/Components/Traffic/NPCs/Pedestrian/collider_example.png new file mode 100644 index 0000000000..ece3472e4d Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/collider_example.png differ diff --git a/Components/Traffic/NPCs/Pedestrian/index.html b/Components/Traffic/NPCs/Pedestrian/index.html new file mode 100644 index 0000000000..362b565f8e --- /dev/null +++ b/Components/Traffic/NPCs/Pedestrian/index.html @@ -0,0 +1,2850 @@ + + + + + + + + + + + + + + + + + + + + + + + Pedestrian - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Pedestrian

+ +

Introduction

+

NPCPedestrian is an object that simulates a human standing or moving on the scene. +It can move cyclically in any chosen place thanks to the available scripts. +Traffic light tracking will be implemented in the future.

+

+
+

Sample scene

+

If you would like to see how NPCPedestrian works or run some tests, we encourage you to familiarize yourself with the NPCPedestrianSample default scene described in this section.

+
+

Prefab and Fbx

+

Prefab can be found under the following path:

+
Assets/AWSIM/Prefabs/NPCs/Pedestrians/humanElegant.prefab
+
+

Visual elements

+

Prefab is developed using models available in the form of *.fbx file. +From this file, the visual elements of the model, Animator and LOD were loaded. +The Animator and LOD are added as components of the main-parent GameObject in prefab, while the visual elements of the model are added as its children.

+

*.fbx file can be found under the following path:

+
Assets/AWSIM/Models/NPCs/Pedestrians/Human/humanElegant.fbx
+
+

NPCPedestrian prefab has the following content:

+

+

The ReferencePoint is used by the NPC Pedestrian (script) described here.

+ +

+

Pedestrians implemented in the scene are usually added in one aggregating object - in this case it is NPCPedestrians. +This object is added to the Environment prefab.

+

Components

+

+

There are several components responsible for the full functionality of NPCPedestrian:

+
    +
  • Animator - provides motion animations in the scene, which are composed of clips controlled by the controller.
  • +
  • LOD Group - provides level of detail configuration for shaders - affects GPU usage.
  • +
  • Rigidbody - ensures that the object is controlled by the physics engine in Unity - e.g. pulled downward by gravity.
  • +
  • NPC Pedestrian (script) - ensures that the movement of the object is combined with animation.
  • +
  • Simple Pedestrian Walker Controller (script) - provides pedestrian movement in a specific direction and distance in a cyclical manner.
  • +
+

Scripts can be found under the following path:

+
Assets/AWSIM/Scripts/NPCs/Pedestrians/*
+
+

Rigidbody

+

rigidbody pedestrian

+

Rigidbody ensures that the object is controlled by the physics engine. +In order to connect the animation to the object, the Is Kinematic option must be enabled. +By setting Is Kinematic, each NPCPedestrian object will have no physical interaction with other objects - it will not react to a vehicle that hits it. +The Use Gravity should be turned off - the correct position of the pedestrian in relation to the ground is ensured by the NPC Pedestrian (script). +In addition, Interpolate should be turned on to ensure the physics engine's effects are smoothed out.

+

LOD (Level of Detail)

+

+

LOD provides dependence of the level of detail of the object depending on the ratio of the GameObject’s screen space height to the total screen height. +The pedestrian model has two object groups: suffixed LOD0 and LOD1. +LOD0 objects are much more detailed than LOD1 - they have many more vertices in the Meshes. +Displaying complex meshes requires more performance, so if the GameObject is a small part of the screen, less complex LOD1 objects are used.

+

In the case of the NPCPedestrian prefab, if its object is less than 25% of the height of the screen then objects with the LOD1 suffix are used. +For values less than 1% the object is culled.

+

Animator

+

+

Animator component provides animation assignments to a GameObject in the scene. +It uses a developed Controller which defines which animation clips to use and controls when and how to blend and transition between them.

+

The AnimationController for humans should have the two float parameters for proper transitions. +Transitions between animation clips are made depending on the values of these parameters:

+
    +
  • moveSpeed - pedestrian movement speed in \({m}/{s}\),
  • +
  • rotateSpeed - pedestrian rotation speed in \({rad}/{s}\).
  • +
+

Developed controller can be found in the following path:
+Assets/AWSIM/Models/NPCs/Pedestrians/Human/Human.controller

+

+
+

Walking to running transition

+

The example shows the state of walking and then transitions to running as a result of exceeding the condition \(\mathrm{moveSpeed} > 1.6\)

+

+
+

NPC Pedestrian (script)

+

+

The script takes the Rigidbody and Animator components and combines them in such a way that the actual animation depends on the movement of Rigidbody. +It provides an inputs that allows the pedestrian to move - change his position and orientation. +In addition, the ReferencePoint point is used to ensure that the pedestrian follows the ground plane correctly.

+

Elements configurable from the editor level

+
    +
  • Ray Cast Max Distance - ray-cast max distance for locating the ground.
  • +
  • Ray Cast Origin Offset - upward offset of the ray-cast origin from the GameObject local origin for locating the ground.
  • +
+

Input Data

+ + + + + + + + + + + + + + + + + + + + +
CategoryTypeDescription
SetPositionVector3Move the NPCPedestrian so that the reference point is at the specified coordinates.
SetRotationVector3Rotate the NPCPedestrian so that the orientation of the reference point becomes the specified one.
+

Simple Pedestrian Walker Controller (script)

+

+

Simple Pedestrian Walker Controller is a script that allows the pedestrian to cyclically move back and forth along a straight line. +One-way motion is performed with a fixed time as parameter Duration and a constant linear velocity as parameter Speed. +The script obviously uses the NPCPedestrian controls provided by the NPC Pedestrian (script) inputs.

+
+

Pedestrian walking on the sidewalk

+

+
+

Collider

+

+

Collider is an optional pedestrian component. +By default, NPCPedestrian doesn't have this component added, It can be added if you want to detect a collision, e.g. with an EgoVehicle. +There are several types of colliders, choose the right one and configure it for your own requirements.

+
+

Capsule Collider

+

An example of a CapsuleCollider that covers almost the entire pedestrian.

+

+
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Traffic/NPCs/Pedestrian/link.png b/Components/Traffic/NPCs/Pedestrian/link.png new file mode 100644 index 0000000000..934ed44441 Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/link.png differ diff --git a/Components/Traffic/NPCs/Pedestrian/lod.png b/Components/Traffic/NPCs/Pedestrian/lod.png new file mode 100644 index 0000000000..265b3be97f Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/lod.png differ diff --git a/Components/Traffic/NPCs/Pedestrian/model.png b/Components/Traffic/NPCs/Pedestrian/model.png new file mode 100644 index 0000000000..432fdaa5f6 Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/model.png differ diff --git a/Components/Traffic/NPCs/Pedestrian/prefab.png b/Components/Traffic/NPCs/Pedestrian/prefab.png new file mode 100644 index 0000000000..7e3d2ffb8e Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/prefab.png differ diff --git a/Components/Traffic/NPCs/Pedestrian/prefab_link.png b/Components/Traffic/NPCs/Pedestrian/prefab_link.png new file mode 100644 index 0000000000..56401bedea Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/prefab_link.png differ diff --git a/Components/Traffic/NPCs/Pedestrian/rigidbody.png b/Components/Traffic/NPCs/Pedestrian/rigidbody.png new file mode 100644 index 0000000000..6c86b92f22 Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/rigidbody.png differ diff --git a/Components/Traffic/NPCs/Pedestrian/script.png b/Components/Traffic/NPCs/Pedestrian/script.png new file mode 100644 index 0000000000..eedc522e78 Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/script.png differ diff --git a/Components/Traffic/NPCs/Pedestrian/simple_walk.png b/Components/Traffic/NPCs/Pedestrian/simple_walk.png new file mode 100644 index 0000000000..9346449e80 Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/simple_walk.png differ diff --git a/Components/Traffic/NPCs/Pedestrian/walk.mp4 b/Components/Traffic/NPCs/Pedestrian/walk.mp4 new file mode 100644 index 0000000000..f303abb6ff Binary files /dev/null and b/Components/Traffic/NPCs/Pedestrian/walk.mp4 differ diff --git a/Components/Traffic/NPCs/Vehicle/bounds_example.png b/Components/Traffic/NPCs/Vehicle/bounds_example.png new file mode 100644 index 0000000000..5cb45285ea Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/bounds_example.png differ diff --git a/Components/Traffic/NPCs/Vehicle/collider.png b/Components/Traffic/NPCs/Vehicle/collider.png new file mode 100644 index 0000000000..e80640677c Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/collider.png differ diff --git a/Components/Traffic/NPCs/Vehicle/collider_example.png b/Components/Traffic/NPCs/Vehicle/collider_example.png new file mode 100644 index 0000000000..1ab0e6f510 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/collider_example.png differ diff --git a/Components/Traffic/NPCs/Vehicle/com.png b/Components/Traffic/NPCs/Vehicle/com.png new file mode 100644 index 0000000000..f79ba02547 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/com.png differ diff --git a/Components/Traffic/NPCs/Vehicle/com_2.png b/Components/Traffic/NPCs/Vehicle/com_2.png new file mode 100644 index 0000000000..7dca64e778 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/com_2.png differ diff --git a/Components/Traffic/NPCs/Vehicle/driver.png b/Components/Traffic/NPCs/Vehicle/driver.png new file mode 100644 index 0000000000..abb1e545d1 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/driver.png differ diff --git a/Components/Traffic/NPCs/Vehicle/fbx.png b/Components/Traffic/NPCs/Vehicle/fbx.png new file mode 100644 index 0000000000..fa004393a7 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/fbx.png differ diff --git a/Components/Traffic/NPCs/Vehicle/gizmo.png b/Components/Traffic/NPCs/Vehicle/gizmo.png new file mode 100644 index 0000000000..d4b63b7ab5 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/gizmo.png differ diff --git a/Components/Traffic/NPCs/Vehicle/image_0.png b/Components/Traffic/NPCs/Vehicle/image_0.png new file mode 100644 index 0000000000..b016d9635f Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/image_0.png differ diff --git a/Components/Traffic/NPCs/Vehicle/image_1.png b/Components/Traffic/NPCs/Vehicle/image_1.png new file mode 100644 index 0000000000..552a229ff9 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/image_1.png differ diff --git a/Components/Traffic/NPCs/Vehicle/image_2.png b/Components/Traffic/NPCs/Vehicle/image_2.png new file mode 100644 index 0000000000..b6a5e3f010 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/image_2.png differ diff --git a/Components/Traffic/NPCs/Vehicle/image_3.png b/Components/Traffic/NPCs/Vehicle/image_3.png new file mode 100644 index 0000000000..66dd205db9 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/image_3.png differ diff --git a/Components/Traffic/NPCs/Vehicle/image_4.png b/Components/Traffic/NPCs/Vehicle/image_4.png new file mode 100644 index 0000000000..f739ead68b Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/image_4.png differ diff --git a/Components/Traffic/NPCs/Vehicle/image_5.png b/Components/Traffic/NPCs/Vehicle/image_5.png new file mode 100644 index 0000000000..dc9bdee696 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/image_5.png differ diff --git a/Components/Traffic/NPCs/Vehicle/index.html b/Components/Traffic/NPCs/Vehicle/index.html new file mode 100644 index 0000000000..f1aedec784 --- /dev/null +++ b/Components/Traffic/NPCs/Vehicle/index.html @@ -0,0 +1,2961 @@ + + + + + + + + + + + + + + + + + + + + + + + Vehicle - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

NPCVehicle

+

Introduction

+

NPCVehicle is a non-playable object that simulates a vehicle that is stationary or moving around the scene. +It can move on roads, more specifically TrafficLanes, thanks to the use of TrafficSimulator - which you can read more about here. +Vehicles moving on the scene take into account each other - avoiding collisions, follow traffic lights and have an implemented mechanism of yielding the right of way.

+

vehicles

+
+

Sample scene

+

If you would like to see how NPCVehicle works or run some tests, we encourage you to familiarize yourself with the NPCVehicleSample default scene described in this section.

+
+
+

Ego Vehicle

+

If you are interested in the most important vehicle on the scene - Ego Vehicle, we encourage you to read this section.

+
+

Prefabs and Fbxs

+

Prefabs can be found under the following path:

+
Assets/AWSIM/Prefabs/NPCs/Vehicles/*
+
+

The table shows the available prefabs of the vehicles:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HatchbackSmallCarTaxiTruckVan
Appearancevehiclesvehiclesvehiclesvehiclesvehicles
PrefabHatchback.prefabSmallCar.prefabTaxi-64.prefabTruck_2t.prefabVan.prefab
+

NPCVehicle prefab has the following content:

+

prefab_link

+

As you can see, it consists of 2 parents for GameObjects: Visuals - aggregating visual elements, Colliders - aggregating colliders and single object CoM. + All objects are described in the sections below.

+

Visual elements

+

Prefabs are developed using models available in the form of *.fbx files. +For each vehicle, the visuals elements and LOD were loaded from the appropriate *.fbx file. +The LOD is always added as components of the main-parent GameObject in prefab, while the visual elements of the model are aggregated and added in object Visuals.

+

*.fbx file for each vehicle is located in the appropriate Models directory for the vehicle under the following path:

+
Assets/AWSIM/Models/NPCs/Vehicles/<vehicle_name>/Models/<vehicle_name>.fbx
+
+

As you can see, the additional visual element is Driver.

+

driver

+

It was also loaded from the *.fbx file which can be found under the following path:

+
Assets/AWSIM/Models/NPCs/Vehicles/Driver/Model/Driver.fbx
+
+
+

Vehicle fbx

+

The content of a sample *.fbx file is presented below, all elements except Collider have been added to the prefab as visual elements of the vehicle. +Collider is used as the Mesh source for the Mesh Collider in the BodyCollider object.

+

fbx.

+
+ +

The default scene does not have vehicles implemented in fixed places, but they are spawned by RandomTrafficSimulator which is located in the Environment prefab. +Therefore, before starting the simulation, no NPCVehicle object is on the scene.

+

When you run the simulation, you can see objects appearing as children of RandomTrafficSimulator:

+

traffic_link

+

In each NPCVehicle prefab, the local coordinate system of the vehicle (main prefab link) should be defined in the axis of the rear wheels projected onto the ground - in the middle of the distance between them. +This aspect holds significance when characterizing the dynamics of the object, as it provides convenience in terms of describing its motion and control.

+

+

Components

+

prefab

+

There are several components responsible for the full functionality of NPCVehicle:

+
    +
  • LOD Group - provides level of detail configuration for shaders - affects GPU usage.
  • +
  • Rigidbody - ensures that the object is controlled by the physics engine in Unity - e.g. pulled downward by gravity.
  • +
  • NPC Vehicle (script) - provides the ability to change the position and orientation of the vehicle, as well as to control the turn signals and brake light.
  • +
+

Script can be found under the following path:

+
Assets/AWSIM/Scripts/NPCs/Vehicles
+
+

CoM

+

CoM (Center of Mass) is an additional link that is defined to set the center of mass in the Rigidbody. +The NPC Vehicle (script) is responsible for its assignment. +This measure should be defined in accordance with reality. +Most often, the center of mass of the vehicle is located in its center, at the height of its wheel axis - as shown below.

+

+

Colliders

+

Colliders are used to ensure collision between objects. +In NPCVehicle, the main BodyCollider collider and Wheels Colliders colliders for each wheel were added.

+

Body Collider

+

collider

+

BodyCollider is a vehicle Object responsible for ensuring collision with other objects. +Additionally it can be used to detect these collisions. +The MeshCollider uses a Mesh of an Object to build its Collider. +The Mesh for the BodyCollider was also loaded from the *.fbx file similarly to the visual elements.

+

collider_example

+

Wheels Colliders

+

wheel_collider

+

WheelsColliders are an essential element from the point of view of driving vehicles on the road. +They are the only ones that have contact with the roads and it is important that they are properly configured. +Each vehicle, apart from the visual elements related to the wheels, should also have 4 colliders - one for each wheel.

+

To prevent inspector entry for WheelCollider the WheelColliderConfig has been developed. +It ensures that friction is set to 0 and only wheel suspension and collisions are enabled.

+ + +

wheel_collider_example

+
+

Wheel Collider Config

+

For a better understanding of the meaning of WheelCollider we encourage you to read this manual.

+
+

LOD

+

lod

+

LOD provides dependence of the level of detail of the object depending on the ratio of the GameObject’s screen space height to the total screen height. +Vehicle models have only one LOD0 group, therefore there is no reduction in model complexity when it does not occupy a large part of the screen. +It is only culled when it occupies less than 2% of the height.

+

Rigidbody

+

rigidbody

+

Rigidbody ensures that the object is controlled by the physics engine. +The Mass of the vehicle should approximate its actual weight. +In order for the vehicle to physically interact with other objects - react to collisions, Is Kinematic must be turned off. +The Use Gravity should be turned on - to ensure the correct behavior of the body during movement. +In addition, Interpolate should be turned on to ensure the physics engine's effects are smoothed out.

+

NPC Vehicle (script)

+

script

+

The script takes the Rigidbody and provides an inputs that allows the NPCVehicle to move. +Script inputs give the ability to set the position and orientation of the vehicle, taking into account the effects of suspension and gravity. +In addition, the script uses the CoM link reference to assign the center of mass of the vehicle to the Rigidbody.

+

Script inputs are used by RandomTrafficSimulator, which controls the vehicles on the scene - it is described here.

+

Input Data

+ + + + + + + + + + + + + + + + + + + + +
CategoryTypeDescription
SetPositionVector3Move the NPCVehicle so that its x, z coordinates are same as the specified coordinates. Pitch and roll are determined by physical operations that take effects of suspension and gravity into account.
SetRotationVector3Rotate the NPCVehicle so that its yaw becomes equal to the specified one. Vertical movement is determined by physical operations that take effects of suspension and gravity into account.
+

Visual Object Root is a reference to the parent aggregating visuals, it can be used to disable the appearance of visual elements of the NPCVehicle in the scene.

+

Whereas Bounds Represents an axis aligned bounding box of the NPCVehicle. +It is used primarily to detect collisions between vehicles in the event of spawning, yielding and others. +Moreover, vehicle bounds are displayed by Gizmos.

+

+

The settings of the remaining elements, i.e. the Axle and the Lights, are described here and here.

+
+

No Gizmo visualization

+

If you don't see Gizmo's visual elements, remember to turn them on.

+

gizmo

+
+

Axle Settings

+

script_axle

+

This part of the settings is responsible for the proper connection of visual elements with the collider for each wheel - described earlier. +The objects configured in this section are used to control the vehicle - its wheel speed and steering angle, which are calculated based on the input values. +Correct configuration is very important from the point of view of the NPCVehicle movement on the road.

+

Lights Settings

+

script_axle

+

This part of the settings is related to the configuration of materials emission - used when a specific lighting is activated. +There are 3 types of lights: Brake, Left Turn Signal and Right Turn Signal. +Each of the lights has its visual equivalent in the form of a Mesh. +In the case of NPCVehicle all of the lights are included in the Body object Mesh, which has many materials - including those related to lights.

+

For each type of light, the appropriate Material Index (equivalent of element index in mesh) and Lighting Color are assigned - yellow for Turn Signals, red for Break.

+

Lighting Intensity values are also configured - the greater the value, the more light will be emitted. +This value is related to Lighting Exposure Weight parameter that is an exposure weight - the lower the value, the more light is emitted.

+

The brake light is switched on depending on the speed of the NPCVehicle, while RandomTrafficSimulator is responsible for switching the turn signals on and off.

+

materials

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Traffic/NPCs/Vehicle/link.png b/Components/Traffic/NPCs/Vehicle/link.png new file mode 100644 index 0000000000..ddf55180f5 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/link.png differ diff --git a/Components/Traffic/NPCs/Vehicle/link_2.png b/Components/Traffic/NPCs/Vehicle/link_2.png new file mode 100644 index 0000000000..e328c3f958 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/link_2.png differ diff --git a/Components/Traffic/NPCs/Vehicle/lod.png b/Components/Traffic/NPCs/Vehicle/lod.png new file mode 100644 index 0000000000..2cb7f2c52d Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/lod.png differ diff --git a/Components/Traffic/NPCs/Vehicle/materials.png b/Components/Traffic/NPCs/Vehicle/materials.png new file mode 100644 index 0000000000..94b60a9053 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/materials.png differ diff --git a/Components/Traffic/NPCs/Vehicle/prefab.png b/Components/Traffic/NPCs/Vehicle/prefab.png new file mode 100644 index 0000000000..ef22ebe0c2 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/prefab.png differ diff --git a/Components/Traffic/NPCs/Vehicle/prefab_link.png b/Components/Traffic/NPCs/Vehicle/prefab_link.png new file mode 100644 index 0000000000..fee3f44019 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/prefab_link.png differ diff --git a/Components/Traffic/NPCs/Vehicle/rigidbody.png b/Components/Traffic/NPCs/Vehicle/rigidbody.png new file mode 100644 index 0000000000..48c9c2d938 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/rigidbody.png differ diff --git a/Components/Traffic/NPCs/Vehicle/script.png b/Components/Traffic/NPCs/Vehicle/script.png new file mode 100644 index 0000000000..f1d990ee47 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/script.png differ diff --git a/Components/Traffic/NPCs/Vehicle/script_axle.png b/Components/Traffic/NPCs/Vehicle/script_axle.png new file mode 100644 index 0000000000..b282ece911 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/script_axle.png differ diff --git a/Components/Traffic/NPCs/Vehicle/script_lights.png b/Components/Traffic/NPCs/Vehicle/script_lights.png new file mode 100644 index 0000000000..323e3ca19f Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/script_lights.png differ diff --git a/Components/Traffic/NPCs/Vehicle/traffic_link.png b/Components/Traffic/NPCs/Vehicle/traffic_link.png new file mode 100644 index 0000000000..1b6d2d1674 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/traffic_link.png differ diff --git a/Components/Traffic/NPCs/Vehicle/vehicles.png b/Components/Traffic/NPCs/Vehicle/vehicles.png new file mode 100644 index 0000000000..982fd8e983 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/vehicles.png differ diff --git a/Components/Traffic/NPCs/Vehicle/wheel_collider.png b/Components/Traffic/NPCs/Vehicle/wheel_collider.png new file mode 100644 index 0000000000..67ed829cac Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/wheel_collider.png differ diff --git a/Components/Traffic/NPCs/Vehicle/wheel_collider_example.png b/Components/Traffic/NPCs/Vehicle/wheel_collider_example.png new file mode 100644 index 0000000000..ad83fe1df0 Binary files /dev/null and b/Components/Traffic/NPCs/Vehicle/wheel_collider_example.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/environment_components.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/environment_components.png new file mode 100644 index 0000000000..f0bba5159f Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/environment_components.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/index.html b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/index.html new file mode 100644 index 0000000000..8528d5b511 --- /dev/null +++ b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/index.html @@ -0,0 +1,2680 @@ + + + + + + + + + + + + + + + + + + + + + + + Add Random Traffic Environment - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Add Environment for Random Traffic

+

This document describes the steps to properly configuer RandomTrafficSimulator in your environment.

+

Map preparation

+

The 3D map model should be added to the scene. Please make sure that the Environment component with appropriate mgrsOffsetPosition is attached to the root GameObject. +

+

Annotate Traffic Lights

+

Please attach TrafficLight component to all traffic light GameObjects placed on scene. +

+

Load Lanelet

+

The lanelet load process can be performed by opening AWSIM -> Random Traffic -> Load Lanelet at the top toolbar of Unity Editor. +

+

You should be prompted with a similar window to the one presented below. Please adjust the parameters for the loading process if needed.

+

+

Waypoint settings affect the density and accuracy of the generated waypoints. The parameters are described below:

+
    +
  • Resolution: resolution of resampling. Lower values provide better accuracy at the cost of processing time.
  • +
  • Min Delta Length: minimum length(m) between adjacent points.
  • +
  • Min Delta Angle: minimum angle(deg) between adjacent edges. Lowering this value produces a smoother curve.
  • +
+

To generate the Lanelet2 map representation in your simulation, please click the Load button. Environment components should be generated and placed as child objects of the Environment GameObject. You can check their visual representation by clicking consecutive elements in the scene hierarchy.

+

+

Annotate Traffic Intersections

+

+

To annotate intersection please, add an empty GameObject named TrafficIntersections at the same level as the TrafficLanes GameObject.

+

For each intersection repeat the following steps:

+
    +
  1. Add an GameObject named TrafficIntersection as a child object of the TrafficIntersections object.
  2. +
  3. Attach a TrafficIntersection component to it.
  4. +
  5. Add a BoxCollider as a component of GameObject. It's size and position should cover the whole intersection. This is used for detecting vehicles in the intersection.
  6. +
  7. Set TrafficLightGroups. Each group is controlled to have different signals, so facing traffic lights should be added to the same group. These groupings are used in traffic signal control.
  8. +
  9. Specify the signal control pattern.
  10. +
+

Annotate right of ways on uncontrolled intersections

+

For the vehicles to operate properly it is needed to annotate the right of way of TrafficLane manually on intersections without traffic lights.

+

+

To set the right of way, please:

+
    +
  • Select a straight lane that is not right of way in the intersection. The selected lane should be highlighted as presented below.
  • +
  • Click the Set RightOfWays button to give the lane priority over other lanes. +
  • +
  • Please check if all lanes that intersect with the selected lane are highlighted yellow. This means that the right of way was applied correctly. +
  • +
+

Annotate stop lines

+

For each right turn lane that yields to the opposite straight or left turn lane, a stop line needs to be defined near the center of the intersection. + +If there is no visible stop line, a StopLine component should be added to the scene, near the center of the intersection and associated with TrafficLane.

+

Assign Intersection TrafficLanes

+

To make the yielding rules work properly, it is necessary to catagorize the TrafficLanes. +The ones that belong to an intersection have the IntersectionLane variable set to true.

+

To automate the assignment of the corresponding IntersectionLane to each TrafficLane, the script AssignIntersectionTrafficLanes can be used. +

+
    +
  1. At the time of assignment, add it as a component to some object in the scene (e.g. to the Environment object).
  2. +
  3. Disable the component (uncheck the checkbox next to the script name).
  4. +
  5. Assign to TrafficLanesObjectsParent GameObject, which contains all TrafficLanes objects.
  6. +
  7. Check all 4 options.
  8. +
  9. Enable the component (check the checkbox next to the script name).
  10. +
+

Check the log to see if all operations were completed: +

+

As a result, the names of TrafficLane objects should have prefixes with sequential numbers and TrafficLane at intersections should be marked. TrafficLanes with IntersectionLane set to True are displayed by Gizmos in green color, if IntersectionLane is False their color is white. +
+

+

Check final configuration

+

Once all the components are ready, the simulation can be run. +Check carefully if the vehicles are moving around the map correctly. +For each intersection, review the settings of the relevant components if vehicles are unable to proceed.

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/intersectionlane.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/intersectionlane.png new file mode 100644 index 0000000000..9c8b65d980 Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/intersectionlane.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/intersectionlane_script.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/intersectionlane_script.png new file mode 100644 index 0000000000..195c65ea54 Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/intersectionlane_script.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/lanelet_loader_window.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/lanelet_loader_window.png new file mode 100644 index 0000000000..0224deda3a Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/lanelet_loader_window.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/load_lanelet.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/load_lanelet.png new file mode 100644 index 0000000000..163b90affb Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/load_lanelet.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/load_lanelet_menu.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/load_lanelet_menu.png new file mode 100644 index 0000000000..755f361e1b Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/load_lanelet_menu.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/log.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/log.png new file mode 100644 index 0000000000..74a0fd6486 Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/log.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/map.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/map.png new file mode 100644 index 0000000000..aee44754df Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/map.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/names.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/names.png new file mode 100644 index 0000000000..e933743e6d Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/names.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/right_of_ways.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/right_of_ways.png new file mode 100644 index 0000000000..83ddf658c1 Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/right_of_ways.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/select_traffic_light.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/select_traffic_light.png new file mode 100644 index 0000000000..a58d70fe5e Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/select_traffic_light.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/set_right_of_way.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/set_right_of_way.png new file mode 100644 index 0000000000..1226bdaa26 Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/set_right_of_way.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/stop_lines.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/stop_lines.png new file mode 100644 index 0000000000..78406360e0 Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/stop_lines.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/traffic_intersection.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/traffic_intersection.png new file mode 100644 index 0000000000..15ee42b77c Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/traffic_intersection.png differ diff --git a/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/traffic_light.png b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/traffic_light.png new file mode 100644 index 0000000000..144e33644b Binary files /dev/null and b/Components/Traffic/RandomTraffic/AddRandomTrafficEnvironment/traffic_light.png differ diff --git a/Components/Traffic/RandomTraffic/RandomTrafficSimulator/gizmos.png b/Components/Traffic/RandomTraffic/RandomTrafficSimulator/gizmos.png new file mode 100644 index 0000000000..26fa4e5edc Binary files /dev/null and b/Components/Traffic/RandomTraffic/RandomTrafficSimulator/gizmos.png differ diff --git a/Components/Traffic/RandomTraffic/RandomTrafficSimulator/index.html b/Components/Traffic/RandomTraffic/RandomTrafficSimulator/index.html new file mode 100644 index 0000000000..10af22b721 --- /dev/null +++ b/Components/Traffic/RandomTraffic/RandomTrafficSimulator/index.html @@ -0,0 +1,2660 @@ + + + + + + + + + + + + + + + + + + + + + + + Random Traffic Simulator - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Random Traffic Simulator

+

The RandomTrafficSimulator simulates city traffic with respect to all traffic rules. The system allows for random selection of car models and the paths they follow. It also allows adding static vehicles in the simulation.

+

random_traffic

+

Getting Started

+

Overview

+

The random traffic system consists of the following components:

+
    +
  • RandomTrafficSimulator: manages lifecycle of NPCs and simulates NPC behaviours.
  • +
  • TrafficLane, TrafficIntersection and StopLine: represent traffic entities
  • +
  • NPCVehicle: vehicle models (NPCs) controlled by RandomTrafficSimulator
  • +
+

+

Components Settings

+

The following section describes Unity Editor components settings.

+

Random Traffic Simulator

+

inspector

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
General Settings
SeedSeed value for random generator
Ego VehicleTransform of ego vehicle
Vehicle Layer MaskLayerMask that masks only vehicle(NPC and ego) colliders
Ground Layer MaskLayerMask that masks only ground colliders of the map
NPC Vehicle Settings
Max Vehicle CountMaximum number of NPC vehicles to be spawned in simulation
NPC PrefabsPrefabs representing controlled vehicles.
They must have NPCVehicle component attached.
Spawnable LanesTrafficLane components where NPC vehicles can be spawned during traffic simulation
Vehicle ConfigParameters for NPC vehicle control
Sudden Deceleration is a deceleration related to emergency braking
Debug
Show GizmosEnable the checkbox to show editor gizmos that visualize behaviours of NPCs
+

Gizmos

+

Gizmos are useful for checking current behavior of NPCs and its causes. +Gizmos have a high computational load so please disable them if the simulation is laggy. +gizmos

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Traffic/RandomTraffic/RandomTrafficSimulator/inspector.png b/Components/Traffic/RandomTraffic/RandomTrafficSimulator/inspector.png new file mode 100644 index 0000000000..8a523f7e77 Binary files /dev/null and b/Components/Traffic/RandomTraffic/RandomTrafficSimulator/inspector.png differ diff --git a/Components/Traffic/RandomTraffic/RandomTrafficSimulator/overview.png b/Components/Traffic/RandomTraffic/RandomTrafficSimulator/overview.png new file mode 100644 index 0000000000..6cca06714f Binary files /dev/null and b/Components/Traffic/RandomTraffic/RandomTrafficSimulator/overview.png differ diff --git a/Components/Traffic/RandomTraffic/RandomTrafficSimulator/play.png b/Components/Traffic/RandomTraffic/RandomTrafficSimulator/play.png new file mode 100644 index 0000000000..6758b30387 Binary files /dev/null and b/Components/Traffic/RandomTraffic/RandomTrafficSimulator/play.png differ diff --git a/Components/Traffic/RandomTraffic/RandomTrafficSimulator/random_traffic.png b/Components/Traffic/RandomTraffic/RandomTrafficSimulator/random_traffic.png new file mode 100644 index 0000000000..e459a4a3da Binary files /dev/null and b/Components/Traffic/RandomTraffic/RandomTrafficSimulator/random_traffic.png differ diff --git a/Components/Traffic/RandomTraffic/YieldingRules/INTERSECTION_BLOCKED.png b/Components/Traffic/RandomTraffic/YieldingRules/INTERSECTION_BLOCKED.png new file mode 100644 index 0000000000..c91b718873 Binary files /dev/null and b/Components/Traffic/RandomTraffic/YieldingRules/INTERSECTION_BLOCKED.png differ diff --git a/Components/Traffic/RandomTraffic/YieldingRules/LANES_RULES_AT_INTERSECTION.png b/Components/Traffic/RandomTraffic/YieldingRules/LANES_RULES_AT_INTERSECTION.png new file mode 100644 index 0000000000..e87a1cd395 Binary files /dev/null and b/Components/Traffic/RandomTraffic/YieldingRules/LANES_RULES_AT_INTERSECTION.png differ diff --git a/Components/Traffic/RandomTraffic/YieldingRules/LANES_RULES_ENTERING_INTERSECTION.png b/Components/Traffic/RandomTraffic/YieldingRules/LANES_RULES_ENTERING_INTERSECTION.png new file mode 100644 index 0000000000..e87a1cd395 Binary files /dev/null and b/Components/Traffic/RandomTraffic/YieldingRules/LANES_RULES_ENTERING_INTERSECTION.png differ diff --git a/Components/Traffic/RandomTraffic/YieldingRules/LEFT_HAND_RULE_AT_INTERSECTION.png b/Components/Traffic/RandomTraffic/YieldingRules/LEFT_HAND_RULE_AT_INTERSECTION.png new file mode 100644 index 0000000000..9b2d51acad Binary files /dev/null and b/Components/Traffic/RandomTraffic/YieldingRules/LEFT_HAND_RULE_AT_INTERSECTION.png differ diff --git a/Components/Traffic/RandomTraffic/YieldingRules/LEFT_HAND_RULE_ENTERING_INTERSECTION.png b/Components/Traffic/RandomTraffic/YieldingRules/LEFT_HAND_RULE_ENTERING_INTERSECTION.png new file mode 100644 index 0000000000..8d1c1f0c6d Binary files /dev/null and b/Components/Traffic/RandomTraffic/YieldingRules/LEFT_HAND_RULE_ENTERING_INTERSECTION.png differ diff --git a/Components/Traffic/RandomTraffic/YieldingRules/index.html b/Components/Traffic/RandomTraffic/YieldingRules/index.html new file mode 100644 index 0000000000..8a492dd622 --- /dev/null +++ b/Components/Traffic/RandomTraffic/YieldingRules/index.html @@ -0,0 +1,2542 @@ + + + + + + + + + + + + + + + + + + + + + + + Yielding Rules - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Yielding rules

+

The RandomTrafficSimulator assumes that there are 10 phases of yielding priority:

+
+

RandomTrafficYielding scene

+

If you would like to see how RandomTrafficSimulator with yielding rules works or run some tests, we encourage you to familiarize yourself with the RandomTrafficYielding scene described in this section.

+
+
    +
  1. +

    NONE - state in which it is only checked if a vehicle is approaching the intersection. If yes, a transition to state ENTERING_INTERSECTION is made.

    +
  2. +
  3. +

    ENTERING_INTERSECTION - state in which it is checked if any of the situations LANES_RULES_ENTERING_INTERSECTION, LEFT_HAND_RULE_ENTERING_INTERSECTION, INTERSECTION_BLOCKED occur, if yes the state of the vehicle is changed to one matching the situation - to determine if the vehicle must yield priority. If none of these situations occur only the entry into the intersection will result in a transition to AT_INTERSECTION.

    +
  4. +
  5. +

    AT_INTERSECTION - state in which it is checked if any of the situations LANES_RULES_AT_INTERSECTION, LEFT_HAND_RULE_AT_INTERSECTION, FORCING_PRIORITY occur, if yes the state of the vehicle is changed to one matching the situation - to determine if the vehicle must yield priority. If none of these situations occur only leaving the intersection will result in a transition to NONE.

    +
  6. +
  7. +

    INTERSECTION_BLOCKED - when vehicle A is approaching the intersection, it yields priority to vehicle B, which should yield priority, but is forcing it - this refers to a situation in which vehicle B has entered the intersection and has already passed its stop point vehicle B isn’t going to stop but has to leave the intersection. Until now, vehicle A has continued to pass through the intersection without taking vehicle B into account, now it is checking if any vehicle is forcing priority (vehicle A has INTERSECTION_BLOCKED state). +
    (vehicle A is red car with blue sphere, B is the white car to which it points) +image

    +
  8. +
  9. +

    LEFT_HAND_RULE_ENTERING_INTERSECTION - vehicle A, before entering the intersection where the traffic lights are off, yields priority to vehicles (ex. B) that are approaching to the intersection and are on the left side of vehicle A. +Until now, situations in which the lights are off were not handled. If a vehicle didn't have a red light and was going straight - it just entered the intersection. Now vehicle A checks if the vehicles on the left (ex. B) have a red light, if not it yields them priority. +
    (vehicle A is truck car with gray sphere, B is the white car to which it points) +image

    +
  10. +
  11. +

    LEFT_HAND_RULE_AT_INTERSECTION - when vehicle A is already at the intersection, yields priority to vehicles (ex. B) that are also at the intersection and are on its left side - in cases where no other yielding rules are resolved between them (i.e. there are no RightOfWayLanes between them). +
    (vehicle A is red, B is white) +image

    +
  12. +
  13. +

    LANES_RULES_ENTERING_INTERSECTION - when vehicle B intends to turn left and is approaching at the intersection where it needs to yield to vehicle A which is going straight ahead, then it goes to state LANES_RULES_ENTERING_INTERSECTION. The introduced changes take into account that a vehicle approaching the intersection considers not only the vehicles at the intersection but also those which are approaching it (at a distance of less than minimumDistanceToIntersection to the intersection). +
    (vehicle B is truck with yellow sphere, A the white car to which it points) +image

    +
  14. +
  15. +

    LANES_RULES_AT_INTERSECTION - when vehicle B intends to turn right and is already at the intersection where it needs to yield to vehicle A which is approaching the intersection, then it goes to state LANES_RULES_AT_INTERSECTION. The introduced changes take into account that a vehicle approaching the intersection considers not only the vehicles at the intersection but also those which are approaching it (at a distance of less than minimumDistanceToIntersection to the intersection). +(vehicle B is car with red sphere, A the white car to which it points) +image

    +
  16. +
  17. +

    FORCING_PRIORITY - state in which some vehicle B should yield priority to a vehicle A but doesn't - for some reason, most likely it could be some unusual situation in which all other rules have failed. Then vehicle A which is at intersection yields priority to a vehicle that is forcing priority. In such a situation, vehicle A transitions to state FORCING_PRIORITY. It is very rare to achieve this state, but it does happen.

    +
  18. +
+

Gizmos Markings

+
    +
  • No sphere means the vehicle is in one of the following states - NONE, ENTERING_INTERSECTION or AT_INTERSECTION.
  • +
  • The gray sphere means that the vehicle is approaching the intersection and yields priority to the vehicle on the left side - LEFT_HAND_RULE_ENTERING_INTERSECTION.
  • +
  • The black sphere means that the vehicle is at the intersection and yields priority to a vehicle on the left side - LEFT_HAND_RULE_AT_INTERSECTION.
  • +
  • The yellow sphere means that the vehicle yields due to lanes rules before entering the intersection - LANES_RULES_ENTERING_INTERSECTION.
  • +
  • The red sphere means that it yields due to lanes rules but is already at the intersection - LANES_RULES_AT_INTERSECTION.
  • +
  • The blue sphere means that a vehicle is approaching the intersection and yields priority to a vehicle that is forcing priority - INTERSECTION_BLOCKED - when the turning vehicle begins to yield, then the blue sphere disappears. However, if the turning vehicle continues to turn (does not yield because it has passed the stopping point), then the vehicle going straight stops before the intersection and allows the turning vehicle to leave the intersection.
  • +
  • The pink sphere means that a vehicle is at intersection and yields priority to a vehicle that is forcing priority - FORCING_PRIORITY.
  • +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Traffic/TrafficComponents/gizmos.png b/Components/Traffic/TrafficComponents/gizmos.png new file mode 100644 index 0000000000..26fa4e5edc Binary files /dev/null and b/Components/Traffic/TrafficComponents/gizmos.png differ diff --git a/Components/Traffic/TrafficComponents/index.html b/Components/Traffic/TrafficComponents/index.html new file mode 100644 index 0000000000..761afc8015 --- /dev/null +++ b/Components/Traffic/TrafficComponents/index.html @@ -0,0 +1,3530 @@ + + + + + + + + + + + + + + + + + + + + + + + Traffic Components - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Traffic Components

+ +
+

This section

+

This section is still under development!

+
+

This is a section that describes in detail all components related to simulated traffic in the Environment prefab.

+

Architecture

+

traffic components diagram

+

The random traffic system consists of the following components:

+
    +
  • +

    TrafficManager

    +

    It is a top level interface meant to be used on the Unity scene. +TrafficManager runs all elements needed for a successful traffic simulation. +This component manages all TrafficSimulators so they don't work against each other. +It gives you the possibility to configure the TrafficSimulators.

    +
  • +
  • +

    TrafficSimulator

    +

    Technically it is not a component, it is crucial to understand what it is and what it does in order to correctly configure the TrafficManager. +TrafficSimulator manages NPCVehicles spawning. +There can be many TrafficSimulators on the scene. +They are added and configured in the TrafficManager component. +Every TrafficSimulator manages some part of the traffic it is responsible for - meaning it has spawned the NPCVehicles and set their configuration.

    +
      +
    • RandomTrafficSimulator - spawns and controls NPCVehicles driving randomly
    • +
    • RouteTrafficSimulator - spawns and controls NPCVehicles driving on a defined route
    • +
    +
    +

    TrafficSimulator inaccessibility

    +

    It is not possible to get direct access to the TrafficSimulator. +It should be added and configured through the TrafficManager component.

    +
    +
  • +
  • +

    TrafficLane, TrafficIntersection and StopLine

    +

    These components represent traffic entities. +They are used to control and manage the traffic with respect to traffic rules and current road situation.

    +
  • +
  • +

    NPCVehicle

    +

    The vehicle models (NPCs) spawned by one of the TrafficSimulators. +They are spawned according to the TrafficSimulator configuration and either drive around the map randomly (when spawned by a RandomTrafficSimulator) or follow the predefined path (when spawned by a RouteTrafficSimulator). +NPCVehicles are managed by one central knowledge base.

    +
  • +
+

The process of spawning a NPCVehicle and its later behavior control is presented on the following sequence diagram.

+ + +

traffic components sequence diagram

+
+

Sequence Diagram Composition

+

Please note that the diagram composition has been simplified to the level of GameObjects and chosen elements of the GameObjects for the purpose of improving readability.

+
+

Lanelet2

+

Lanelet2 is a library created for handling a map focused on automated driving. +It also supports ROS and ROS2 natively. +In AWSIM Lanelet2 is used for reading and handling a map of all roads. +Specifically it does contain all TrafficLanes and StopLines. +You may also see us referring to the actual map data file (*.osm) as a Lanelet2.

+
+

Lanelet2 official page

+

If you want to learn more we encourage to visit the official project page.

+
+

RandomTrafficSimulator

+
+

Nomenclature

+

Please note that

+ +

are named RandomTrafficSimulator. +Keep this in mind when reading the following page - so you don't get confused.

+
+

RandomTrafficSimulator simulates traffic with respect to all traffic rules. The system allows for random selection of car models and the paths they follow. It also allows adding static vehicles in the simulation.

+ +

random_traffic_link

+

The RandomTrafficSimulator consists of several GameObjects.

+
    +
  • RandomTrafficSimulator - this is an Object consisting of a Traffic Manager (script).
    + You can learn more about it here.
  • +
  • TrafficIntersections - this is a parent Object for all TrafficIntersections.
    + You can learn more about it here.
  • +
  • TrafficLanes - this is a parent Object for all TrafficLanes.
    + You can learn more about it here.
  • +
  • StopLines - this is a parent Object for all StopLines.
    + You can learn more about it here.
  • +
+

Components

+

+

RandomTrafficSimulator only has one component: Traffic Manager (script) which is described below.

+

TrafficManager (script)

+

random_traffic_script

+

Traffic Manager (script) is responsible for all of top level management of the NPCVehicles. +It managed spawning of NPCVehicles on TrafficLanes.

+

TrafficManager uses the concept of TrafficSimulators. +One TrafficSimulator is responsible for managing its set of NPCVehicles. +Every TrafficSimulator spawns its own NPCVehicles independently. +The vehicles spawned by one TrafficSimulator do respect its configuration. +TrafficSimulators can be interpreted as NPCVehicle spawners with different configurations each. +Many different TrafficSimulators can be added to the TrafficManager.

+

If a random mode is selected (RandomTrafficSimulator) then NPCVehicles will spawn in random places (from the selected list) and drive in random directions. +To be able to reproduce the behavior of the RandomTrafficSimulator a Seed can be specified - which is used for the pseudo-random numbers generation.

+

TrafficManager script also configures all of the spawned NPCVehicles, so that they all have common parameters

+
    +
  • Acceleration - the acceleration used by the vehicles at all times when accelerating.
  • +
  • Deceleration - the value of deceleration used in ordinary situations.
  • +
  • Sudden Deceleration - deceleration used when standard Deceleration is not sufficient to avoid accident.
  • +
  • Absolute Deceleration - value of deceleration used when no other deceleration allows to avoid the accident.
  • +
+

The Vehicle Layer Mask and Ground Layer Mask are used to make sure all vehicles can correctly interact with the ground to guarantee simulation accuracy.

+

Max Vehicle Count specifies how many NPCVehicles can be present on the scene at once. +When the number of NPCVehicles on the scene is equal to this value the RandomTrafficSimulator stops spawning new vehicles until some existing vehicles drive away and disappear.

+

The EgoVehicle field provides the information about Ego vehicle used for correct behavior ofNPCVehicleswhen interacting with Ego.

+

Show Gizmos checkbox specifies whether the Gizmos visualization should be displayed when running the simulation.

+

Show Yielding Phase checkbox specifies whether yielding phases should be displayed by Gizmos - in the form of spheres above vehicles, details in the Markings section.

+

Show Obstacle Checking checkbox specifies whether obstacle checking should be displayed by Gizmos - in the form of boxes in front of vehicles

+

Show Spawn Points checkbox specifies whether spawn points should be displayed by Gizmos - in the form of flat cuboids on roads.

+
+

Gizmos performance

+

Gizmos have a high computational load. +Enabling them may cause the simulation to lag.

+
+

As mentioned earlier - TrafficManager may contain multiple TrafficSimulators. +The two available variants of TrafficSimulator are described below

+ +

TrafficSimulators should be interpreted as spawning configurations for some group of NPCVehicles on the scene.

+

Random Traffic

+

random_traffic_sims

+

When using RandomTrafficSimulator the NPCVehicle prefabs (NPC Prefabs) can be chosen as well as Spawnable Lanes. +The later are the only TrafficLanes on which the NPCVehicles can spawn. +Upon spawning one of the Spawnabe Lanes is chosen and - given the vehicle limits are not reached - one random NPCVehicle from the Npc prefabs list is spawned on that lane. +After spawning, the NPCVehicle takes a random route until it drives out of the map - then it is destroyed.

+

The Maximum Spawns field specifies how many Vehicles should be spawned before this TrafficSimulator stops working. +Set to 0 to disable this restriction.

+

Route Traffic

+

route traffic sims

+

When using Route traffic Simulator the NPCVehicle prefabs (NPC Prefabs) as well as Route can be chosen. +The later is an ordered list of TrafficLanes that all spawned vehicles will drive on. +Given the vehicle limit is not reached - the RouteTrafficSimulator will spawn one of the Npc Prefabs chosen randomly on the first Route element (Element 0). +After the first vehicle drives off the next one will spawn according to the configuration. +It is important for all Route elements to be connected and to be arranged in order of appearance on the map. +The NPCVehicle disappears after completing the Route.

+

The Maximum Spawns field specifies how many Vehicles should be spawned before this TrafficSimulator stops working. +Set to 0 to disable this restriction.

+

Parameter explanation

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
General Settings
SeedSeed value for random generator
Ego VehicleTransform of ego vehicle
Vehicle Layer MaskLayerMask that masks only vehicle(NPC and ego) colliders
Ground Layer MaskLayerMask that masks only ground colliders of the map
Culling DistanceDistance at which NPCs are culled relative to EgoVehicle
Culling HzCulling operation cycle
NPCVehicle Settings
Max Vehicle CountMaximum number of NPC vehicles to be spawned in simulation
NPC PrefabsPrefabs representing controlled vehicles.
They must have NPCVehicle component attached.
Spawnable LanesTrafficLane components where NPC vehicles can be spawned during traffic simulation
Vehicle ConfigParameters for NPC vehicle control
Sudden Deceleration is a deceleration related to emergency braking
Debug
Show GizmosEnable the checkbox to show editor gizmos that visualize behaviours of NPCs
+

Traffic Light (script)

+

light_script

+

pedestrian_lights_materials

+

Traffic Light (script) is a component added to every TrafficLight on the scene. +It is responsible for configuring the TrafficLight behavior - the bulbs and their colors.

+

The Renderer filed points to the renderer that should be configured - in this case it is always a TrafficLight renderer.

+

Bulbs Emission Config is a list describing available colors for this Traffic Light. +Every element of this list configures the following

+
    +
  • Bulb Color - the name of the configured color that will be used to reference this color
  • +
  • Color - the actual color with which a bulb should light up
  • +
  • Intensity - the intensity of the color
  • +
  • Exposure Weight - how bright should the color be when lighting up
  • +
+

The Bulb Material Config is a list of available bulbs in a given Traffic Light. +Every element describes a different bulb. +Every bulb has the following aspects configured

+
    +
  • Bulb Type - the name that will be usd to reference the configured bulb
  • +
  • Material Index - The index of a material of the configured bulb. + This is an index of a sub-mesh of the configured bulb in the Traffic Light mesh. + The material indices are described in detail here and here.
  • +
+

TrafficIntersections

+

intersection

+

TrafficIntersection is a representation of a road intersection. +It consists of several components. +TrafficIntersection is used in the Scene for managing TrafficLights. +All Traffic Lights present on one Traffic Intersection must be synchronized - this is why the logic of TrafficLight operation is included in the TrafficIntersection.

+ +

intersections_link

+

Every TrafficIntersection has its own GameObject and is added as a child of the aggregate TrafficIntersections Object. +TrafficIntersections are elements of an Environment, so they should be placed as children of an appropriate Environment Object.

+

Components

+

intersection_prefab

+

TrafficIntersection has the following components:

+
    +
  • Box Collider - marks the area of the Traffic Intersection, it should cover the whole intersection area
  • +
  • Traffic Intersection (script) - controls all Traffic Lights on the given intersection according to the configuration
  • +
+

Collider

+

intersection_collider

+

Every TrafficIntersection contains a Box Collider element. +It needs to accurately cover the whole area of the TrafficIntersection. +Box Collider - together with the Traffic Intersection (script) - is used for detecting vehicles entering the TrafficIntersection.

+

Traffic Intersection (script)

+

intersection_script

+

Traffic Intersection (script) is used for controlling all TrafficLights on a given intersection. +The Collider Mask field is a mask on which all Vehicle Colliders are present. +It - together with Box Collider - is used for keeping track of how many Vehicles are currently present on the Traffic Intersection. +The Traffic Light Groups and Lighting Sequences are described below.

+

Traffic Light Groups

+

light_groups

+

Traffic Light Group is a collection of all Traffic Lights that are in the same state at all times. +This includes all redundant Traffic Lights shining in one direction as well as the ones in the opposite direction. +In other words - as long as two Traffic Lights indicate exactly the same thing they should be added to the same Traffic Light Group. +This grouping simplifies the creation of Lighting Sequences.

+

Lighting Sequences

+

lights_sequence

+

Lighting Sequences is the field in which the whole intersection Traffic Lights logic is defined. +It consists of many different Elements. +Each Element is a collection of Orders that should take an effect for the period of time specified in the Interval Sec field. +Lighting Sequences Elements are executed sequentially, in order of definition and looped - after the last element sequence goes back to the first element.

+

The Group Lighting Orders field defines which Traffic Light Groups should change their state and how. +For every Group Lighting Orders Element the Traffic Lights Group is specified with the exact description of the goal state for all Traffic Lights in that group - which bulb should light up and with what color.

+

One Lighting Sequences Element has many Group Lighting Orders, which means that for one period of time many different orders can be given. +E.g. when Traffic Lights in one direction change color to green - Traffic Lights in the parallel direction change color to red.

+
+

Traffic Light state persistance

+

If in the given Lighting Sequences Element no order is given to some Traffic Light Group - this Group will keep its current state. +When the next Lighting Sequences Element activates - the given Traffic Light Group will remain in an unchanged state.

+
+
+Lighting Sequence Sample - details +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DescriptionEditor
+ Traffic Lights in Pedestrian Group 1
change color to flashing green.

+ Other Groups keep their
current state.

+ This state lasts for 5 seconds. +
+ Traffic Lights in Pedestrian Group 1
change color to solid red.

+ Other Groups keep their
current state.

+ This state lasts for 1 second. +
+ Traffic Lights in Vehicle Group 1
change color to solid yellow.

+ Other Groups keep their
current state.

+ This state lasts for 5 seconds. +
+ Traffic Lights in Vehicle Group 1
change color to solid red.

+ Other Groups keep their
current state.

+ This state lasts for 3 seconds. +
+ Traffic Lights in Vehicle Group 2
change color to solid green.

+ Traffic Lights in Pedestrian Group 2
change color to solid green.

+ Other Groups keep their
current state.

+ This state lasts for 15 seconds. +
+ Traffic Lights in Pedestrian Group 2
change color to flashing green.

+ Other Groups keep their
current state.

+ This state lasts for 5 seconds. +
+ Traffic Lights in Pedestrian Group 2
change color to solid red.

+ Other Groups keep their
current state.

+ This state lasts for 1 second. +
+ Traffic Lights in Vehicle Group 2
change color to solid yellow.

+ Other Groups keep their
current state.

+ This state lasts for 5 seconds. +
+ Traffic Lights in Vehicle Group 2
change color to solid red.

+ Other Groups keep their
current state.

+ This state lasts for 3 second.

+ Sequence loops back to the
first element of the list. +

+
+

TrafficLanes

+

lanes

+

TrafficLane is a representation of a short road segment. +It consists of several waypoints that are connected by straight lines. +TrafficLanes are used as a base for a RandomTrafficSimulator. +They allow NPCVehicles to drive on the specific lanes on the road and perform different maneuvers with respect to the traffic rules. +TrafficLanes create a network of drivable roads when connected.

+ +

lanes_link

+

Every TrafficLane has its own GameObject and is added as a child of the aggregate TrafficLanes Object. +TrafficLanes are an element of an Environment, so they should be placed as children of an appropriate Environment Object.

+

TrafficLanes can be imported from the lanelet2 *.osm file.

+

Components

+

lanes_prefab

+

TrafficLane consists of an Object containing Traffic Lane (script).

+

TrafficLane has a transformation property - as every Object in Unity - however it is not used in any way. +All details are configured in the Traffic Lane (script), the information in Object transformation is ignored.

+

Traffic Lane (script)

+

lanes_script

+

Traffic Lane (script) defines the TrafficLane structure. +The Waypoints field is an ordered list of points that - when connected with straight lines - create a TrafficLane.

+
+

Traffic Lane (script) coordinate system

+

Waypoints are defined in the Environment coordinate system, the transformation of GameObject is ignored.

+
+

Turn Direction field contains information on what is the direction of this TrafficLane - whether it is a right or left turn or straight road.

+

Traffic lanes are connected using Next Lanes and Prev Lanes fields. +This way individual TrafficLanes can create a connected road network. +One Traffic Lane can have many Next Lanes and Prev Lanes. +This represents the situation of multiple lanes connecting to one or one lane splitting into many - e.g. the possibility to turn and to drive straight.

+

Right Of Way Lanes are described below.

+

Every TrafficLane has to have a Stop Line field configured when the Stop Line is present on the end of the TrafficLane. +Additionally the Speed Limit field contains the highest allowed speed on given TrafficLane.

+

Right Of Way Lanes

+

lanes_yield

+

Right Of Way Lanes is a collection of TrafficLanes. +Vehicle moving on the given TrafficLane has to give way to all vehicles moving on every Right Of Way Lane. +It is determined based on basic traffic rules. +Setting Right Of Way Lanes allows RandomTrafficSimulator to manage all NPCVehicles so they follow traffic rules and drive safely.

+

In the Unity editor - when a TrafficLane is selected - aside from the selected TrafficLane highlighted in blue, all Right Of Way Lanes are highlighted in yellow.

+
+

Right Of Way Lanes Sample - details

+

The selected TrafficLane (blue) is a right turn on an intersection. +This means, that before turning right the vehicle must give way to all vehicles driving from ahead - the ones driving straight as well as the ones turning left. +This can be observed as TrafficLanes highlighted in yellow.

+

lanes_yield_2

+
+

StopLines

+

stop

+

StopLine is a representation of a place on the road where vehicles giving way to other vehicles should stop and wait. +They allow RandomTrafficSimulator to manage NPCVehicles in safe and correct way - according to the traffic rules. +All possible locations where a vehicle can stop in order to give way to other vehicles - that are enforced by an infrastructure, this does not include regular lane changing - need to be marked with StopLines.

+ +

stop_lines_link

+

Every StopLine has its own GameObject and is added as a child of the aggregate StopLines Object. +Stop Lines are an element of an Environment, so they should be placed as children of an appropriate Environment Object.

+

StopLines can be imported from the lanelet2 *.osm file.

+

Components

+

stop_prefab

+

StopLine consists of an Object containing Stop Line (script).

+

Stop Line has a transformation property - as every Object in Unity - however it is not used in any way. +All details are configured in the Traffic Lane (script), the information in Object transformation is ignored.

+

Stop Line (script)

+

stop_script

+

Stop Line (script) defines StopLine configuration. +The Points field is an ordered list of points that - when connected - create a StopLine. +The list of points should always have two elements that create a straight StopLine.

+
+

Stop Line (script) coordinate system

+

Points are defined in the Environment coordinate system, the transformation of GameObject is ignored.

+
+

The Has Stop Sign field contains information whether the configured StopLine has a corresponding StopSign on the scene.

+

Every Stop Line needs to have a Traffic Light field configured with the corresponding Traffic Light. +This information allows the RandomTrafficSimulator to manage the NPCVehicles in such a way that they respect the Traffic Lights and behave on the Traffic Intersections correctly.

+

Gizmos

+

gizmos

+

Gizmos are a in-simulation visualization showing current and future moves of the NPCVehicles. +They are useful for checking current behavior of NPCs and its causes. +On the Scene they are visible as cuboid contours indicating which TrafficLanes will be taken by each vehicle in the near future.

+
+

Gizmos computing

+

Gizmos have a high computational load. +Please disable them if the simulation is laggy.

+
+ + + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Traffic/TrafficComponents/inspector.png b/Components/Traffic/TrafficComponents/inspector.png new file mode 100644 index 0000000000..8a523f7e77 Binary files /dev/null and b/Components/Traffic/TrafficComponents/inspector.png differ diff --git a/Components/Traffic/TrafficComponents/intersections/intersection.png b/Components/Traffic/TrafficComponents/intersections/intersection.png new file mode 100644 index 0000000000..69ce187faa Binary files /dev/null and b/Components/Traffic/TrafficComponents/intersections/intersection.png differ diff --git a/Components/Traffic/TrafficComponents/intersections/intersection_collider.png b/Components/Traffic/TrafficComponents/intersections/intersection_collider.png new file mode 100644 index 0000000000..b29606b78a Binary files /dev/null and b/Components/Traffic/TrafficComponents/intersections/intersection_collider.png differ diff --git a/Components/Traffic/TrafficComponents/intersections/intersection_prefab.png b/Components/Traffic/TrafficComponents/intersections/intersection_prefab.png new file mode 100644 index 0000000000..e0962018ce Binary files /dev/null and b/Components/Traffic/TrafficComponents/intersections/intersection_prefab.png differ diff --git a/Components/Traffic/TrafficComponents/intersections/intersection_script.png b/Components/Traffic/TrafficComponents/intersections/intersection_script.png new file mode 100644 index 0000000000..7eb6c6c510 Binary files /dev/null and b/Components/Traffic/TrafficComponents/intersections/intersection_script.png differ diff --git a/Components/Traffic/TrafficComponents/intersections/intersections_link.png b/Components/Traffic/TrafficComponents/intersections/intersections_link.png new file mode 100644 index 0000000000..a8f1c52695 Binary files /dev/null and b/Components/Traffic/TrafficComponents/intersections/intersections_link.png differ diff --git a/Components/Traffic/TrafficComponents/intersections/light_groups.png b/Components/Traffic/TrafficComponents/intersections/light_groups.png new file mode 100644 index 0000000000..aee6faab7b Binary files /dev/null and b/Components/Traffic/TrafficComponents/intersections/light_groups.png differ diff --git a/Components/Traffic/TrafficComponents/intersections/lights_sequence.png b/Components/Traffic/TrafficComponents/intersections/lights_sequence.png new file mode 100644 index 0000000000..602f76e691 Binary files /dev/null and b/Components/Traffic/TrafficComponents/intersections/lights_sequence.png differ diff --git a/Components/Traffic/TrafficComponents/light_script.png b/Components/Traffic/TrafficComponents/light_script.png new file mode 100644 index 0000000000..a9d0a2c164 Binary files /dev/null and b/Components/Traffic/TrafficComponents/light_script.png differ diff --git a/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_1.png b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_1.png new file mode 100644 index 0000000000..410031c2b2 Binary files /dev/null and b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_1.png differ diff --git a/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_2.png b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_2.png new file mode 100644 index 0000000000..830c23ca3f Binary files /dev/null and b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_2.png differ diff --git a/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_3.png b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_3.png new file mode 100644 index 0000000000..588349afc2 Binary files /dev/null and b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_3.png differ diff --git a/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_4.png b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_4.png new file mode 100644 index 0000000000..ec6e93a74b Binary files /dev/null and b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_4.png differ diff --git a/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_5.png b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_5.png new file mode 100644 index 0000000000..1304aba3be Binary files /dev/null and b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_5.png differ diff --git a/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_6.png b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_6.png new file mode 100644 index 0000000000..642fe87db4 Binary files /dev/null and b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_6.png differ diff --git a/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_7.png b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_7.png new file mode 100644 index 0000000000..f7ec3ab53f Binary files /dev/null and b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_7.png differ diff --git a/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_8.png b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_8.png new file mode 100644 index 0000000000..0e9b12fdaa Binary files /dev/null and b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_8.png differ diff --git a/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_9.png b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_9.png new file mode 100644 index 0000000000..2892b67829 Binary files /dev/null and b/Components/Traffic/TrafficComponents/lights_sequence/lights_sequence_9.png differ diff --git a/Components/Traffic/TrafficComponents/pedestrian_lights_materials.png b/Components/Traffic/TrafficComponents/pedestrian_lights_materials.png new file mode 100644 index 0000000000..a25ab1ffe2 Binary files /dev/null and b/Components/Traffic/TrafficComponents/pedestrian_lights_materials.png differ diff --git a/Components/Traffic/TrafficComponents/play.png b/Components/Traffic/TrafficComponents/play.png new file mode 100644 index 0000000000..6758b30387 Binary files /dev/null and b/Components/Traffic/TrafficComponents/play.png differ diff --git a/Components/Traffic/TrafficComponents/prefab.png b/Components/Traffic/TrafficComponents/prefab.png new file mode 100644 index 0000000000..22d89003ed Binary files /dev/null and b/Components/Traffic/TrafficComponents/prefab.png differ diff --git a/Components/Traffic/TrafficComponents/random_traffic.png b/Components/Traffic/TrafficComponents/random_traffic.png new file mode 100644 index 0000000000..e459a4a3da Binary files /dev/null and b/Components/Traffic/TrafficComponents/random_traffic.png differ diff --git a/Components/Traffic/TrafficComponents/random_traffic_link.png b/Components/Traffic/TrafficComponents/random_traffic_link.png new file mode 100644 index 0000000000..d837f90aeb Binary files /dev/null and b/Components/Traffic/TrafficComponents/random_traffic_link.png differ diff --git a/Components/Traffic/TrafficComponents/random_traffic_script.png b/Components/Traffic/TrafficComponents/random_traffic_script.png new file mode 100644 index 0000000000..122af7d044 Binary files /dev/null and b/Components/Traffic/TrafficComponents/random_traffic_script.png differ diff --git a/Components/Traffic/TrafficComponents/random_traffic_sims.png b/Components/Traffic/TrafficComponents/random_traffic_sims.png new file mode 100644 index 0000000000..01594d0ee5 Binary files /dev/null and b/Components/Traffic/TrafficComponents/random_traffic_sims.png differ diff --git a/Components/Traffic/TrafficComponents/route_traffic_sims.png b/Components/Traffic/TrafficComponents/route_traffic_sims.png new file mode 100644 index 0000000000..60d13de0a2 Binary files /dev/null and b/Components/Traffic/TrafficComponents/route_traffic_sims.png differ diff --git a/Components/Traffic/TrafficComponents/stop_lines/stop.png b/Components/Traffic/TrafficComponents/stop_lines/stop.png new file mode 100644 index 0000000000..bf3106b5da Binary files /dev/null and b/Components/Traffic/TrafficComponents/stop_lines/stop.png differ diff --git a/Components/Traffic/TrafficComponents/stop_lines/stop_lines_link.png b/Components/Traffic/TrafficComponents/stop_lines/stop_lines_link.png new file mode 100644 index 0000000000..e37860119d Binary files /dev/null and b/Components/Traffic/TrafficComponents/stop_lines/stop_lines_link.png differ diff --git a/Components/Traffic/TrafficComponents/stop_lines/stop_prefab.png b/Components/Traffic/TrafficComponents/stop_lines/stop_prefab.png new file mode 100644 index 0000000000..2b39b403ea Binary files /dev/null and b/Components/Traffic/TrafficComponents/stop_lines/stop_prefab.png differ diff --git a/Components/Traffic/TrafficComponents/stop_lines/stop_script.png b/Components/Traffic/TrafficComponents/stop_lines/stop_script.png new file mode 100644 index 0000000000..dc44416d05 Binary files /dev/null and b/Components/Traffic/TrafficComponents/stop_lines/stop_script.png differ diff --git a/Components/Traffic/TrafficComponents/traffic_components.drawio b/Components/Traffic/TrafficComponents/traffic_components.drawio new file mode 100644 index 0000000000..078c99d4ee --- /dev/null +++ b/Components/Traffic/TrafficComponents/traffic_components.drawio @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Components/Traffic/TrafficComponents/traffic_components.png b/Components/Traffic/TrafficComponents/traffic_components.png new file mode 100644 index 0000000000..b8157039dc Binary files /dev/null and b/Components/Traffic/TrafficComponents/traffic_components.png differ diff --git a/Components/Traffic/TrafficComponents/traffic_components_sequence.drawio b/Components/Traffic/TrafficComponents/traffic_components_sequence.drawio new file mode 100644 index 0000000000..d7f5c50720 --- /dev/null +++ b/Components/Traffic/TrafficComponents/traffic_components_sequence.drawio @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Components/Traffic/TrafficComponents/traffic_components_sequence.png b/Components/Traffic/TrafficComponents/traffic_components_sequence.png new file mode 100644 index 0000000000..5a71eb0f98 Binary files /dev/null and b/Components/Traffic/TrafficComponents/traffic_components_sequence.png differ diff --git a/Components/Traffic/TrafficComponents/traffic_components_sequence_ext.drawio b/Components/Traffic/TrafficComponents/traffic_components_sequence_ext.drawio new file mode 100644 index 0000000000..3e6d383222 --- /dev/null +++ b/Components/Traffic/TrafficComponents/traffic_components_sequence_ext.drawio @@ -0,0 +1,355 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Components/Traffic/TrafficComponents/traffic_components_sequence_ext.png b/Components/Traffic/TrafficComponents/traffic_components_sequence_ext.png new file mode 100644 index 0000000000..467a0b3aa7 Binary files /dev/null and b/Components/Traffic/TrafficComponents/traffic_components_sequence_ext.png differ diff --git a/Components/Traffic/TrafficComponents/traffic_lanes/lanes.png b/Components/Traffic/TrafficComponents/traffic_lanes/lanes.png new file mode 100644 index 0000000000..f2b158c904 Binary files /dev/null and b/Components/Traffic/TrafficComponents/traffic_lanes/lanes.png differ diff --git a/Components/Traffic/TrafficComponents/traffic_lanes/lanes_link.png b/Components/Traffic/TrafficComponents/traffic_lanes/lanes_link.png new file mode 100644 index 0000000000..52ff25d27f Binary files /dev/null and b/Components/Traffic/TrafficComponents/traffic_lanes/lanes_link.png differ diff --git a/Components/Traffic/TrafficComponents/traffic_lanes/lanes_prefab.png b/Components/Traffic/TrafficComponents/traffic_lanes/lanes_prefab.png new file mode 100644 index 0000000000..bf362610ff Binary files /dev/null and b/Components/Traffic/TrafficComponents/traffic_lanes/lanes_prefab.png differ diff --git a/Components/Traffic/TrafficComponents/traffic_lanes/lanes_script.png b/Components/Traffic/TrafficComponents/traffic_lanes/lanes_script.png new file mode 100644 index 0000000000..6fe66e6737 Binary files /dev/null and b/Components/Traffic/TrafficComponents/traffic_lanes/lanes_script.png differ diff --git a/Components/Traffic/TrafficComponents/traffic_lanes/lanes_yield.png b/Components/Traffic/TrafficComponents/traffic_lanes/lanes_yield.png new file mode 100644 index 0000000000..183fa5ab29 Binary files /dev/null and b/Components/Traffic/TrafficComponents/traffic_lanes/lanes_yield.png differ diff --git a/Components/Traffic/TrafficComponents/traffic_lanes/lanes_yield_2.png b/Components/Traffic/TrafficComponents/traffic_lanes/lanes_yield_2.png new file mode 100644 index 0000000000..20998b6b58 Binary files /dev/null and b/Components/Traffic/TrafficComponents/traffic_lanes/lanes_yield_2.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/brake_reverse_lights_check.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/brake_reverse_lights_check.gif new file mode 100644 index 0000000000..06522d78f9 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/brake_reverse_lights_check.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/com_all.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/com_all.gif new file mode 100644 index 0000000000..f616998841 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/com_all.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/ego_vehicle_add_object.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/ego_vehicle_add_object.gif new file mode 100644 index 0000000000..0bfd8c521a Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/ego_vehicle_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/index.html b/Components/Vehicle/AddNewVehicle/AddAVehicle/index.html new file mode 100644 index 0000000000..ff26289983 --- /dev/null +++ b/Components/Vehicle/AddNewVehicle/AddAVehicle/index.html @@ -0,0 +1,2956 @@ + + + + + + + + + + + + + + + + + + + + + + + Add Vehicle - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Add Vehicle

+ +
+

Ego Vehicle Component

+

In this tutorial we will create a new EgoVehicle. +To learn more about what an EgoVehicle is in AWSIM please visit Ego Vehicle description page.

+
+

Cerate an Object

+

Add a child Object to the Simulation called EgoVehicle.

+

ego vehicle add object

+

Add a Rigidbody

+
    +
  1. +

    While having a newly created EgoVehicle Object selected, in the Inspector view click on the 'Add Component' button, search for Rigidbody and select it.

    +

    rigidbody add component

    +

    rigidbody search

    +
  2. +
  3. +

    Configure Mass and Drag with the correct values for your Vehicle.

    +

    rigidbody configure 1

    +
  4. +
  5. +

    Configure Interpolation and Collision Detection.

    +

    rigidbody configure 2

    +
  6. +
+

Add visual elements

+

For a detailed explanation hwo to add visual elements of your Vehicle check out this dedicated tutorial.

+

Add a Canter of Mass

+

To add a center of mass to your vehicle you have to add a CoM child Object to the EgoVehicle Object (the same as in steps before).

+

Then just set the position of the CoM Object in the Inspector view to represent real-world center of mass of the Vehicle.

+

center of mass

+
+How do I know what is the Center of Mass of my Vehicle +

The best way is to obtain a Center of Mass information from your Vehicle documentation.

+

However, if this is not possible, you can try to estimate the Center of Mass of your vehicle. +Best practice is to set the estimated Center of Mass as the following

+
    +
  • Evenly between the axles of the Vehicle
  • +
  • Right in the middle of the Vehicles width
  • +
  • Somewhere in the neighborhood of a quarter of the Vehicle height
  • +
+

Note: This will vary very much depending on your Vehicle construction. +For the best possible result please follow the Vehicle specifications.

+
+

Add a Reflection Probe

+
    +
  1. +

    Add a new Object called Reflection Probe as a child to the EgoVehicle Object.

    +

    reflection probe add object

    +
  2. +
  3. +

    Click on the 'Add Component' button, in the windows that pops-up search for Reflection Probe and select it.

    +

    reflection probe add component

    +
    +

    Note

    +

    Please note that with Reflection Probe there should also be automatically added a `HD Additional Reflection Data Script.

    +

    reflection probe additional script

    +
    +
  4. +
  5. +

    Configure the Reflection Probe as you wish.

    +
    +

    Example Configuration

    +

    Below you can see an example configuration of the Reflection Probe.

    +

    reflection probe configuration

    +
    +
  6. +
+

Add Colliders

+

For a detailed explanation how to add colliders to your Vehicle check out this dedicated tutorial.

+

Add a base for sensors (URDF)

+

You will most certainly want to add some sensors to your EgoVehicle. +First you need to create a parent Object for all those sensors called URDF. +To do this we will add a child Object URDF to the EgoVehicle Object.

+

urdf add object

+

This Object will be used as a base for all sensors we will add later.

+

Add a Vehicle Script

+

To be able to control your EgoVehicle you need a Vehicle Script.

+
    +
  1. +

    Add the Vehicle Script to the EgoVehicle Object.

    +

    vehicle script add component

    +

    vehicle script search

    +
  2. +
  3. +

    Configure the Vehicle Script Axle Settings and Center Of Mass Transform.

    +

    vehicle script configure

    +
  4. +
+
+

Testing

+

It is not possible to test this Script alone, but you can test the following

+ +

If components listed above work correctly this means the Vehicle Script works correctly too.

+
+

Add a Vehicle Keyboard Input Script

+

You can control your EgoVehicle in the simulation manually with just one Script called Vehicle Keyboard Input.

+

If you want to add it just click the 'Add Component' button on the EgoVehicle Object and search for Vehicle Keyboard Input Script and select it.

+

vehicle keyboard input script add

+

Add a Vehicle Visual Effect Script

+

For a visual indication of a Vehicle status you will need a Vehicle Visual Effect Script. +To add and configure it follow the steps below.

+
    +
  1. +

    Add a Vehicle Visual Effect Script by clicking 'Add Component' button, searching for it and selecting it.

    +

    vehicle visual effect script add component

    +
  2. +
  3. +

    Configure the lights.

    +
    +

    Note

    +

    In this step we will configure only Brake Lights, but should repeat this for every Light. +The process is almost the same for all Lights - just change the mesh renderer and lighting settings according to your preference.

    +
    +

    vehicle visual effect script configure

    +
  4. +
+

How to test

+

After configuring Vehicle Visual Effect Script it is advised to test whether everything works as expected.

+
    +
  1. +

    Make sure you have a Vehicle Keyboard Input Script added and that it is enabled.

    +
  2. +
  3. +

    If your scene does not have any models yet please turn the gravity off in Rigidbody configuration so that the Vehicle does not fall down into infinity.

    +

    rigidbody turn gravity off

    +
  4. +
  5. +

    Start the simulation.

    +

    simulation start

    +
  6. +
  7. +

    Test the Turn Signals.

    +

    You can control the Turn Signals with a Vehicle Keyboard Input Script. +Activate the Turn Signals with one of the following keys

    +
      +
    • 1 - Left Turn Signal
    • +
    • 2 - Right Turn Signal
    • +
    • 3 - Hazard Lights
    • +
    • 4 - Turn Off all Signals
    • +
    +

    turn signals check

    +
  8. +
  9. +

    Test the Lights.

    +

    You can control the lights by "driving" the Vehicle using Vehicle Keyboard Input Script. +Although if you have an empty Environment like in this tutorial the Vehicle won't actually drive.

    +

    To test Brake Lights change the gear to Drive by pressing D on the keyboard and activate braking by holding arrow down.

    +

    To test the Reverse Light change the gear to Reverse by pressing R on the keyboard. +The Reverse Light should turn on right away.

    +

    brake reverse lights check

    +
  10. +
+
+

Camera tip

+

If you have not configured a camera or configured it in such a way that you can't see the Vehicle well you can still test most of the lights by changing views.

+
    +
  • Turn the Light (or Signal) on by pressing the appropriate key
  • +
  • Move to the Scene View by pressing ctrl + 1 - now you can move the camera freely
  • +
  • To change the Lights you need to go back to Game View by pressing ctrl + 2
  • +
+

Pleas note that this method won't work for testing Brake Lights, as for them to work you need to keep the arrow down button pressed all the time.

+
+

Add a Vehicle Ros Input Script

+

For controlling your Vehicle with autonomous driving software (e.g. Autoware) you need a Vehicle Ros Input Script.

+
+

Disable Vehicle Keyboard Input Script

+

If you have added a Vehicle Keyboard Input Script in your Vehicle please disable it when using the Vehicle Ros Input Script.

+

Not doing so will lead to the vehicle receiving two different inputs which will cause many problems.

+

vehicle keyboard input disable

+
+

Add it to the EgoVehicle Object by clicking on the 'Add Component' button, searching for it and selecting it.

+

vehicle ros input add component

+

The Script is configured to work with Autoware by default, but you can change the topics and Quality of Service settings as you wish.

+
+

Note

+

The Vehicle should be configured correctly, but if you have many Vehicles or something goes wrong, please select the right Vehicle in the Vehicle field by clicking on the small arrow icon and choosing the right item from the list.

+
+

How to test

+

The best way to test the Vehicle Ros Input Script is to run Autoware.

+
    +
  1. Run the Scene same as on this page.
  2. +
  3. Launch only the Autoware like on this page
  4. +
  5. Plan a path in Autoware like here, if the Vehicle moves in AWSIM correctly then the Script is configured well.
  6. +
+

Add Sensors

+

For a detailed explanation how to add sensors to your Vehicle check out this dedicated tutorial.

+

Add a Vehicle to Scene

+

First you will have to save the Vehicle you created as a prefab, to easily add it later to different Scenes.

+
    +
  1. Open the Vehicles directory in the Project view (Assets/AWSIM/Prefabs/Vehicles)
  2. +
  3. Drag the Vehicle Object from the Hierarchy view to the Vehicles directory
  4. +
+

save vehicle as prefab

+

After that, you can add the Vehicle you created to different Scenes by dragging it from Vehicles directory to the Hierarchy of different Scenes.

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/reflection_probe_add_component.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/reflection_probe_add_component.gif new file mode 100644 index 0000000000..9d81a01ac2 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/reflection_probe_add_component.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/reflection_probe_add_object.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/reflection_probe_add_object.gif new file mode 100644 index 0000000000..a2be88a0ed Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/reflection_probe_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/reflection_probe_additional_script.png b/Components/Vehicle/AddNewVehicle/AddAVehicle/reflection_probe_additional_script.png new file mode 100644 index 0000000000..1f166987b8 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/reflection_probe_additional_script.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/reflection_probe_configuration.png b/Components/Vehicle/AddNewVehicle/AddAVehicle/reflection_probe_configuration.png new file mode 100644 index 0000000000..5c80206b1c Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/reflection_probe_configuration.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_add_component.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_add_component.gif new file mode 100644 index 0000000000..16ef6165c7 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_add_component.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_configure1.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_configure1.gif new file mode 100644 index 0000000000..3b8ccf3954 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_configure1.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_configure2.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_configure2.gif new file mode 100644 index 0000000000..d929cd0268 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_configure2.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_search.png b/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_search.png new file mode 100644 index 0000000000..aa225b1cea Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_search.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_turn_gravity_off.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_turn_gravity_off.gif new file mode 100644 index 0000000000..9793ac0b5e Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/rigidbody_turn_gravity_off.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/simulation_start.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/simulation_start.gif new file mode 100644 index 0000000000..70b0ded760 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/simulation_start.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/turn_signals_check.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/turn_signals_check.gif new file mode 100644 index 0000000000..a28d436205 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/turn_signals_check.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/urdf_add_object.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/urdf_add_object.gif new file mode 100644 index 0000000000..6250dd9fd7 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/urdf_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_keyboard_cinput_add_component.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_keyboard_cinput_add_component.gif new file mode 100644 index 0000000000..20ff8fba3a Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_keyboard_cinput_add_component.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_keyboard_input_disable.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_keyboard_input_disable.gif new file mode 100644 index 0000000000..caee36d477 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_keyboard_input_disable.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_keyboard_input_script.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_keyboard_input_script.gif new file mode 100644 index 0000000000..be019bd11f Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_keyboard_input_script.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_ros_input_add_component.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_ros_input_add_component.gif new file mode 100644 index 0000000000..2bf76468a2 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_ros_input_add_component.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_save_prefab.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_save_prefab.gif new file mode 100644 index 0000000000..09534feae4 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_save_prefab.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_script_add_component.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_script_add_component.gif new file mode 100644 index 0000000000..a40bfb6f71 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_script_add_component.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_script_configure.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_script_configure.gif new file mode 100644 index 0000000000..f770c9c302 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_script_configure.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_script_search.png b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_script_search.png new file mode 100644 index 0000000000..d2d729a4e2 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_script_search.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_visual_effect_script_add_component.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_visual_effect_script_add_component.gif new file mode 100644 index 0000000000..caa68ca24c Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_visual_effect_script_add_component.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_visual_effect_script_configure.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_visual_effect_script_configure.gif new file mode 100644 index 0000000000..d00362ac4b Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/vehicle_visual_effect_script_configure.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/wheel_front_l_configured.png b/Components/Vehicle/AddNewVehicle/AddAVehicle/wheel_front_l_configured.png new file mode 100644 index 0000000000..e30aff5e8c Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/wheel_front_l_configured.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/wheel_script_configure_transform.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/wheel_script_configure_transform.gif new file mode 100644 index 0000000000..f185d6d649 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/wheel_script_configure_transform.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddAVehicle/wheel_script_configure_transform1280.gif b/Components/Vehicle/AddNewVehicle/AddAVehicle/wheel_script_configure_transform1280.gif new file mode 100644 index 0000000000..c50b9238ea Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddAVehicle/wheel_script_configure_transform1280.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/collider_add_mesh_collider.gif b/Components/Vehicle/AddNewVehicle/AddColliders/collider_add_mesh_collider.gif new file mode 100644 index 0000000000..e40b1e1c81 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddColliders/collider_add_mesh_collider.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/collider_add_object.gif b/Components/Vehicle/AddNewVehicle/AddColliders/collider_add_object.gif new file mode 100644 index 0000000000..9f60631420 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddColliders/collider_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/collider_configure.gif b/Components/Vehicle/AddNewVehicle/AddColliders/collider_configure.gif new file mode 100644 index 0000000000..d289056151 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddColliders/collider_configure.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/colliders_add_object.gif b/Components/Vehicle/AddNewVehicle/AddColliders/colliders_add_object.gif new file mode 100644 index 0000000000..57a67ae51f Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddColliders/colliders_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/colliders_configured.png b/Components/Vehicle/AddNewVehicle/AddColliders/colliders_configured.png new file mode 100644 index 0000000000..2c906bb7a9 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddColliders/colliders_configured.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/front_left_wheel_add_object_colliders.gif b/Components/Vehicle/AddNewVehicle/AddColliders/front_left_wheel_add_object_colliders.gif new file mode 100644 index 0000000000..38485d2327 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddColliders/front_left_wheel_add_object_colliders.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/front_left_wheel_set_transform.gif b/Components/Vehicle/AddNewVehicle/AddColliders/front_left_wheel_set_transform.gif new file mode 100644 index 0000000000..ef40b1e016 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddColliders/front_left_wheel_set_transform.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/index.html b/Components/Vehicle/AddNewVehicle/AddColliders/index.html new file mode 100644 index 0000000000..93e922d21e --- /dev/null +++ b/Components/Vehicle/AddNewVehicle/AddColliders/index.html @@ -0,0 +1,2580 @@ + + + + + + + + + + + + + + + + + + + + + + + Add Colliders - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Add Colliders

+ +

Next you need to add Colliders to your Vehicle. +To do this follow the steps below.

+
    +
  1. +

    Add a child Object called Colliders to the EgoVehicle Object.

    +

    colliders add object

    +
  2. +
  3. +

    Shift parent Object Colliders accordingly as in earlier steps where we shifted Models.

    +
  4. +
+

Add a Vehicle Collider

+
    +
  1. +

    Add a child Object Collider to the Colliders Object.

    +

    collider_add_object

    +
  2. +
  3. +

    Add a Mesh Collider component to the Collider Object by clicking on the 'Add Component' button in the Inspector view and searching for it.

    +

    collider add mesh collider

    +
  4. +
  5. +

    Click on the arrow in mesh selection field and from the pop-up window select your collider mesh. + Next click on the check-box called Convex, by now your collider mesh should be visible in the editor.

    +

    collider configure

    +
  6. +
+

Add Wheel Colliders

+
    +
  1. +

    Add a child Object Wheels to the Colliders Object.

    +

    wheels add object

    +
  2. +
+
+

Note

+

In this tutorial we will add only one wheel collider, but you should repeat the step for all 4 wheels. +That is, follow the instructions that follow this message for every wheel your Vehicle has.

+
    +
  • Front Left Wheel
  • +
  • Front Right Wheel
  • +
  • Rear Left Wheel
  • +
  • Rear Right Wheel
  • +
+
+
    +
  1. +

    Add a child Object FrontLeftWheel to the Wheels Object.

    +

    front left wheel add object

    +
  2. +
  3. +

    Add a Wheel Collider component to the FrontLeftWheel Object by clicking 'Add Component' and searching for it.

    +

    wheel collider add component

    +
  4. +
  5. +

    Add a Wheel Script to the FrontLeftWheel Object by clicking 'Add Component' and searching for it.

    +

    wheel_script_add_component

    +
  6. +
  7. +

    Drag FrontLeftWheel Object from the WheelVisuals to the Wheel Visual Transform field.

    +

    wheel script configure transform

    +
  8. +
  9. +

    Add a Wheel Collider Config Script to the FrontLeftWheel Object by clicking 'Add Component' and searching for it.

    +

    wheel collider config add script

    +
  10. +
  11. +

    Configure the Wheel Collider Config Script so that the Vehicle behaves as you wish.

    +

    wheel collider config configure

    +
  12. +
  13. +

    Set the Transform of FrontLeftWheel Object to match the visuals of your Vehicle.

    +

    front left wheel set transform

    +
  14. +
+
+

Successful configuration

+

If you have done everything right your Colliders Object should look similar to the one following.

+

colliders configured

+
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/wheel_collider_add_component.gif b/Components/Vehicle/AddNewVehicle/AddColliders/wheel_collider_add_component.gif new file mode 100644 index 0000000000..3019fc5335 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddColliders/wheel_collider_add_component.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/wheel_collider_config_script_add_component.gif b/Components/Vehicle/AddNewVehicle/AddColliders/wheel_collider_config_script_add_component.gif new file mode 100644 index 0000000000..4c732ef7f4 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddColliders/wheel_collider_config_script_add_component.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/wheel_collider_config_script_configure.gif b/Components/Vehicle/AddNewVehicle/AddColliders/wheel_collider_config_script_configure.gif new file mode 100644 index 0000000000..d2036b1d07 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddColliders/wheel_collider_config_script_configure.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/wheel_script_add_component.gif b/Components/Vehicle/AddNewVehicle/AddColliders/wheel_script_add_component.gif new file mode 100644 index 0000000000..9d5e054858 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddColliders/wheel_script_add_component.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/wheel_script_configure_transform2.gif b/Components/Vehicle/AddNewVehicle/AddColliders/wheel_script_configure_transform2.gif new file mode 100644 index 0000000000..d9f1ced584 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddColliders/wheel_script_configure_transform2.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddColliders/wheels_add_object.gif b/Components/Vehicle/AddNewVehicle/AddColliders/wheels_add_object.gif new file mode 100644 index 0000000000..3d811d1577 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddColliders/wheels_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/base_link_add_object.gif b/Components/Vehicle/AddNewVehicle/AddSensors/base_link_add_object.gif new file mode 100644 index 0000000000..994c76a57d Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/base_link_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/camera_component.png b/Components/Vehicle/AddNewVehicle/AddSensors/camera_component.png new file mode 100644 index 0000000000..bad7129339 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/camera_component.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/camera_preview_example.gif b/Components/Vehicle/AddNewVehicle/AddSensors/camera_preview_example.gif new file mode 100644 index 0000000000..20c030bf01 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/camera_preview_example.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/camera_sensor_script.png b/Components/Vehicle/AddNewVehicle/AddSensors/camera_sensor_script.png new file mode 100644 index 0000000000..ed471d3fb5 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/camera_sensor_script.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/index.html b/Components/Vehicle/AddNewVehicle/AddSensors/index.html new file mode 100644 index 0000000000..639a0f7017 --- /dev/null +++ b/Components/Vehicle/AddNewVehicle/AddSensors/index.html @@ -0,0 +1,3514 @@ + + + + + + + + + + + + + + + + + + + + + + + Add Sensors - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Add Sensors

+ +

AWSIM Sensors

+

There is a number of different sensors available in AWSIM. +Below we present a list of sensors with links to their individual pages.

+ + +

Best practice is to replicate a ROS sensors transformations tree in Unity using Objects.

+

Coordinate system conversion

+

Please note that Unity uses less common left-handed coordinate system. +Please keep this in mind while defining transformations. +More details about right-handed and left-handed systems can be found here.

+

To simplify the conversion process always remember that any point in ROS coordinate system (x, y, z) has an equivalent in the Unity coordinate system being (-y, z, x).

+

The same can be done with the rotation. +ROS orientation described with roll, pitch and yaw (r, p, y) can be translated to Unity Rotation as follows (p, -y, -r).

+
+

Unit conversion

+

Please remember to convert the rotation units. +ROS uses radians and Unity uses degrees. +The conversion from radians (rad) to degrees (deg) is as follows.

+
deg = rad * 180 / PI
+
+
+

Add transformations tree

+
+

URDF

+

Before following this tutorial please make sure you have an URDF Object like it is shown shown in this section.

+
+

First we will have to add a base_link which is the root of all transformations.

+

Add a base_link Object as a child to the URDF Object.

+

base link add object

+
+

base_link transformation

+

Please remember to set an appropriate transformation of the base_link Object so that it is identical as the base_link used in ROS in reference to the Vehicle.

+

This is very important, as a mistake here will result in all subsequent sensors being misplaced.

+
+

Inside the base_link we will represent all transformations contained in the ROS transformations tree.

+

You will have to check your Vehicle specific configuration. +You can do this in many ways, for example:

+
    +
  • +

    Check the ROS specific .yaml parameter files containing information about each transformation.

    +
    +

    Example

    +

    Here we see an example .yaml file containing transformation from the base_link to the sensor_kit_base_link:

    +
    base_link:
    +    sensor_kit_base_link:
    +        x: 0.9
    +        y: 0.0
    +        z: 2.0
    +        roll: -0.001
    +        pitch: 0.015
    +        yaw: -0.0364
    +
    +
    +
  • +
  • +

    Check the values with ROS command line tools (for more information on these please visit official ROS 2 documentation).

    +

    You can run a command like the following to check a transformation between two frames.

    +
    ros2 run tf2_ros tf2_echo [source_frame] [target_frame]
    +
    +
    +

    Example

    +

    Here we see an example command with the output containing transformation from the base_link to the sensor_kit_base_link (note that the line after $ sign is the executed command):

    +
    $ ros2 run tf2_ros tf2_echo base_link sensor_kit_base_link
    +[INFO] [1686654712.339110702] [tf2_echo]: Waiting for transform base_link ->  sensor_kit_base_link: Invalid frame ID "base_link" passed to canTransform argument target_frame - frame does not exist
    +At time 0.0
    +- Translation: [0.900, 0.000, 2.000]
    +- Rotation: in Quaternion [-0.000, 0.008, -0.018, 1.000]
    +- Rotation: in RPY (radian) [-0.001, 0.015, -0.036]
    +- Rotation: in RPY (degree) [-0.057, 0.859, -2.086]
    +- Matrix:
    +0.999  0.036  0.015  0.900
    +-0.036  0.999  0.000  0.000
    +-0.015 -0.001  1.000  2.000
    +0.000  0.000  0.000  1.000
    +
    +
    +
  • +
+ +
+

Note

+

In this step we will only add one sensor link. +You will have to repeat this step for every sensor you want to add to your Vehicle.

+
+

Let's say we want to add a LiDAR that is facing right.

+

We have the following configuration files.

+
base_link:
+    sensor_kit_base_link:
+        x: 0.9
+        y: 0.0
+        z: 2.0
+        roll: -0.001
+        pitch: 0.015
+        yaw: -0.0364
+
+
sensor_kit_base_link:
+    velodyne_right_base_link:
+        x: 0.0
+        y: -0.56362
+        z: -0.30555
+        roll: -0.01
+        pitch: 0.71
+        yaw: -1.580
+
+

We can clearly see the structure of transformation tree. +The transformations are as follows.

+
base_link -> sensor_kit_base_link -> velodyne_right_base_link
+
+

We need to start adding these transformation from the root of the tree. +We will start with the sensor_kit_base_link, as the base_link already exists in our tree.

+
    +
  1. +

    The first step is to add an Object named the same as the transformation frame (sensor_kit_base_link).

    +

    sensor kit base link add object

    +
  2. +
  3. +

    Next we have to convert the transformation from ROS standard to the Unity standard. + This is done with the formulas show in this section.

    +

    The result of conversion of the coordinate systems and units is shown below.

    +
    Position:
    +(0.9, 0.0, 2.0)             ->  (0.0, 2.0, 0.9)
    +Rotation:
    +(-0.001, 0.015, -0.0364)    ->  (0.8594, 2.0856, 0.0573)
    +
    +

    The resulting sensor_kit_base_link Object transformation is shown below.

    +

    sensor kit base link configuration

    +
  4. +
+

Now the same has to be done with the velodyne_right_base_link.

+
    +
  1. +

    Add transformation Object (velodyne_right_base_link).

    +
    +

    Info

    +

    Remember to correctly set the child Object, in this case we use sensor_kit_base_link as a child, because this is what the .yaml file says.

    +
    +

    velodyne right base link add object

    +
  2. +
  3. +

    Convert the transformation into Unity coordinate system.

    +

    The correct transformation is shown below.

    +
    Position:
    +(0, -0.56362, -0.30555)     ->  (0.56362, -0.30555, 0)
    +Rotation:
    +(-0.01, 0.71, -1.580)       ->  (40.68, 90.5273, 0.573)
    +
    +

    The final velodyne_right_base_link Object transformation is shown below.

    +

    velodyne right base link configuration

    +
  4. +
+
+

Success

+

If you have done everything right, after adding all of the sensor links your URDF Object tree should look something like the one following.

+

urdf sample configuration

+
+

Add sensors

+

After adding links for all sensors you need to add the actual sensors into your Vehicle.

+
+

Sensor position

+

Please keep in mind, that we have created the sensor links in order to have an accurate transformations for all of the sensors. +This implies that the Sensor Object itself can not have any transformation.

+

If one of your Sensors, after adding it to the scene, is mispositioned, check whether the transformation is set to identity (position and rotation are zeros).

+
+

When adding sensors almost all of them will have some common fields.

+
    +
  • +

    Frame Id

    +

    Frame Id is the name of frame of reference against which the received data will be interpreted by the autonomous driving software stack.

    +

    Remember that the Frame Id must exist internally in the ROS transformations tree.

    +
  • +
  • +

    Topics

    +

    Topics are names of broadcasting channels. +You can set the names of topics as you like and the data from sensors will be broadcasted on these topics.

    +

    Remember to configure your receiving end to listen on the same topics as broadcasting ones.

    +
  • +
  • +

    Quality Of Service settings (QOS settings)

    +

    Quality of service settings allow you to configure the behavior of the source node while broadcasting the sensor data. +You can adjust these settings to suit your needs.

    +
  • +
+

Add a Vehicle Status Sensor

+

To add a Vehicle Status Sensor to your Vehicle simply locate the following directory in the Project view and drag a prefab of this Sensor into the URDF Object.

+
Assets/AWSIM/Prefabs/Sensors
+
+

sensors add vehicle status sensor

+

Next in the Inspector View select your Vehicle.

+

vehicle status sensor configure

+
+ROS message example +

In this example you can see what a valid message from the Vehicle Status Sensor can look like.

+
$ ros2 topic echo --once /vehicle/status/velocity_status 
+header:
+  stamp:
+    sec: 17
+    nanosec: 709999604
+  frame_id: base_link
+longitudinal_velocity: 0.004912620410323143
+lateral_velocity: -0.005416259169578552
+heading_rate: 0.006338323466479778
+---
+
+
+

Add a LiDAR

+
+

Scene Manager

+

Before continuing with this tutorial please check out a dedicated one focused on Scene Manager.

+
+

To add a LiDAR to your Vehicle you will have to drag a model of the LiDAR to the link tree you have created in the earlier step.

+

You can use the predefined RGL LiDAR models or any other LiDAR models. +In this tutorial we will be using RGL VelodyneVLP16 LiDAR model.

+

Simply locate the following directory in the Project view and drag the prefab into the designated sensor link.

+
Assets/AWSIM/Prefabs/Sensors/RobotecGPULidars
+
+

sensors add lidar

+
+

LiDAR noise configuration

+

LiDAR Sensor in simulation is returning a perfect result data. +This is not an accurate representation of the real-world.

+

LiDAR Sensor addresses this issue by applying a simulated noise to the output data. +You can configure the noise parameters in the Inspector View under Configuration -> Noise Params fields.

+

You can optionally remove the noise simulation by unchecking the Apply Distance/Angular Gaussian Noise.

+

You can also change the ranges of the LiDAR detection.

+

lidar noise configuration

+

There is also a possibility to configure the visualization of the Point Cloud generated by the LiDAR. +E.g. change the hit-point shape and size.

+

lidar visualization configuration

+
+
+ROS message example +

In this example you can see what a valid message from the LiDAR Sensor can look like.

+
$ ros2 topic echo --once /lidar/pointcloud
+header:
+  stamp:
+    sec: 20
+    nanosec: 589999539
+  frame_id: world
+height: 1
+width: 14603
+fields:
+- name: x
+  offset: 0
+  datatype: 7
+  count: 1
+- name: y
+  offset: 4
+  datatype: 7
+  count: 1
+- name: z
+  offset: 8
+  datatype: 7
+  count: 1
+- name: intensity
+  offset: 16
+  datatype: 7
+  count: 1
+- name: ring
+  offset: 20
+  datatype: 4
+  count: 1
+is_bigendian: false
+point_step: 24
+row_step: 350472
+data:
+- 156
+- 218
+- 183
+- 62
+- 0
+- 189
+- 167
+- 187
+- 32
+- 58
+- 173
+- 189
+- 0
+- 0
+- 0
+- 0
+- 0
+- 0
+- 200
+- 66
+- 1
+- 0
+- 0
+- 0
+- 198
+- 129
+- 28
+- 63
+- 0
+- 6
+- 230
+- 58
+- 128
+- 184
+- 93
+- 61
+- 0
+- 0
+- 0
+- 0
+- 0
+- 0
+- 200
+- 66
+- 9
+- 0
+- 0
+- 0
+- 92
+- 2
+- 194
+- 62
+- 0
+- 141
+- 42
+- 187
+- 128
+- 89
+- 139
+- 189
+- 0
+- 0
+- 0
+- 0
+- 0
+- 0
+- 200
+- 66
+- 2
+- 0
+- 0
+- 0
+- 187
+- 168
+- 42
+- 63
+- 0
+- 159
+- 175
+- 59
+- 160
+- 243
+- 185
+- 61
+- 0
+- 0
+- 0
+- 0
+- 0
+- 0
+- 200
+- 66
+- 10
+- 0
+- 0
+- 0
+- 119
+- 186
+- 204
+- 62
+- 0
+- 254
+- 23
+- 59
+- 128
+- 143
+- 41
+- 189
+- 0
+- 0
+- 0
+- 0
+- 0
+- 0
+- 200
+- 66
+- 3
+- 0
+- 0
+- 0
+- 65
+- 241
+- 59
+- 63
+- 128
+- 0
+- 252
+- 187
+- '...'
+is_dense: true
+---
+
+
+

Add an IMU

+

To add an IMU to your Vehicle you will have to drag a model of the IMU to the link tree you have created in the earlier step.

+

You can use the provided or your own IMU Sensor. +In this tutorial we will be using IMU Sensor provided with AWSIM.

+

Simply locate the following directory in the Project view and drag the prefab into the designated sensor link.

+
Assets/AWSIM/Prefabs/Sensors
+
+

sensors add imu

+
+ROS message example +

In this example you can see what a valid message from the IMU Sensor can look like.

+
$ ros2 topic echo --once /sensing/imu/tamagawa/imu_raw 
+header:
+  stamp:
+    sec: 20
+    nanosec: 589999539
+  frame_id: tamagawa/imu_link
+orientation:
+  x: 0.0
+  y: 0.0
+  z: 0.0
+  w: 1.0
+orientation_covariance:
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+angular_velocity:
+  x: 0.014335081912577152
+  y: 0.008947336114943027
+  z: -0.008393825963139534
+angular_velocity_covariance:
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+linear_acceleration:
+  x: 0.006333829835057259
+  y: -0.005533283110707998
+  z: -0.0018753920448943973
+linear_acceleration_covariance:
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+- 0.0
+---
+
+
+

Add a GNSS

+

To add a GNSS Sensor to your Vehicle you will have to drag a model of the GNSS to the link tree you have created in the earlier step.

+

You can use the provided or your own GNSS Sensor. +In this tutorial we will be using GNSS Sensor provided with AWSIM.

+

Simply locate the following directory in the Project view and drag the prefab into the designated sensor link.

+
Assets/AWSIM/Prefabs/Sensors
+
+

sensors add gnss

+
+ROS message example +

In this example you can see what a valid message from the GNSS Sensor can look like.

+
$ ros2 topic echo --once /sensing/gnss/pose
+header:
+  stamp:
+    sec: 8
+    nanosec: 989999799
+  frame_id: gnss_link
+pose:
+  position:
+    x: 81656.765625
+    y: 50137.5859375
+    z: 44.60169219970703
+  orientation:
+    x: 0.0
+    y: 0.0
+    z: 0.0
+    w: 0.0
+---
+
+
+

Add a Camera

+

To add a Camera Sensor to your Vehicle you will have to drag a model of the Camera to the link tree you have created in the earlier step.

+

Simply locate the following directory in the Project view and drag the prefab into the designated sensor link.

+
Assets/AWSIM/Prefabs/Sensors
+
+

sensors add camera

+

You can configure some aspects of the Camera to your liking.

+

E.g. you can set the field of view (fov) of the camera by changing the Field of View field or manipulating the physical camera parameters like Focal Length.

+

camera component

+

The important thing is to configure the Camera Sensor Script correctly.

+

Always check whether the correct Camera Object is selected and make sure that Distortion Shader and Ros Image Shader are selected.

+
+

Example Camera Sensor Script configuration

+

camera sensor script

+
+

You can add the live Camera preview onto the Scene. +To do this select the Show checkbox. +Additionally you can change how the preview is displayed. +Change the Scale value to control the size of the preview (how many times smaller the preview will be compared to the actual screen size).

+

Move the preview on the screen by changing the X Axis and Y Axis values on the Image On Gui section.

+
+

Camera preview example

+

camera preview configuration

+
+
+

Testing camera with traffic light recognition

+

You can test the Camera Sensor traffic light recognition by positioning the vehicle on the Unity Scene in such a way that on the Camera preview you can see the traffic lights.

+

Remember to lock the Inspector view on Camera Object before dragging the whole Vehicle - this way you can see the preview while moving the vehicle.

+ +

position the vehicle

+

Run the Scene the same as on this page.

+

Launch only the Autoware like on this page.

+

By default you should see the preview of traffic light recognition visualization in the bottom left corner of Autoware.

+
+

Traffic lights recognition example in Autoware

+

traffic light recognition preview

+
+
+
+ROS message example +

In this example you can see what a valid message from the Camera Sensor can look like.

+
$ ros2 topic echo --once /sensing/camera/traffic_light/image_raw 
+header:
+  stamp:
+    sec: 14
+    nanosec: 619999673
+  frame_id: traffic_light_left_camera/camera_optical_link
+height: 1080
+width: 1920
+encoding: bgr8
+is_bigendian: 0
+step: 5760
+data:
+- 145
+- 126
+- 106
+- 145
+- 126
+- 106
+- 145
+- 126
+- 106
+- 145
+- 126
+- 105
+- 145
+- 126
+- 105
+- 145
+- 126
+- 105
+- 145
+- 126
+- 105
+- 145
+- 126
+- 105
+- 145
+- 126
+- 105
+- 145
+- 126
+- 105
+- 145
+- 126
+- 104
+- 145
+- 126
+- 104
+- 145
+- 126
+- 104
+- 145
+- 126
+- 104
+- 145
+- 126
+- 104
+- 145
+- 126
+- 104
+- 145
+- 126
+- 104
+- 145
+- 126
+- 104
+- 145
+- 126
+- 103
+- 145
+- 126
+- 103
+- 145
+- 126
+- 103
+- 145
+- 126
+- 103
+- 145
+- 126
+- 103
+- 145
+- 126
+- 103
+- 145
+- 126
+- 103
+- 145
+- 126
+- 103
+- 145
+- 126
+- 103
+- 145
+- 126
+- 103
+- 145
+- 124
+- 103
+- 145
+- 124
+- 103
+- 145
+- 124
+- 103
+- 145
+- 124
+- 103
+- 145
+- 124
+- 103
+- 145
+- 124
+- 103
+- 145
+- 124
+- 103
+- 145
+- 124
+- 101
+- 145
+- 124
+- 101
+- 145
+- 124
+- 101
+- 145
+- 124
+- 101
+- 145
+- 123
+- 101
+- 145
+- 123
+- 101
+- 145
+- 123
+- 101
+- 145
+- 123
+- '...'
+---
+
+
+

Add a Pose Sensor

+

To add a Pose Sensor to your Vehicle simply locate the following directory in the Project view and drag a prefab of this Sensor into the base_link Object.

+
Assets/AWSIM/Prefabs/Sensors
+
+

pose sensor add prefab

+
+ROS message example +

In this example you can see what a valid message from the Pose Sensor can look like.

+
$ ros2 topic echo --once /awsim/ground_truth/vehicle/pose 
+header:
+  stamp:
+    sec: 5
+    nanosec: 389999879
+  frame_id: base_link
+pose:
+  position:
+    x: 81655.7578125
+    y: 50137.3515625
+    z: 42.8094367980957
+  orientation:
+    x: -0.03631274029612541
+    y: 0.0392342209815979
+    z: 0.02319677732884884
+    w: 0.9983005523681641
+---
+
+
+

Test a Sensor

+

You can test whether the Sensor works correctly in several ways.

+
    +
  1. +

    Check whether the configuration is correct.

    +

    In terminal source ROS with the following line (only if you haven't done so already).

    +
    source /opt/ros/humble/setup.bash
    +
    +

    Check the details about the topic that your Sensor is broadcasting to with the following command.

    +
    ros2 topic info -v <topic_name>
    +
    +
    +

    Example

    +

    In this example we can see that the message is broadcasted by AWSIM and nobody is listening. +We can also examine the Quality of Service settings.

    +
    $ ros2 topic info -v /awsim/ground_truth/vehicle/pose
    +Type: geometry_msgs/msg/PoseStamped
    +
    +Publisher count: 1
    +
    +Node name: AWSIM
    +Node namespace: /
    +Topic type: geometry_msgs/msg/PoseStamped
    +Endpoint type: PUBLISHER
    +GID: 01.10.13.11.98.7a.b1.2a.ee.a3.5a.11.00.00.07.03.00.00.00.00.00.00.00.00
    +QoS profile:
    +  Reliability: RELIABLE
    +  History (Depth): KEEP_LAST (1)
    +  Durability: VOLATILE
    +  Lifespan: Infinite
    +  Deadline: Infinite
    +  Liveliness: AUTOMATIC
    +  Liveliness lease duration: Infinite
    +
    +Subscription count: 0
    +
    +
    +
  2. +
  3. +

    Check whether correct information is broadcasted.

    +

    In terminal source ROS with the following line (only if you haven't done so already).

    +
    source /opt/ros/humble/setup.bash
    +
    +

    View one transmitted message.

    +
    ros2 topic echo --once <topic_name>
    +
    +
    +

    Example

    +

    In this example we can see the Vehicles location at the moment of executing the command.

    +

    NOTE: The position and orientation are relative to the frame in the header/frame_id field (base_link in this example).

    +
    $ ros2 topic echo --once /awsim/ground_truth/vehicle/pose
    +header:
    +  stamp:
    +    sec: 46
    +    nanosec: 959998950
    +  frame_id: base_link
    +pose:
    +  position:
    +    x: 81655.7265625
    +    y: 50137.4296875
    +    z: 42.53997802734375
    +  orientation:
    +    x: 0.0
    +    y: -9.313260163068549e-10
    +    z: -6.36646204504876e-12
    +    w: 1.0
    +---
    +
    +
    +
  4. +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/lidar_sensor_script_configuration.png b/Components/Vehicle/AddNewVehicle/AddSensors/lidar_sensor_script_configuration.png new file mode 100644 index 0000000000..24c0705198 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/lidar_sensor_script_configuration.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/point_cloud_visualization_configuration.png b/Components/Vehicle/AddNewVehicle/AddSensors/point_cloud_visualization_configuration.png new file mode 100644 index 0000000000..a3d1493e7c Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/point_cloud_visualization_configuration.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/pose_sensor_add_prefab.gif b/Components/Vehicle/AddNewVehicle/AddSensors/pose_sensor_add_prefab.gif new file mode 100644 index 0000000000..e04e17ab0d Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/pose_sensor_add_prefab.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/sensor_kit_base_link_add_object.gif b/Components/Vehicle/AddNewVehicle/AddSensors/sensor_kit_base_link_add_object.gif new file mode 100644 index 0000000000..a34ad75709 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/sensor_kit_base_link_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/sensor_kit_base_link_configured.png b/Components/Vehicle/AddNewVehicle/AddSensors/sensor_kit_base_link_configured.png new file mode 100644 index 0000000000..85c8036189 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/sensor_kit_base_link_configured.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_camera.gif b/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_camera.gif new file mode 100644 index 0000000000..b0a4c3c05e Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_camera.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_gnss.gif b/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_gnss.gif new file mode 100644 index 0000000000..d76f398ed5 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_gnss.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_imu.gif b/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_imu.gif new file mode 100644 index 0000000000..76859547bc Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_imu.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_lidar.gif b/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_lidar.gif new file mode 100644 index 0000000000..50dbbe409d Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_lidar.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_vehicle_status.gif b/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_vehicle_status.gif new file mode 100644 index 0000000000..7cbd91b0b6 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/sensors_add_vehicle_status.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/traffic_light_recognition.png b/Components/Vehicle/AddNewVehicle/AddSensors/traffic_light_recognition.png new file mode 100644 index 0000000000..f4ca86e762 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/traffic_light_recognition.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/urdf_example_configuration.png b/Components/Vehicle/AddNewVehicle/AddSensors/urdf_example_configuration.png new file mode 100644 index 0000000000..e04cf27ebf Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/urdf_example_configuration.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/vehicle_position.gif b/Components/Vehicle/AddNewVehicle/AddSensors/vehicle_position.gif new file mode 100644 index 0000000000..be8554ce46 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/vehicle_position.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/vehicle_status_sensor_configure.gif b/Components/Vehicle/AddNewVehicle/AddSensors/vehicle_status_sensor_configure.gif new file mode 100644 index 0000000000..2141aee91b Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/vehicle_status_sensor_configure.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/velodyne_right_base_link_add_object.gif b/Components/Vehicle/AddNewVehicle/AddSensors/velodyne_right_base_link_add_object.gif new file mode 100644 index 0000000000..feca2cb7e0 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/velodyne_right_base_link_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddSensors/velodyne_right_base_link_configured.png b/Components/Vehicle/AddNewVehicle/AddSensors/velodyne_right_base_link_configured.png new file mode 100644 index 0000000000..155c4c263b Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddSensors/velodyne_right_base_link_configured.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/body_add_object.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/body_add_object.gif new file mode 100644 index 0000000000..e315ced717 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/body_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/body_car_add_mesh_filter.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/body_car_add_mesh_filter.gif new file mode 100644 index 0000000000..244f264f39 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/body_car_add_mesh_filter.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/body_car_add_mesh_renderer.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/body_car_add_mesh_renderer.gif new file mode 100644 index 0000000000..e3cafc9b17 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/body_car_add_mesh_renderer.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/body_car_add_object.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/body_car_add_object.gif new file mode 100644 index 0000000000..f20d3faa56 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/body_car_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/break_light_add_mesh_filter.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/break_light_add_mesh_filter.gif new file mode 100644 index 0000000000..fd01387dcb Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/break_light_add_mesh_filter.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/break_light_add_mesh_renderer.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/break_light_add_mesh_renderer.gif new file mode 100644 index 0000000000..42b79a91b8 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/break_light_add_mesh_renderer.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/break_light_add_object.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/break_light_add_object.gif new file mode 100644 index 0000000000..6c5b6e6f31 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/break_light_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/ego_vehicle_add_models.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/ego_vehicle_add_models.gif new file mode 100644 index 0000000000..ade6b34870 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/ego_vehicle_add_models.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/front_left_wheel_add_object.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/front_left_wheel_add_object.gif new file mode 100644 index 0000000000..4cd9faa9d8 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/front_left_wheel_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/front_left_wheel_set_position.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/front_left_wheel_set_position.gif new file mode 100644 index 0000000000..a79598b142 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/front_left_wheel_set_position.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/index.html b/Components/Vehicle/AddNewVehicle/AddVisualElements/index.html new file mode 100644 index 0000000000..922b0faa06 --- /dev/null +++ b/Components/Vehicle/AddNewVehicle/AddVisualElements/index.html @@ -0,0 +1,2681 @@ + + + + + + + + + + + + + + + + + + + + + + + Add Visual Elements - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Add Visual Elements

+ +

Your EgoVehicle needs many individual visual parts. +Below we will add all needed visual elements.

+

First in EgoVehicle Object add a child Object called Models.

+

ego vehicle add models

+

Inside Models Object we will add all visual models of our EgoVehicle.

+

Add a Body

+

First you will need to add a Body of your Vehicle. +It will contain many parts, so first lets create a Body parent Object.

+

body add object

+

Next we will need to add Car Body

+
    +
  1. +

    Add a child Object BodyCar to the Body Object.

    +

    body car add object

    +
  2. +
  3. +

    To the BodyCar Object add a Mesh Filter.

    +

    Click on the 'Add Component' button, search for Mesh Filter and select it. +Next search for mesh of your vehicle and select it in the Mesh field.

    +

    body car add mesh filter

    +

    mesh filter add component

    +
  4. +
  5. +

    To the BodyCar Object add a Mesh Renderer.

    +

    Click on the 'Add Component' button, search for Mesh Filter and select it

    +

    body car add mesh renderer

    +

    mesh renderer add component

    +
  6. +
  7. +

    Specify Materials.

    +

    You need to specify what materials will be used for rendering your EgoVehicle model. +Do this by adding elements to the Materials list and selecting the materials you wish to use as shown below.

    +

    mesh renderer add materials

    +

    Add as many materials as your model has sub-meshes.

    +
    +

    Tip

    +

    When you add too many materials, meaning there will be no sub-meshes to apply these materials to, you will see this warning. +In such a case please remove materials until this warning disappears.

    +

    mesh renderer too many materials

    +
    +
  8. +
+

Add interactive Body parts

+

In this step we will add the following parts

+
    +
  • Break light
  • +
  • Reverse Light
  • +
  • Right Turn Signal
  • +
  • Left Turn Signal
  • +
  • (optional) other visual elements required specifically by your Vehicle.
  • +
+
+

Info

+

It may seem like all of the elements above can be parts of the Body mesh, but it is important for these parts to be separate, because we need to be able to make them interactive (e.g. flashing turn signals).

+

Other good reason for having different meshes for Vehicle parts is that you have a Vehicle model, but for the simulation you need to add e.g. a roof rack with sensors - which can be achieved by adding more meshes.

+
+
+

Note

+

We will illustrate this step only for Break Light, but you should repeat this step of the tutorial for each element of the list above.

+
+
    +
  1. +

    Add a child Object to the Body Object.

    +

    break light add object

    +
  2. +
  3. +

    Add a Mesh Filter and select the mesh (the same as in section before).

    +

    break light add mesh filter

    +

    mesh filter search

    +
  4. +
  5. +

    Add a Mesh Renderer and select the materials (the same as in section before).

    +

    break light add mesh renderer

    +

    mesh renderer search

    +
  6. +
+

Add Wheels

+

In this step we will add individual visuals for every wheel. +This process is very similar to the one before.

+
    +
  1. +

    Add a child Object to the Models Object called WheelVisuals.

    +

    wheel visuals add object

    +
  2. +
+
+

Note

+

In this tutorial we will add only one wheel, but you should repeat the step for all 4 wheels. +That is, follow the instructions that follow this message for every wheel your Vehicle has.

+
    +
  • Front Left Wheel
  • +
  • Front Right Wheel
  • +
  • Rear Left Wheel
  • +
  • Rear Right Wheel
  • +
+
+
    +
  1. +

    Add a child Object to the WheelVisuals Object called FrontLeftWheel.

    +

    front left wheel add object

    +
  2. +
  3. +

    Add a child Object to the FrontLeftWheel Object called WheelFrontL. + This Object will contain the actual wheel part.

    +

    wheel front l add object

    +
  4. +
  5. +

    Add a Mesh Filter and select the wheel mesh.

    +

    wheel front l add mesh filter

    +

    wheel front l configure mesh filter

    +
  6. +
  7. +

    Add a Mesh Renderer and select the wheel materials.

    +

    wheel front l add mesh renderer

    +

    wheel front l configure mesh renderer 1

    +

    wheel front l configure mesh renderer 2

    +
  8. +
  9. +

    Repeat the steps before to add Breaks.

    +

    The same way you have added the WheelFrontL Object now add the WheelFrontLBreaks. +Naturally you will have to adjust the mesh and materials used as they will be different for breaks than for the wheel.

    +

    Your final break configuration should look similar to the one following.

    +

    wheel front l breaks configured

    +
  10. +
  11. +

    Set the FrontLeftWheel parent Object transformation to position the wheel in correct place.

    +

    front left wheel set position

    +
  12. +
+
+

Successful configuration

+

If you have done everything right your WheelVisuals Object should look similar to the one following.

+

wheel visuals configured

+
+

Move the models

+

The last step to correctly configure Vehicle models is to shift them so that the EgoVehicle origin is in the center of fixed axis.

+

This means you need to shift the whole Models Object accordingly (change the position fields in transformation).

+
+

Tip

+

Add a dummy Object as a child to the EgoVehicle Object (the same as in steps before) so it is located in the origin of the EgoVehicle.

+

Now move Models around relative to the dummy - change position in the Inspector view. +The dummy will help you see when the fixed axis (in case of the Lexus from example it is the rear axis) is aligned with origin of EgoVehicle.

+

In the end delete the dummy Object as it is no longer needed.

+

models shift w dummy

+
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/mesh_filter_search.png b/Components/Vehicle/AddNewVehicle/AddVisualElements/mesh_filter_search.png new file mode 100644 index 0000000000..e48797a8de Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/mesh_filter_search.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/mesh_renderer_add_materials.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/mesh_renderer_add_materials.gif new file mode 100644 index 0000000000..93a793be1a Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/mesh_renderer_add_materials.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/mesh_renderer_search.png b/Components/Vehicle/AddNewVehicle/AddVisualElements/mesh_renderer_search.png new file mode 100644 index 0000000000..cbc3562bd0 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/mesh_renderer_search.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/mesh_renderer_too_many_materials.png b/Components/Vehicle/AddNewVehicle/AddVisualElements/mesh_renderer_too_many_materials.png new file mode 100644 index 0000000000..f38cb388f4 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/mesh_renderer_too_many_materials.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/models_shift_w_dummy.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/models_shift_w_dummy.gif new file mode 100644 index 0000000000..8608c3a04b Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/models_shift_w_dummy.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_add_mesh_filter_component.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_add_mesh_filter_component.gif new file mode 100644 index 0000000000..28375233b8 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_add_mesh_filter_component.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_add_mesh_renderer_component.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_add_mesh_renderer_component.gif new file mode 100644 index 0000000000..0a73cb1b5a Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_add_mesh_renderer_component.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_add_object.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_add_object.gif new file mode 100644 index 0000000000..f542619f7b Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_breaks_configured.png b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_breaks_configured.png new file mode 100644 index 0000000000..3da2c92665 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_breaks_configured.png differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_configure_mesh_filter_component.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_configure_mesh_filter_component.gif new file mode 100644 index 0000000000..61263f073d Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_configure_mesh_filter_component.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_configure_mesh_renderer_component1.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_configure_mesh_renderer_component1.gif new file mode 100644 index 0000000000..68562f11b5 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_configure_mesh_renderer_component1.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_configure_mesh_renderer_component2.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_configure_mesh_renderer_component2.gif new file mode 100644 index 0000000000..fb6eca56c8 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_front_l_configure_mesh_renderer_component2.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_visuals_add_object.gif b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_visuals_add_object.gif new file mode 100644 index 0000000000..3fe8003ce4 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_visuals_add_object.gif differ diff --git a/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_visuals_configured.png b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_visuals_configured.png new file mode 100644 index 0000000000..d2fb362c08 Binary files /dev/null and b/Components/Vehicle/AddNewVehicle/AddVisualElements/wheel_visuals_configured.png differ diff --git a/Components/Vehicle/CustomizeSlip/image.png b/Components/Vehicle/CustomizeSlip/image.png new file mode 100644 index 0000000000..8e68de2bc4 Binary files /dev/null and b/Components/Vehicle/CustomizeSlip/image.png differ diff --git a/Components/Vehicle/CustomizeSlip/index.html b/Components/Vehicle/CustomizeSlip/index.html new file mode 100644 index 0000000000..f041f9daee --- /dev/null +++ b/Components/Vehicle/CustomizeSlip/index.html @@ -0,0 +1,2513 @@ + + + + + + + + + + + + + + + + + + + + + + + Customize Slip - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Customize slip

+

By attaching a GroundSlipMutiplier.cs script to a collider (trigger), you can change the slip of the vehicle within the range of that collider.

+

Sample scene

+

Assets\AWSIM\Scenes\Samples\VehicleSlipSample.unity

+

How to setup

+
    +
  1. Create collider
  2. +
  3. Check IsTrigger
  4. +
  5. Change properties of FowardSlip and SidewaySlip.
  6. +
+

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Vehicle/EgoVehicle/collider.png b/Components/Vehicle/EgoVehicle/collider.png new file mode 100644 index 0000000000..4163a4aa1a Binary files /dev/null and b/Components/Vehicle/EgoVehicle/collider.png differ diff --git a/Components/Vehicle/EgoVehicle/collider_example.png b/Components/Vehicle/EgoVehicle/collider_example.png new file mode 100644 index 0000000000..b61ffe8852 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/collider_example.png differ diff --git a/Components/Vehicle/EgoVehicle/colliders_link.png b/Components/Vehicle/EgoVehicle/colliders_link.png new file mode 100644 index 0000000000..a5fe0085ad Binary files /dev/null and b/Components/Vehicle/EgoVehicle/colliders_link.png differ diff --git a/Components/Vehicle/EgoVehicle/com.png b/Components/Vehicle/EgoVehicle/com.png new file mode 100644 index 0000000000..0e0d6011bd Binary files /dev/null and b/Components/Vehicle/EgoVehicle/com.png differ diff --git a/Components/Vehicle/EgoVehicle/com_2.png b/Components/Vehicle/EgoVehicle/com_2.png new file mode 100644 index 0000000000..a3da3b77c9 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/com_2.png differ diff --git a/Components/Vehicle/EgoVehicle/ego_vehicle_flow.drawio b/Components/Vehicle/EgoVehicle/ego_vehicle_flow.drawio new file mode 100644 index 0000000000..a947f96cde --- /dev/null +++ b/Components/Vehicle/EgoVehicle/ego_vehicle_flow.drawio @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Components/Vehicle/EgoVehicle/ego_vehicle_flow.png b/Components/Vehicle/EgoVehicle/ego_vehicle_flow.png new file mode 100644 index 0000000000..4e61badbd6 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/ego_vehicle_flow.png differ diff --git a/Components/Vehicle/EgoVehicle/ego_vehicle_sequence.drawio b/Components/Vehicle/EgoVehicle/ego_vehicle_sequence.drawio new file mode 100644 index 0000000000..ebef5f935d --- /dev/null +++ b/Components/Vehicle/EgoVehicle/ego_vehicle_sequence.drawio @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Components/Vehicle/EgoVehicle/ego_vehicle_sequence.png b/Components/Vehicle/EgoVehicle/ego_vehicle_sequence.png new file mode 100644 index 0000000000..3463558cd6 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/ego_vehicle_sequence.png differ diff --git a/Components/Vehicle/EgoVehicle/fbx.png b/Components/Vehicle/EgoVehicle/fbx.png new file mode 100644 index 0000000000..0eff42c1c7 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/fbx.png differ diff --git a/Components/Vehicle/EgoVehicle/index.html b/Components/Vehicle/EgoVehicle/index.html new file mode 100644 index 0000000000..32613991f4 --- /dev/null +++ b/Components/Vehicle/EgoVehicle/index.html @@ -0,0 +1,3521 @@ + + + + + + + + + + + + + + + + + + + + + + + Ego Vehicle - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Ego Vehicle

+ +

Introduction

+

EgoVehicle is a playable object that simulates a vehicle that can autonomously move around the scene. +It has components (scripts) that make it possible to control it by keyboard or by Autoware (using ROS2 communication). Moreover, it provides sensory data needed for self-localization in space and detection of objects in the surrounding environment.

+

The default prefab EgoVehicle was developed using a Lexus RX450h 2015 vehicle model with a configured sample sensor kit.

+

vehicle

+
+

Own EgoVehicle prefab

+

If you would like to develop your own EgoVehicle prefab, we encourage you to read this tutorial.

+
+

Supported features

+

This vehicle model was created for Autoware simulation, and assuming that Autoware has already created a gas pedal map, +this vehicle model uses acceleration as an input value. +It has the following features:

+
    +
  • Longitudinal control by acceleration (\(\frac{m}{s^2}\)).
  • +
  • Lateral control by two-wheel model.
  • +
  • Yaw, roll and pitch controlled by Physics engine.
  • +
  • Mass-spring-damper suspension model (WheelColliders).
  • +
  • Logical, not mechanical, automatic gears change.
  • +
  • 3D Mesh (*.fbx) as road surface for vehicle driving, gradient resistance.
  • +
+
+

AutowareSimulation

+

If you would like to see how EgoVehicle works or run some tests, we encourage you to familiarize yourself with the AutowareSimulation scene described in this section.

+
+

Lexus RX450h 2015 parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValueUnit
Mass\(1500\)\(kg\)
Wheel base\(2.5\)\(m\)
Tread width\(Ft = 1.8; Rr = 1.8\)\(m\)
Center of Mass position\(x = 0; y = 0.5; z = 0\)\(m\)
Moment of inertia\(\mathrm{yaw} = 2000; \mathrm{roll} = 2000; \mathrm{pitch} = 700\)\(kg \cdot m^2\)
Spring rate\(Ft = 55000; Rr = 48000\)\(N\)
Damper rate\(Ft = 3000; Rr = 2500\)\(\frac{N}{s}\)
Suspension stroke\(Ft = 0.2; Rr = 0.2\)\(m\)
Wheel radius\(0.365\)\(m\)
+
+

Vehicle inertia

+

In general, measuring the moment of inertia is not easy, and past papers published by NHTSA are helpful.
+Measured Vehicle Inertial Parameters - NHTSA 1998

+
+

Prefab and Fbx

+

Prefab can be found under the following path:

+
Assets/AWSIM/Prefabs/NPCs/Vehicles/Lexus RX450h 2015 Sample Sensor.prefab
+
+
+

EgoVehicle name

+

In order to standardize the documentation, the name EgoVehicle will be used in this section as the equivalent of the prefab named Lexus RX450h 2015 2015 Sample Sensor.

+
+

EgoVehicle prefab has the following content:

+

prefab_link

+

As you can see, it consists of 3 parents for GameObjects:

+
    +
  • Models - aggregating visual elements,
  • +
  • Colliders - aggregating colliders,
  • +
  • URDF - aggregating sensors,
  • +
  • and 2 single GameObjects: CoM and Reflection Probe.
  • +
+

All objects are described in the sections below.

+

Visual elements

+

Prefab is developed using models available in the form of *.fbx files. +The visuals elements have been loaded from the appropriate *.fbx file and are aggregated and added in object Models.

+

*.fbx file for Lexus RX450h 2015 is located under the following path:

+
Assets/AWSIM/Models/Vehicles/Lexus RX450h 2015.fbx
+
+

Models object has the following content:

+

models_link

+

As you can see, the additional visual element is XX1 Sensor Kit.

+

sensor_kit

+

It was also loaded from the *.fbx file which can be found under the following path:

+
Assets/AWSIM/Models/Sensors/XX1 Sensor Kit.fbx
+
+
+

Lexus RX450h 2015.fbx

+

The content of a sample *.fbx file is presented below, all elements except Collider have been added to the prefab as visual elements of the vehicle. +Collider is used as the Mesh source for the Mesh Collider in the BodyCollider object.

+

fbx

+
+ +

The default scene contains a single Lexus RX450h 2015 Sample Sensor prefab that is added as a child of the EgoVehicle GameObject.

+

scene_link

+

In EgoVehicle prefab, the local coordinate system of the vehicle (main prefab link) should be defined in the axis of the rear wheels projected onto the ground - in the middle of the distance between them. +This aspect holds significance when characterizing the dynamics of the object, as it provides convenience in terms of describing its motion and control.

+

+

+

Components

+

prefab

+

There are several components responsible for the full functionality of Vehicle:

+
    +
  • Rigidbody - ensures that the object is controlled by the physics engine in Unity - e.g. pulled downward by gravity.
  • +
  • Vehicle (script) - provides the ability to set the acceleration of the vehicle and the steering angle of its wheels.
  • +
  • Vehicle Keyboard Input (script) - provides the ability to set inputs in the Vehicle (script) via the keyboard.
  • +
  • Vehicle Ros Input (script) - provides the ability to set inputs in the Vehicle (script) via subscribed ROS2 topics (outputs from Autoware).
  • +
  • Vehicle Visual Effect - provides the ability to simulate vehicle lights, such as turn signals, brake lights, and hazard light.
  • +
+

Scripts can be found under the following path:

+
Assets/AWSIM/Scripts/Vehicles/*
+
+

Architecture

+

The EgoVehicle architecture - with dependencies - is presented on the following diagram.

+

ego vehicle structure diagram

+

The communication between EgoVehicle components is presented on two different diagrams - a flow diagram and a sequence diagram.

+

The flow diagram presents a flow of information between the EgoVehicle components.

+

ego vehicle flow diagram

+

The sequence diagram provides a deeper insight in how the communication is structured and what are the steps taken by each component. +Some tasks performed by the elements are presented for clarification.

+

ego vehicle sequence diagram

+
+

Sequence diagram

+

Please keep in mind, that Autoware message callbacks and the update loop present on the sequence diagram are executed independently and concurrently. +One thing they have in common are resources - the Vehicle (script).

+
+

CoM

+

CoM (Center of Mass) is an additional link that is defined to set the center of mass in the Rigidbody. +The Vehicle (script) is responsible for its assignment. +This measure should be defined in accordance with reality. +Most often, the center of mass of the vehicle is located in its center, at the height of its wheel axis - as shown below.

+

+

+

Colliders

+

Colliders are used to ensure collision between objects. +In EgoVehicle, the main Collider collider and colliders in Wheels GameObject for each wheel were added.

+

Colliders object has the following content:

+

colliders_link

+

BodyCollider

+

collider

+

Collider is a vehicle object responsible for ensuring collision with other objects. +Additionally, it can be used to detect these collisions. +The MeshCollider takes a Mesh of object and builds its Collider based on it. +The Mesh for the Collider was also loaded from the *.fbx file similarly to the visual elements.

+

collider_example

+

Wheels Colliders

+

wheel_collider

+

WheelsColliders are an essential elements from the point of view of driving vehicles on the road. +They are the only ones that have contact with the roads and it is important that they are properly configured. +Each vehicle, apart from the visual elements related to the wheels, should also have 4 colliders - one for each wheel.

+

Wheel (script) provides a reference to the collider and visual object for the particular wheel. +Thanks to this, the Vehicle (script) has the ability to perform certain actions on each of the wheels, such as:

+
    +
  • +

    update the steering angle in WheelCollider,

    +
  • +
  • +

    update the visual part of the wheel depending on the speed and angle of the turn,

    +
  • +
  • +

    update the wheel contact information stored in the WheelHit object,

    +
  • +
  • +

    update the force exerted by the tire forward and sideways depending on the acceleration (including cancellation of skidding),

    +
  • +
  • +

    ensure setting the tire sleep (it is impossible to put Rigidbody to sleep, but putting all wheels to sleep allows to get closer to this effect).

    +
  • +
+

Wheel Collider Config (script) has been developed to prevent inspector entry for WheelCollider which ensures that friction is set to 0 and only wheel suspension and collisions are enabled.

+

wheel_collider_example

+
+

Wheel Collider Config

+

For a better understanding of the meaning of WheelCollider we encourage you to read this manual.

+
+

Rigidbody

+

rigidbody

+

Rigidbody ensures that the object is controlled by the physics engine. +The Mass of the vehicle should approximate its actual weight. +In order for the vehicle to physically interact with other objects - react to collisions, Is Kinematic must be turned off. +The Use Gravity should be turned on - to ensure the correct behavior of the body during movement. +In addition, Interpolate should be turned on to ensure the physics engine's effects are smoothed out.

+

Reflection Probe

+

reflection

+

Reflection Probe is added to EgoVehicle prefab to simulate realistic reflections in a scene. +It is a component that captures and stores information about the surrounding environment and uses that information to generate accurate reflections on objects in real-time. +The values in the component are set as default.

+

HD Additional Reflection Data (script) is additional component used to store settings for HDRP's reflection probes and is added automatically.

+

URDF and Sensors

+

urdf_link

+

URDF (Unified Robot Description Format) is equivalent to the simplified URDF format used in ROS2. +This format allows to define the positions of all sensors of the vehicle in relation to its local coordinate system. +URDF is built using multiple GameObjects as children appropriately transformed with relation to its parent.

+

A detailed description of the URDF structure and sensors added to prefab Lexus RX450h 2015 is available in this section.

+

Vehicle (script)

+

script

+

Vehicle (script) provides an inputs that allows the EgoVehicle to move. +Script inputs provides the ability to set the acceleration of the vehicle and the steering angle of its wheels, taking into account the effects of suspension and gravity. +It also provides an input to set the gear in the gearbox and to control the turn signals. +Script inputs can be set by one of the following scripts: Vehicle Ros Input (script) or Vehicle Keyboard Input (script).

+

The script performs several steps periodically:

+
    +
  • checks whether the current inputs meet the set limits and adjusts them within them,
  • +
  • calculates the current linear velocity, angular velocity vector and local acceleration vector,
  • +
  • set the current steering angle in the script for each wheel and perform their updates,
  • +
  • if the current gear is PARKING and the vehicle is stopped (its speed and acceleration are below the set thresholds), it puts the vehicle (Rigidbody) and its wheels (Wheel (script)) to sleep,
  • +
  • if the vehicle has not been put to sleep, it sets the current acceleration to each with the appropriate sign depending on the DRIVE and REVERSE gear.
  • +
+

Elements configurable from the editor level

+

The script uses the CoM link reference to assign the center of mass of the vehicle to the Rigidbody. +In addiction, Use inertia allows to define the inertia tensor for component Rigidbody - by default it is disabled.

+

Physics Settings - allows to set values used to control vehicle physics:

+
    +
  • Sleep Velocity Threshold - velocity threshold used to put vehicle to sleep,
  • +
  • Sleep Time Threshold - time threshold for which the vehicle must not exceed the Sleep Velocity Threshold, have contact with the ground and a set acceleration input equal to zero,
  • +
  • Skidding Cancel Rate - coefficient that determines the rate at which skidding is canceled, affects the anti-skid force of the wheels - the higher the value, the faster the cancellation of the skid.
  • +
+

Axles Settings contains references to (Wheel (script)) scripts to control each wheel. +Thanks to them, the Vehicle (script) is able to set their steering angle and accelerations.

+

Input Settings - allows to set limits for values on script input:

+
    +
  • Max Steer Angle Input - maximum value of acceleration set by the script (also negative),
  • +
  • Max Acceleration Input - maximum steering angle of the wheels set by the script (also negative).
  • +
+

Inputs - are only used as a preview of the currently set values in the script input:

+

input

+

Input Data

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryTypeDescription
AccelerationInputfloatAcceleration input (m/s^2). On the plane, output the force that will result in this acceleration. On a slope, it is affected by the slope resistance, so it does not match the input.
SteerAngleInputfloatVehicle steering input (degree). Negative steers left, positive right
AutomaticShiftInputenumerationVehicle gear shift input (AT).
Values: PARKING, REVERSE, NEUTRAL, DRIVE.
SignalInputenumerationVehicle turn signal input.
Values: NONE, LEFT, RIGHT, HAZARD.
+

Output data

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryTypeDescription
LocalAccelerationVector3Acceleration(m/s^2) in the local coordinate system of the vehicle
SpeedfloatVehicle speed (m/s).
SteerAnglefloatVehicle steering angle (degree).
SignalenumerationVehicle turn signal.
VelocityVector3Vehicle velocity (m/s)
LocalVelocityVector3Vehicle local velocity (m/s)
AngularVelocityVector3Vehicle angular velocity (rad/s)
+

The acceleration or deceleration of the vehicle is determined by AutomaticShiftInput and AccelerationInput. +The vehicle will not move in the opposite direction of the (DRIVE or REVERSE) input.

+
+

Example

+

Sample vehicle behaves:

+
    +
  • +

    Sample 1 - vehicle will accelerate with input values (gradient resistance is received).

    +
    AutomaticShiftInput = DRIVE
    +Speed = Any value
    +AccelerationInput > 0
    +
    +
  • +
  • +

    Sample 2 - vehicle will decelerate (like a brake).

    +
    AutomaticShiftInput = DRIVE
    +Speed > 0
    +AccelerationInput < 0
    +
    +
  • +
  • +

    Sample 3 - vehicle will continuously stop.

    +
    AutomaticShiftInput = DRIVE
    +Speed <= 0
    +AccelerationInput < 0
    +
    +
  • +
+
+

Vehicle Ros (script)

+

script_ros

+

Vehicle Ros (script) is responsible for subscribing to messages that are vehicle control commands. +The values read from the message are set on the inputs of the Vehicle (script) script.

+

The concept for vehicle dynamics is suitable for Autoware's autoware_auto_control_msgs/AckermannControlCommand and autoware_auto_vehicle_msgs/GearCommand messages interface usage. +The script sets gear, steering angle of wheels and acceleration of the vehicle (read from the aforementioned messages) to the Vehicle (script) input. +In the case of VehicleEmergencyStamped message it sets the absolute acceleration equal to 0. +In addition, also through Vehicle (script), the appropriate lights are turned on and off depending on TurnIndicatorsCommand and HazardLightsCommand messages.

+

Elements configurable from the editor level

+
    +
  • * Command Topic - topic on which suitable type of information is subscribed (default: listed in the table below)
  • +
  • QoS- Quality of service profile used in the publication (default assumed as "system_default": Reliable, TransientLocal, Keep last/1)
  • +
  • Vehicle - reference to a script in the vehicle object where the subscribed values are to be set (default: None)
  • +
+

Subscribed Topics

+
    +
  • QoS: Reliable, TransientLocal, KeepLast/1
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryTopicMessage typeFrequency (Autoware dependent)
TurnIndicatorsCommand/control/command/turn_indicators_cmdautoware_auto_vehicle_msgs/TurnIndicatorsCommand10
HazardLightsCommand/control/command/hazard_lights_cmdautoware_auto_vehicle_msgs/HazardLightsCommand10
AckermannControlCommand/control/command/control_cmdautoware_auto_control_msgs/AckermannControlCommand60
GearCommand/control/command/gear_cmdautoware_auto_vehicle_msgs/GearCommand10
VehicleEmergencyStamped/control/command/emergency_cmdtier4_vehicle_msgs/msg/VehicleEmergencyStamped60
+
+

ROS2 Topics

+

If you would like to know all the topics used in communication Autoware with AWSIM, we encourage you to familiarize yourself with this section

+
+

Vehicle Keyboard (script)

+

script_keyboard

+

Vehicle Keyboard (script) allows EgoVehicle to be controlled by the keyboard. +Thanks to this, it is possible to switch on the appropriate gear of the gearbox, turn the lights on/off, set the acceleration and steering of the wheels. +It's all set in the Vehicle (script) of the object assigned in the Vehicle field. +The table below shows the available control options.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ButtonOption
dSwitch to move forward (drive gear)
rSwitch to move backwards (reverse gear)
nSwitch to neutral
pSwitch to parking gear
UP ARROWForward acceleration
DOWN ARROWReverse acceleration (decelerate)
LEFT/RIGHT ARROWTurning
1Turn left blinker on (right off)
2Turn right blinker on (left off)
3Turn on hazard lights
4Turn off blinker or hazard lights
+
+

WASD

+

Controlling the movement of the vehicle with WASD as the equivalent of arrow keys is acceptable, but remember that the d button engages the drive gear.

+
+

Elements configurable from the editor level

+
    +
  • Max Acceleration- maximum value of acceleration set by the script (also negative)
  • +
  • Max Steer Angle - maximum steering angle of the wheels set by the script (also negative)
  • +
+
+

Value limits

+

Max Acceleration and Max Steer Angle values greater than those set in the Vehicle (script) are limited by the script itself - they will not be exceeded.

+
+

Vehicle Visual Effect (script)

+

script_visual

+

This part of the settings is related to the configuration of the emission of materials when a specific lighting is activated. +There are 4 types of lights: Brake, Left Turn Signal, Right Turn Signal and Reverse. +Each of the lights has its visual equivalent in the form of a Mesh. +In the case of EgoVehicle, each light type has its own GameObject which contains the Mesh assigned.

+

material

+

For each type of light, the appropriate Material Index (equivalent of element index in mesh) and Lighting Color are assigned - yellow for Turn Signals, red for Break and white for Reverse.

+

Lighting Intensity values are also configured - the greater the value, the more light will be emitted. +This value is related to Lighting Exposure Weight parameter that is a exposure weight - the lower the value, the more light is emitted.

+

All types of lighting are switched on and off depending on the values obtained from the Vehicle (script) of the vehicle, which is assigned in the Vehicle field.

+

Elements configurable from the editor level

+
    +
  • Turn Signal Timer Interval Sec - time interval for flashing lights - value \(0.5\) means that the light will be on for \(0.5s\), then it will be turned off for \(0.5s\) and turned on again.
    +(default: 0.5)
  • +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Vehicle/EgoVehicle/input.gif b/Components/Vehicle/EgoVehicle/input.gif new file mode 100644 index 0000000000..90ec3cb25e Binary files /dev/null and b/Components/Vehicle/EgoVehicle/input.gif differ diff --git a/Components/Vehicle/EgoVehicle/link.png b/Components/Vehicle/EgoVehicle/link.png new file mode 100644 index 0000000000..eaf5739620 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/link.png differ diff --git a/Components/Vehicle/EgoVehicle/link_2.png b/Components/Vehicle/EgoVehicle/link_2.png new file mode 100644 index 0000000000..c5192cd58f Binary files /dev/null and b/Components/Vehicle/EgoVehicle/link_2.png differ diff --git a/Components/Vehicle/EgoVehicle/material.png b/Components/Vehicle/EgoVehicle/material.png new file mode 100644 index 0000000000..a1ba522c19 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/material.png differ diff --git a/Components/Vehicle/EgoVehicle/models_link.png b/Components/Vehicle/EgoVehicle/models_link.png new file mode 100644 index 0000000000..49d04ed932 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/models_link.png differ diff --git a/Components/Vehicle/EgoVehicle/prefab.png b/Components/Vehicle/EgoVehicle/prefab.png new file mode 100644 index 0000000000..fade1e21fa Binary files /dev/null and b/Components/Vehicle/EgoVehicle/prefab.png differ diff --git a/Components/Vehicle/EgoVehicle/prefab_link.png b/Components/Vehicle/EgoVehicle/prefab_link.png new file mode 100644 index 0000000000..4f6cc4e948 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/prefab_link.png differ diff --git a/Components/Vehicle/EgoVehicle/reflection.png b/Components/Vehicle/EgoVehicle/reflection.png new file mode 100644 index 0000000000..b97e0d1e88 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/reflection.png differ diff --git a/Components/Vehicle/EgoVehicle/rigidbody.png b/Components/Vehicle/EgoVehicle/rigidbody.png new file mode 100644 index 0000000000..b1de0f8efd Binary files /dev/null and b/Components/Vehicle/EgoVehicle/rigidbody.png differ diff --git a/Components/Vehicle/EgoVehicle/scene_link.png b/Components/Vehicle/EgoVehicle/scene_link.png new file mode 100644 index 0000000000..1bcca84121 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/scene_link.png differ diff --git a/Components/Vehicle/EgoVehicle/script.png b/Components/Vehicle/EgoVehicle/script.png new file mode 100644 index 0000000000..af09b3d1a1 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/script.png differ diff --git a/Components/Vehicle/EgoVehicle/script_keyboard.png b/Components/Vehicle/EgoVehicle/script_keyboard.png new file mode 100644 index 0000000000..fb794669da Binary files /dev/null and b/Components/Vehicle/EgoVehicle/script_keyboard.png differ diff --git a/Components/Vehicle/EgoVehicle/script_ros.png b/Components/Vehicle/EgoVehicle/script_ros.png new file mode 100644 index 0000000000..3eb2114b30 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/script_ros.png differ diff --git a/Components/Vehicle/EgoVehicle/script_visual.png b/Components/Vehicle/EgoVehicle/script_visual.png new file mode 100644 index 0000000000..a7d4d82cab Binary files /dev/null and b/Components/Vehicle/EgoVehicle/script_visual.png differ diff --git a/Components/Vehicle/EgoVehicle/sensor_kit.png b/Components/Vehicle/EgoVehicle/sensor_kit.png new file mode 100644 index 0000000000..4b68213b10 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/sensor_kit.png differ diff --git a/Components/Vehicle/EgoVehicle/urdf_link.png b/Components/Vehicle/EgoVehicle/urdf_link.png new file mode 100644 index 0000000000..283227c264 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/urdf_link.png differ diff --git a/Components/Vehicle/EgoVehicle/vehicle.png b/Components/Vehicle/EgoVehicle/vehicle.png new file mode 100644 index 0000000000..8e0eeefafd Binary files /dev/null and b/Components/Vehicle/EgoVehicle/vehicle.png differ diff --git a/Components/Vehicle/EgoVehicle/wheel_collider.png b/Components/Vehicle/EgoVehicle/wheel_collider.png new file mode 100644 index 0000000000..7f63ae070e Binary files /dev/null and b/Components/Vehicle/EgoVehicle/wheel_collider.png differ diff --git a/Components/Vehicle/EgoVehicle/wheel_collider_example.png b/Components/Vehicle/EgoVehicle/wheel_collider_example.png new file mode 100644 index 0000000000..dc1844c472 Binary files /dev/null and b/Components/Vehicle/EgoVehicle/wheel_collider_example.png differ diff --git a/Components/Vehicle/FollowCamera/index.html b/Components/Vehicle/FollowCamera/index.html new file mode 100644 index 0000000000..37aa7a0b8a --- /dev/null +++ b/Components/Vehicle/FollowCamera/index.html @@ -0,0 +1,2653 @@ + + + + + + + + + + + + + + + + + + + + + + + FollowCamera - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

FollowCamera

+ +

Introduction

+

The FollowCamera component is designed to track a specified target object within the scene. It is attached to the main camera and maintains a defined distance and height from the target. Additionally, it offers the flexibility of custom rotation around the target as an optional feature.

+

Elements configurable from the editor level

+

main_camera_inspector

+
Required member
+
    +
  • Target - the transform component of the tracked object
  • +
+
Base Setttings
+
    +
  • Distance - base distance between the camera and the target object
  • +
  • Offset - lateral offset of the camera position
  • +
  • Height - base height of the camera above the target object
  • +
  • HeightMultiplier - camera height multiplier
  • +
+
Optional Movement Setttings
+
    +
  • RotateAroundModeToggle - toggle key between rotate around mode and default follow mode
  • +
  • RotateAroundSensitivity - mouse movement sensitivity for camera rotation around the target
  • +
  • HeightAdjustmentSensitivity - mouse movement sensitivity for camera height adjustment
  • +
  • ZoomSensitivity - mouse scroll wheel sensitivity for camera zoom
  • +
  • InvertHorzAxis - invert horizontal mouse movement
  • +
  • InvertVertAxis - invert vertical mouse movement
  • +
  • InvertScrollWheel - invert mouse scroll wheel
  • +
  • MaxHeight - maximum value of camera height
  • +
  • MinDistance - minimum value of camera distance to target object
  • +
  • MaxDistance - maximum value of camera distance to target object
  • +
+

Rotate Around Mode

+

Camera rotation around the target can be activated by pressing the RotateAroundModeToggle key (default 'C' key). In this mode, the user can manually adjust the camera view at run-time using the mouse. To deactivate the Rotate Around mode, press the RotateAroundModeToggle key once more.

+

In the Rotate Around Mode camera view can be controlled as follows:

+
    +
  • hold left shift + mouse movement: to adjust the camera position,
  • +
  • hold left shift + mouse scroll wheel: to zoom in or out of the camera view,
  • +
  • left shift + left arrow: to set left camera view,
  • +
  • left shift + right arrow: to set right camera view,
  • +
  • left shift + up arrow: to set front camera view,
  • +
  • left shift + down arrow: to set back camera view.
  • +
+

Optional

+

An optional prefab featuring a UI panel, located at Assets/Prefabs/UI/MainCameraView.prefab, can be used to showcase a user guide. To integrate this prefab into the scene, drag and drop it beneath the Canvas object. This prefab displays instructions on how to adjust the camera view whenever the Rotate Around Mode is activated.

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Vehicle/FollowCamera/main_camera_inspector.png b/Components/Vehicle/FollowCamera/main_camera_inspector.png new file mode 100644 index 0000000000..59b6e88a6d Binary files /dev/null and b/Components/Vehicle/FollowCamera/main_camera_inspector.png differ diff --git a/Components/Vehicle/URDFAndSensors/index.html b/Components/Vehicle/URDFAndSensors/index.html new file mode 100644 index 0000000000..e06d385140 --- /dev/null +++ b/Components/Vehicle/URDFAndSensors/index.html @@ -0,0 +1,2789 @@ + + + + + + + + + + + + + + + + + + + + + + + URDF And Sensors - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

URDF and Sensors

+

This section describes the placement of sensors in EgoVehicle on the example of a Lexus RX450h 2015 Sample Sensor prefab.

+

URDF (Unified Robot Description Format) is equivalent to the simplified URDF format used in ROS2. +This format allows to define the positions of all sensors of the vehicle in relation to its main parent prefab coordinate system.

+

urdf

+

URDF is added directly to the main parent of the prefab and there are no transforms between these objects. +It is built using multiple GameObjects as children appropriately transformed with relation to its parent.

+

urdf

+

The transforms in the URDF object are defined using the data from the sensor kit documentation used in the vehicle. +Such data can be obtained from sensor kit packages for Autoware, for example: awsim_sensor_kit_launch - it is used in the AWSIM compatible version of Autoware. +This package contains a description of transforms between coordinate systems (frames) in the form of *.yaml files: sensors_calibration and sensor_kit_calibration.

+

In the first file, the transform of the sensor kit frame (sensor_kit_base_link) relative to the local vehicle frame (base_link) is defined. +In Unity, this transform is defined in the object Sensor Kit. +While the second file contains a definition of the transformations of all sensors with respect to the sensor kit - they are described in the Sensor Kit subsections.

+
+

Transformations

+

Please note that the transformation Objects are intended to be a direct reflection of frames existing in ROS2. +All frame Objects are defined as children of base_link and consist of nothing but a transformation - analogical to the one present in ROS2 (keep in mind the coordinate system conversion). +The sensor Objects are added to the transformation Object with no transformation of their own.

+
+
+

Coordinate system conventions

+

Unity uses a left-handed convention for its coordinate system, while the ROS2 uses a right-handed convention. +For this reason, you should remember to perform conversions to get the correct transforms.

+
+ +

Base Link (frame named base_link) is the formalized local coordinate system in URDF. +All sensors that publish data specified in some frame present in Autoware are defined in relation to base_link. +It is a standard practice in ROS, that base_link is a parent transformation of the whole robot and all robot parts are defined in some relation to the base_link.

+

If any device publishes data in the base_link frame - it is added as a direct child, with no additional transformation intermediate Object (PoseSensor is an example). +However, if this device has its own frame, it is added as a child to its frame Object - which provides an additional transformation. +The final transformation can consist of many intermediate transformation Objects. +The frame Objects are added to the base_link (GnssSensor and its parent gnss_link are an example).

+

baselink

+

Sensor Kit

+

Sensor Kit (frame named sensor_kit_base_link) is a set of objects that consists of all simulated sensors that are physically present in an autonomous vehicle and have their own coordinate system (frame). +This set of sensors has its own frame sensor_kit_base_link that is relative to the base_link.

+

In the Lexus RX450h 2015 Sample Sensor prefab, it is added to the base_link GameObject with an appropriately defined transformation. +It acts as an intermediate frame GameObject. +Sensor Kit is located on the top of the vehicle, so it is significantly shifted about the Oy and Oz axes. +Sensors can be defined directly in this Object (VelodyneVLP16 is an example), or have their own transformation Object added on top of the sensor_kit_base_link (like GnssSensor mentioned in the base_link section).

+

The sensors described in this subsection are defined in relation to the sensor_kit_base_link frame.

+

sensor_kit

+

LiDARs

+

LidarSensor is the component that simulates the LiDAR (Light Detection and Ranging) sensor. +The LiDARs mounted on the top of autonomous vehicles are primarily used to scan the environment for localization in space and for detection and identification of obstacles. +LiDARs placed on the left and right sides of the vehicle are mainly used to monitor the traffic lane and detect vehicles moving in adjacent lanes. +A detailed description of this sensor is available in this section.

+

Lexus RX450h 2015 Sample Sensor prefab has one VelodyneVLP16 prefab sensor configured on the top of the vehicle, mainly used for location in space, but also for object recognition. +Since the top LiDAR publishes data directly in the sensor_kit_base_link frame, the prefab is added directly to it - there is no transform. +The other two remaining LiDARs are defined, but disabled - they do not provide data from space (but you can enable them!).

+
Top
+

velodyne_top

+
Left - disabled
+

velodyne_left

+
Right - disabled
+

velodyne_right

+

IMU

+

IMUSensor is a component that simulates an IMU (Inertial Measurement Unit) sensor. +It measures acceleration and angular velocity of the EgoVehicle. +A detailed description of this sensor is available in this section.

+

Lexus RX450h 2015 Sample Sensor has one such sensor located on the top of the vehicle. +It is added to an Object tamagawa/imu_link that matches its frame_id and contains its transform with respect to sensor_kit_base_link. +This transformation has no transition, but only rotation around the Oy and Oz axes. +The transform is defined in such a way that its axis Oy points downwards - in accordance with the gravity vector.

+

imu

+

GNSS

+

GnssSensor is a component which simulates the position of vehicle computed by the Global Navigation Satellite. +A detailed description of this sensor is available in this section.

+

Lexus RX450h 2015 Sample Sensor prefab has one such sensor located on top of the vehicle. +It is added to an Object gnss_link that matches its frame_id and contains its transform with respect to sensor_kit_base_link. +The frame is slightly moved back along the Oy and Oz axes.

+

gnss

+

Camera

+

CameraSensor is a component that simulates an RGB camera. +Autonomous vehicles can be equipped with many cameras used for various purposes. +A detailed description of this sensor is available in this section.

+

Lexus RX450h 2015 Sample Sensor prefab has one camera, positioned on top of the vehicle in such a way that the cameras field of view provides an image including traffic lights - the status of which must be recognized by Autoware. +It is added to an Object traffic_light_left_camera/camera_link that matches its frame_id and contains its transform with respect to sensor_kit_base_link.

+

camera

+

Pose

+

PoseSensor is a component which provides access to the current position and rotation of the EgoVehicle - is added as a ground truth.

+

The position and orientation of EgoVehicle is defined as the position of the frame base_link in the global frame, so this Object is added directly as its child without a transform.

+

pose

+

VehicleSensor

+

VehicleStatusSensor is a component that is designed to aggregate information about the current state of the EgoVehicle, such as the active control mode, vehicle speed, steering of its wheels, or turn signal status. +A detailed description of this sensor is available in this section.

+

This Object is not strictly related to any frame, however, it is assumed as a sensor, therefore it is added to the URDF.

+

vehicle

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/Vehicle/URDFAndSensors/urdf_links/baselink.png b/Components/Vehicle/URDFAndSensors/urdf_links/baselink.png new file mode 100644 index 0000000000..3fc141f95f Binary files /dev/null and b/Components/Vehicle/URDFAndSensors/urdf_links/baselink.png differ diff --git a/Components/Vehicle/URDFAndSensors/urdf_links/camera.png b/Components/Vehicle/URDFAndSensors/urdf_links/camera.png new file mode 100644 index 0000000000..704a1b376c Binary files /dev/null and b/Components/Vehicle/URDFAndSensors/urdf_links/camera.png differ diff --git a/Components/Vehicle/URDFAndSensors/urdf_links/gnss.png b/Components/Vehicle/URDFAndSensors/urdf_links/gnss.png new file mode 100644 index 0000000000..6518d1cada Binary files /dev/null and b/Components/Vehicle/URDFAndSensors/urdf_links/gnss.png differ diff --git a/Components/Vehicle/URDFAndSensors/urdf_links/imu.png b/Components/Vehicle/URDFAndSensors/urdf_links/imu.png new file mode 100644 index 0000000000..c9a01ba9c8 Binary files /dev/null and b/Components/Vehicle/URDFAndSensors/urdf_links/imu.png differ diff --git a/Components/Vehicle/URDFAndSensors/urdf_links/pose.png b/Components/Vehicle/URDFAndSensors/urdf_links/pose.png new file mode 100644 index 0000000000..28b47596fb Binary files /dev/null and b/Components/Vehicle/URDFAndSensors/urdf_links/pose.png differ diff --git a/Components/Vehicle/URDFAndSensors/urdf_links/sensor_kit.png b/Components/Vehicle/URDFAndSensors/urdf_links/sensor_kit.png new file mode 100644 index 0000000000..78ad50dbff Binary files /dev/null and b/Components/Vehicle/URDFAndSensors/urdf_links/sensor_kit.png differ diff --git a/Components/Vehicle/URDFAndSensors/urdf_links/urdf.png b/Components/Vehicle/URDFAndSensors/urdf_links/urdf.png new file mode 100644 index 0000000000..2bd8cea566 Binary files /dev/null and b/Components/Vehicle/URDFAndSensors/urdf_links/urdf.png differ diff --git a/Components/Vehicle/URDFAndSensors/urdf_links/urdf_link.png b/Components/Vehicle/URDFAndSensors/urdf_links/urdf_link.png new file mode 100644 index 0000000000..283227c264 Binary files /dev/null and b/Components/Vehicle/URDFAndSensors/urdf_links/urdf_link.png differ diff --git a/Components/Vehicle/URDFAndSensors/urdf_links/vehicle.png b/Components/Vehicle/URDFAndSensors/urdf_links/vehicle.png new file mode 100644 index 0000000000..98f98ffe66 Binary files /dev/null and b/Components/Vehicle/URDFAndSensors/urdf_links/vehicle.png differ diff --git a/Components/Vehicle/URDFAndSensors/urdf_links/velodyne_left.png b/Components/Vehicle/URDFAndSensors/urdf_links/velodyne_left.png new file mode 100644 index 0000000000..75f9fc1bfd Binary files /dev/null and b/Components/Vehicle/URDFAndSensors/urdf_links/velodyne_left.png differ diff --git a/Components/Vehicle/URDFAndSensors/urdf_links/velodyne_right.png b/Components/Vehicle/URDFAndSensors/urdf_links/velodyne_right.png new file mode 100644 index 0000000000..5734e11f56 Binary files /dev/null and b/Components/Vehicle/URDFAndSensors/urdf_links/velodyne_right.png differ diff --git a/Components/Vehicle/URDFAndSensors/urdf_links/velodyne_top.png b/Components/Vehicle/URDFAndSensors/urdf_links/velodyne_top.png new file mode 100644 index 0000000000..0bd6aab620 Binary files /dev/null and b/Components/Vehicle/URDFAndSensors/urdf_links/velodyne_top.png differ diff --git a/DeveloperGuide/Contact/index.html b/DeveloperGuide/Contact/index.html new file mode 100644 index 0000000000..ea7be104b9 --- /dev/null +++ b/DeveloperGuide/Contact/index.html @@ -0,0 +1,2412 @@ + + + + + + + + + + + + + + + + + + + + + Contact - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Contact

+

English/日本語 OK

+

e-mail : takatoki.makino@tier4.jp

+

twitter : https://twitter.com/mackierx111

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DeveloperGuide/Documentation/image_0.png b/DeveloperGuide/Documentation/image_0.png new file mode 100644 index 0000000000..db08acf12f Binary files /dev/null and b/DeveloperGuide/Documentation/image_0.png differ diff --git a/DeveloperGuide/Documentation/index.html b/DeveloperGuide/Documentation/index.html new file mode 100644 index 0000000000..4d74acfa99 --- /dev/null +++ b/DeveloperGuide/Documentation/index.html @@ -0,0 +1,2553 @@ + + + + + + + + + + + + + + + + + + + + + + + Documentation - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Documentation

+

This document uses Material for MkDocs.

+

Local hosting

+

1 Install Material for MkDocs. +

$ pip install mkdocs-material
+
+2 Hosting on localhost. +
$ cd AWSIM
+$ mkdocs serve
+INFO     -  Building documentation...
+INFO     -  Cleaning site directory
+INFO     -  Documentation built in 0.16 seconds
+INFO     -  [03:13:22] Watching paths for changes: 'docs', 'mkdocs.yml'
+INFO     -  [03:13:22] Serving on http://127.0.0.1:8000/
+

+

3 Access http://127.0.0.1:8000/ with a web browser.

+ +

+

For further reference see Material for MkDocs - Getting started.

+

MkDocs files

+

Use the following /docs directory and mkdocs.yml for new documentation files. +

AWSIM
+├─ docs/                // markdown and image file for each document.
+└─ mkdocs.yml           // mkdocs config.
+
+Create one directory per document. For example, the directory structure of this "Documentation" page might look like this. +
AWSIM
+└─ docs/                            // Root of all documents
+    └─ DeveloperGuide               // Category
+        └─ Documentation            // Root of each document
+            ├─ index.md             // Markdown file
+            └─ image_0.png          // Images used in markdown file
+

+

Deploy & Hosting

+

When docs are pushed to the main branch, they are deployed to GitHub Pages using GitHub Actions. See also Material for MkDocs - Publishing your site

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DeveloperGuide/HowToContribute/index.html b/DeveloperGuide/HowToContribute/index.html new file mode 100644 index 0000000000..fb8d6e5459 --- /dev/null +++ b/DeveloperGuide/HowToContribute/index.html @@ -0,0 +1,2634 @@ + + + + + + + + + + + + + + + + + + + + + + + How to Contribute - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

How to Contribute

+

Everyone is welcome!

+

How can I get help?

+

Do not open issues for general support questions as we want to keep GitHub issues for confirmed bug reports. +Instead, open a discussion in the Q&A category. +The trouble shooting page at AWSIM and at Autoware will be also helpful.

+

Issue

+

Before you post an issue, please search Issues and Discussions Q&A catecory to check if it is not a known issue.

+

This page is helpful how to create an issue from a repository.

+

Bug report

+

If you find a new bug, please create an issue here

+

Feature request

+

If you propose a new feature or have an idea, please create an issue here

+

Task

+

If you have plan to contribute AWSIM, please create an issue here.

+

Question

+ +

Pull requests

+

If you have an idea to improve the simulation, you can submit a pull request. +The following process should be followed:

+
    +
  1. Create a derived branch (feature/***) from the main branch.
  2. +
  3. Create a pull request to the main branch.
  4. +
+

Please keep the following in mind, while developing new features:

+ + + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DeveloperGuide/License/index.html b/DeveloperGuide/License/index.html new file mode 100644 index 0000000000..d1569841e4 --- /dev/null +++ b/DeveloperGuide/License/index.html @@ -0,0 +1,3124 @@ + + + + + + + + + + + + + + + + + + + + + + + License - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

AWSIM Licenses

+

AWSIM License applies to tier4/AWSIM repositories and all content contained in the Releases.

+
    +
  • AWSIM specific code is distributed under Apache2.0 License.
    +The following extensions are included (*.cs *.compute *.xml)
  • +
  • AWSIM specific assets are distributed under CC BY-NC License.
    +The following extensions are included (*.fbx *.pcd *.osm *.png *.anim *.unitypackage *.x86_64)
  • +
+
Apache2.0 License
+
**********************************************************************************
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright 2022 TIER IV, Inc.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
CC BY-NC License
+
**********************************************************************************
+
+Attribution-NonCommercial 4.0 International
+
+=======================================================================
+
+Creative Commons Corporation ("Creative Commons") is not a law firm and
+does not provide legal services or legal advice. Distribution of
+Creative Commons public licenses does not create a lawyer-client or
+other relationship. Creative Commons makes its licenses and related
+information available on an "as-is" basis. Creative Commons gives no
+warranties regarding its licenses, any material licensed under their
+terms and conditions, or any related information. Creative Commons
+disclaims all liability for damages resulting from their use to the
+fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and
+conditions that creators and other rights holders may use to share
+original works of authorship and other material subject to copyright
+and certain other rights specified in the public license below. The
+following considerations are for informational purposes only, are not
+exhaustive, and do not form part of our licenses.
+
+     Considerations for licensors: Our public licenses are
+     intended for use by those authorized to give the public
+     permission to use material in ways otherwise restricted by
+     copyright and certain other rights. Our licenses are
+     irrevocable. Licensors should read and understand the terms
+     and conditions of the license they choose before applying it.
+     Licensors should also secure all rights necessary before
+     applying our licenses so that the public can reuse the
+     material as expected. Licensors should clearly mark any
+     material not subject to the license. This includes other CC-
+     licensed material, or material used under an exception or
+     limitation to copyright. More considerations for licensors:
+    wiki.creativecommons.org/Considerations_for_licensors
+
+     Considerations for the public: By using one of our public
+     licenses, a licensor grants the public permission to use the
+     licensed material under specified terms and conditions. If
+     the licensor's permission is not necessary for any reason--for
+     example, because of any applicable exception or limitation to
+     copyright--then that use is not regulated by the license. Our
+     licenses grant only permissions under copyright and certain
+     other rights that a licensor has authority to grant. Use of
+     the licensed material may still be restricted for other
+     reasons, including because others have copyright or other
+     rights in the material. A licensor may make special requests,
+     such as asking that all changes be marked or described.
+     Although not required by our licenses, you are encouraged to
+     respect those requests where reasonable. More considerations
+     for the public:
+    wiki.creativecommons.org/Considerations_for_licensees
+
+=======================================================================
+
+Creative Commons Attribution-NonCommercial 4.0 International Public
+License
+
+By exercising the Licensed Rights (defined below), You accept and agree
+to be bound by the terms and conditions of this Creative Commons
+Attribution-NonCommercial 4.0 International Public License ("Public
+License"). To the extent this Public License may be interpreted as a
+contract, You are granted the Licensed Rights in consideration of Your
+acceptance of these terms and conditions, and the Licensor grants You
+such rights in consideration of benefits the Licensor receives from
+making the Licensed Material available under these terms and
+conditions.
+
+
+Section 1 -- Definitions.
+
+  a. Adapted Material means material subject to Copyright and Similar
+     Rights that is derived from or based upon the Licensed Material
+     and in which the Licensed Material is translated, altered,
+     arranged, transformed, or otherwise modified in a manner requiring
+     permission under the Copyright and Similar Rights held by the
+     Licensor. For purposes of this Public License, where the Licensed
+     Material is a musical work, performance, or sound recording,
+     Adapted Material is always produced where the Licensed Material is
+     synched in timed relation with a moving image.
+
+  b. Adapter's License means the license You apply to Your Copyright
+     and Similar Rights in Your contributions to Adapted Material in
+     accordance with the terms and conditions of this Public License.
+
+  c. Copyright and Similar Rights means copyright and/or similar rights
+     closely related to copyright including, without limitation,
+     performance, broadcast, sound recording, and Sui Generis Database
+     Rights, without regard to how the rights are labeled or
+     categorized. For purposes of this Public License, the rights
+     specified in Section 2(b)(1)-(2) are not Copyright and Similar
+     Rights.
+  d. Effective Technological Measures means those measures that, in the
+     absence of proper authority, may not be circumvented under laws
+     fulfilling obligations under Article 11 of the WIPO Copyright
+     Treaty adopted on December 20, 1996, and/or similar international
+     agreements.
+
+  e. Exceptions and Limitations means fair use, fair dealing, and/or
+     any other exception or limitation to Copyright and Similar Rights
+     that applies to Your use of the Licensed Material.
+
+  f. Licensed Material means the artistic or literary work, database,
+     or other material to which the Licensor applied this Public
+     License.
+
+  g. Licensed Rights means the rights granted to You subject to the
+     terms and conditions of this Public License, which are limited to
+     all Copyright and Similar Rights that apply to Your use of the
+     Licensed Material and that the Licensor has authority to license.
+
+  h. Licensor means the individual(s) or entity(ies) granting rights
+     under this Public License.
+
+  i. NonCommercial means not primarily intended for or directed towards
+     commercial advantage or monetary compensation. For purposes of
+     this Public License, the exchange of the Licensed Material for
+     other material subject to Copyright and Similar Rights by digital
+     file-sharing or similar means is NonCommercial provided there is
+     no payment of monetary compensation in connection with the
+     exchange.
+
+  j. Share means to provide material to the public by any means or
+     process that requires permission under the Licensed Rights, such
+     as reproduction, public display, public performance, distribution,
+     dissemination, communication, or importation, and to make material
+     available to the public including in ways that members of the
+     public may access the material from a place and at a time
+     individually chosen by them.
+
+  k. Sui Generis Database Rights means rights other than copyright
+     resulting from Directive 96/9/EC of the European Parliament and of
+     the Council of 11 March 1996 on the legal protection of databases,
+     as amended and/or succeeded, as well as other essentially
+     equivalent rights anywhere in the world.
+
+  l. You means the individual or entity exercising the Licensed Rights
+     under this Public License. Your has a corresponding meaning.
+
+
+Section 2 -- Scope.
+
+  a. License grant.
+
+       1. Subject to the terms and conditions of this Public License,
+          the Licensor hereby grants You a worldwide, royalty-free,
+          non-sublicensable, non-exclusive, irrevocable license to
+          exercise the Licensed Rights in the Licensed Material to:
+
+            a. reproduce and Share the Licensed Material, in whole or
+               in part, for NonCommercial purposes only; and
+
+            b. produce, reproduce, and Share Adapted Material for
+               NonCommercial purposes only.
+
+       2. Exceptions and Limitations. For the avoidance of doubt, where
+          Exceptions and Limitations apply to Your use, this Public
+          License does not apply, and You do not need to comply with
+          its terms and conditions.
+
+       3. Term. The term of this Public License is specified in Section
+          6(a).
+
+       4. Media and formats; technical modifications allowed. The
+          Licensor authorizes You to exercise the Licensed Rights in
+          all media and formats whether now known or hereafter created,
+          and to make technical modifications necessary to do so. The
+          Licensor waives and/or agrees not to assert any right or
+          authority to forbid You from making technical modifications
+          necessary to exercise the Licensed Rights, including
+          technical modifications necessary to circumvent Effective
+          Technological Measures. For purposes of this Public License,
+          simply making modifications authorized by this Section 2(a)
+          (4) never produces Adapted Material.
+
+       5. Downstream recipients.
+
+            a. Offer from the Licensor -- Licensed Material. Every
+               recipient of the Licensed Material automatically
+               receives an offer from the Licensor to exercise the
+               Licensed Rights under the terms and conditions of this
+               Public License.
+
+            b. No downstream restrictions. You may not offer or impose
+               any additional or different terms or conditions on, or
+               apply any Effective Technological Measures to, the
+               Licensed Material if doing so restricts exercise of the
+               Licensed Rights by any recipient of the Licensed
+               Material.
+
+       6. No endorsement. Nothing in this Public License constitutes or
+          may be construed as permission to assert or imply that You
+          are, or that Your use of the Licensed Material is, connected
+          with, or sponsored, endorsed, or granted official status by,
+          the Licensor or others designated to receive attribution as
+          provided in Section 3(a)(1)(A)(i).
+
+  b. Other rights.
+
+       1. Moral rights, such as the right of integrity, are not
+          licensed under this Public License, nor are publicity,
+          privacy, and/or other similar personality rights; however, to
+          the extent possible, the Licensor waives and/or agrees not to
+          assert any such rights held by the Licensor to the limited
+          extent necessary to allow You to exercise the Licensed
+          Rights, but not otherwise.
+
+       2. Patent and trademark rights are not licensed under this
+          Public License.
+
+       3. To the extent possible, the Licensor waives any right to
+          collect royalties from You for the exercise of the Licensed
+          Rights, whether directly or through a collecting society
+          under any voluntary or waivable statutory or compulsory
+          licensing scheme. In all other cases the Licensor expressly
+          reserves any right to collect such royalties, including when
+          the Licensed Material is used other than for NonCommercial
+          purposes.
+
+
+Section 3 -- License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the
+following conditions.
+
+  a. Attribution.
+
+       1. If You Share the Licensed Material (including in modified
+          form), You must:
+
+            a. retain the following if it is supplied by the Licensor
+               with the Licensed Material:
+
+                 i. identification of the creator(s) of the Licensed
+                    Material and any others designated to receive
+                    attribution, in any reasonable manner requested by
+                    the Licensor (including by pseudonym if
+                    designated);
+
+                ii. a copyright notice;
+
+               iii. a notice that refers to this Public License;
+
+                iv. a notice that refers to the disclaimer of
+                    warranties;
+
+                 v. a URI or hyperlink to the Licensed Material to the
+                    extent reasonably practicable;
+
+            b. indicate if You modified the Licensed Material and
+               retain an indication of any previous modifications; and
+
+            c. indicate the Licensed Material is licensed under this
+               Public License, and include the text of, or the URI or
+               hyperlink to, this Public License.
+
+       2. You may satisfy the conditions in Section 3(a)(1) in any
+          reasonable manner based on the medium, means, and context in
+          which You Share the Licensed Material. For example, it may be
+          reasonable to satisfy the conditions by providing a URI or
+          hyperlink to a resource that includes the required
+          information.
+
+       3. If requested by the Licensor, You must remove any of the
+          information required by Section 3(a)(1)(A) to the extent
+          reasonably practicable.
+
+       4. If You Share Adapted Material You produce, the Adapter's
+          License You apply must not prevent recipients of the Adapted
+          Material from complying with this Public License.
+
+
+Section 4 -- Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that
+apply to Your use of the Licensed Material:
+
+  a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+     to extract, reuse, reproduce, and Share all or a substantial
+     portion of the contents of the database for NonCommercial purposes
+     only;
+
+  b. if You include all or a substantial portion of the database
+     contents in a database in which You have Sui Generis Database
+     Rights, then the database in which You have Sui Generis Database
+     Rights (but not its individual contents) is Adapted Material; and
+
+  c. You must comply with the conditions in Section 3(a) if You Share
+     all or a substantial portion of the contents of the database.
+
+For the avoidance of doubt, this Section 4 supplements and does not
+replace Your obligations under this Public License where the Licensed
+Rights include other Copyright and Similar Rights.
+
+
+Section 5 -- Disclaimer of Warranties and Limitation of Liability.
+
+  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
+
+  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
+
+  c. The disclaimer of warranties and limitation of liability provided
+     above shall be interpreted in a manner that, to the extent
+     possible, most closely approximates an absolute disclaimer and
+     waiver of all liability.
+
+
+Section 6 -- Term and Termination.
+
+  a. This Public License applies for the term of the Copyright and
+     Similar Rights licensed here. However, if You fail to comply with
+     this Public License, then Your rights under this Public License
+     terminate automatically.
+
+  b. Where Your right to use the Licensed Material has terminated under
+     Section 6(a), it reinstates:
+
+       1. automatically as of the date the violation is cured, provided
+          it is cured within 30 days of Your discovery of the
+          violation; or
+
+       2. upon express reinstatement by the Licensor.
+
+     For the avoidance of doubt, this Section 6(b) does not affect any
+     right the Licensor may have to seek remedies for Your violations
+     of this Public License.
+
+  c. For the avoidance of doubt, the Licensor may also offer the
+     Licensed Material under separate terms or conditions or stop
+     distributing the Licensed Material at any time; however, doing so
+     will not terminate this Public License.
+
+  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+     License.
+
+
+Section 7 -- Other Terms and Conditions.
+
+  a. The Licensor shall not be bound by any additional or different
+     terms or conditions communicated by You unless expressly agreed.
+
+  b. Any arrangements, understandings, or agreements regarding the
+     Licensed Material not stated herein are separate from and
+     independent of the terms and conditions of this Public License.
+
+
+Section 8 -- Interpretation.
+
+  a. For the avoidance of doubt, this Public License does not, and
+     shall not be interpreted to, reduce, limit, restrict, or impose
+     conditions on any use of the Licensed Material that could lawfully
+     be made without permission under this Public License.
+
+  b. To the extent possible, if any provision of this Public License is
+     deemed unenforceable, it shall be automatically reformed to the
+     minimum extent necessary to make it enforceable. If the provision
+     cannot be reformed, it shall be severed from this Public License
+     without affecting the enforceability of the remaining terms and
+     conditions.
+
+  c. No term or condition of this Public License will be waived and no
+     failure to comply consented to unless expressly agreed to by the
+     Licensor.
+
+  d. Nothing in this Public License constitutes or may be interpreted
+     as a limitation upon, or waiver of, any privileges and immunities
+     that apply to the Licensor or You, including from the legal
+     processes of any jurisdiction or authority.
+
+=======================================================================
+
+Creative Commons is not a party to its public
+licenses. Notwithstanding, Creative Commons may elect to apply one of
+its public licenses to material it publishes and in those instances
+will be considered the “Licensor.” The text of the Creative Commons
+public licenses is dedicated to the public domain under the CC0 Public
+Domain Dedication. Except for the limited purpose of indicating that
+material is shared under a Creative Commons public license or as
+otherwise permitted by the Creative Commons policies published at
+creativecommons.org/policies, Creative Commons does not authorize the
+use of the trademark "Creative Commons" or any other trademark or logo
+of Creative Commons without its prior written consent including,
+without limitation, in connection with any unauthorized modifications
+to any of its public licenses or any other arrangements,
+understandings, or agreements concerning use of licensed material. For
+the avoidance of doubt, this paragraph does not form part of the
+public licenses.
+
+Creative Commons may be contacted at creativecommons.org
+
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DeveloperGuide/SetupVscode/index.html b/DeveloperGuide/SetupVscode/index.html new file mode 100644 index 0000000000..2acdd85d9d --- /dev/null +++ b/DeveloperGuide/SetupVscode/index.html @@ -0,0 +1,2618 @@ + + + + + + + + + + + + + + + + + + + + + + + Setup VSCode - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+ +
+
+ + + +
+
+ + + + + + + +

Setup VSCode

+

Install Visual Studio Code

+

Follow the steps in: +https://code.visualstudio.com/docs/setup/linux

+
# Install the keys and repository
+sudo apt-get install wget gpg
+wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
+sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
+sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
+rm -f packages.microsoft.gpg
+
+# Then update the package cache and install the package using:
+sudo apt install apt-transport-https
+sudo apt update
+sudo apt install code
+
+

Install the Dotnet SDK

+

Follow the steps in: +https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#register-the-microsoft-package-repository

+
# Get Ubuntu version
+declare repo_version=$(if command -v lsb_release &> /dev/null; then lsb_release -r -s; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi)
+
+# Download Microsoft signing key and repository
+wget https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
+
+# Install Microsoft signing key and repository
+sudo dpkg -i packages-microsoft-prod.deb
+
+# Clean up
+rm packages-microsoft-prod.deb
+
+# Update packages
+sudo apt update
+
+sudo apt install dotnet-sdk-8.0
+
+

Install the extensions

+

Follow the steps in:

+ +
+

Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter. +- ext install ms-dotnettools.csdevkit +Repeat for: +- ext install VisualStudioToolsForUnity.vstuc +- ext install ms-dotnettools.csharp

+
+

Configure the Unity

+
    +
  • Open up the Unity Editor
  • +
  • Edit -> Preferences -> External Tools -> External Script Editor
  • +
  • Select Visual Studio Code
  • +
  • If it's not there, click Browse and navigate and select /usr/bin/code
  • +
+

It should all be configured now. +You can either open up a script by double clicking in the Project window in Unity or by opening up the project in VS Code: +- Assets -> Open C# Project

+

Syntax highlighting and CTRL-click navigation should work out of the box.

+

For more advanced features such as debugging, check the Unity Development with VS Code Documentation.

+

Additional notes

+

In the AWSIM project, the package Visual Studio Editor is already installed to satisfy the requirement from the Unity for Visual Studio Code extension.

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DeveloperGuide/TroubleShooting/Image_Initial_0.png b/DeveloperGuide/TroubleShooting/Image_Initial_0.png new file mode 100644 index 0000000000..12f12eee44 Binary files /dev/null and b/DeveloperGuide/TroubleShooting/Image_Initial_0.png differ diff --git a/DeveloperGuide/TroubleShooting/Image_Initial_1.png b/DeveloperGuide/TroubleShooting/Image_Initial_1.png new file mode 100644 index 0000000000..f94ede5ec2 Binary files /dev/null and b/DeveloperGuide/TroubleShooting/Image_Initial_1.png differ diff --git a/DeveloperGuide/TroubleShooting/index.html b/DeveloperGuide/TroubleShooting/index.html new file mode 100644 index 0000000000..bbee5f8c3b --- /dev/null +++ b/DeveloperGuide/TroubleShooting/index.html @@ -0,0 +1,2490 @@ + + + + + + + + + + + + + + + + + + + + + + + Trouble shooting - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Trouble shooting

+

This document describes the most common errors encountered when working with AWSIm or autoware.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TroubleSolution
Massive output of Plugins errorsgit clone the AWSIM repository again
error : RuntimeError: error not set, at C:\ci\ws\src\ros2\rcl\rcl\src\rcl\node.c:262Set up environment variables and config around ROS2 correctly. For example:
- Environment variables
- cyclonedds_config.xml
$ ros2 topic list is not displayed- your machine ROS_DOMAIN_ID is different
- ROS2 is not sourced
Using AWSIM on Windows and Autoware on Ubuntu.
$ ros2 topic list is not displayed.
Allow the communication in Windows Firewall
self-driving stops in the middle of the road.Check if your map data is correct (PointCloud, VectorMap, 3D fbx models)
Connecting AWSIM and Autoware results in bad networkMake ros local host-only. Include the following in the .bashrc (The password will be requested at terminal startup after OS startup.)

export ROS_LOCALHOST_ONLY=1
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

if [ ! -e /tmp/cycloneDDS_configured ]; then
sudo sysctl -w net.core.rmem_max=2147483647
sudo ip link set lo multicast on
touch /tmp/cycloneDDS_configured
fi
Lidar (colored pointcloud on RViz ) does not show.Reduce processing load by following command. This can only be applied to Autoware's awsim-stable branch.

cd <path_to_your_autoware_folder>
wget "https://drive.google.com/uc?export=download&id=11mkwfg-OaXIp3Z5c3R58Pob3butKwE1Z" -O patch.sh
bash patch.sh && rm patch.sh
Error when starting AWSIM binary. segmentation fault (core dumped)- Check if yourNvidia drivers or Vulkan API are installed correctly
- When building binary please pay attantion whether the Graphic Jobs option in Player Settings is disabled. It should be disabled since it may produce segmentation fault errors. Please check forum for more details.
Initial pose does not match automatically.Set initial pose manually.

Unity crashes and check the log for the cause of the error.Editor log file location
Windows :
C:\Users\username\AppData\Local\Unity\Editor\Editor.log
Linux :
~/.config/unity3d/.Editor.log

Player log file location
Windows : C:\Users\username\AppData\LocalLow\CompanyName\ProductName\output_log.txt
Linux :
~/.config/unity3d/CompanyName/ProductName/Player.log

See also : Unity Documentation - Log Files
Safe mode dialog appears when starting UnityEditor.

or

error : No usable version of libssl was found
1. download libssl
$ wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.11_amd64.deb

2. install
sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.11_amd64.deb
(Windows) Unity Editor's error:Plugins: Failed to load 'Assets/RGLUnityPlugin/Plugins/Windows/x86_64/RobotecGPULidar.dll' because one or more of its dependencies could not be loaded.Install Microsoft Visual C++ Redistributable packages for Visual Studio 2015, 2017, 2019, and 2022 (X64 Architecture)
(Windows) Built-binary or Unity Editor freeze when simulation startedUpdate/Install latest NIC(NetworkInterfaceCard) drivers for your PC.
Especially, if you can find latest drivers provided by chip vendors for the interfaces (not by Microsoft), we recommend vendors' drivers.
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/E2ESim.png b/E2ESim.png new file mode 100644 index 0000000000..8917c0dddb Binary files /dev/null and b/E2ESim.png differ diff --git a/GettingStarted/QuickStartDemo/Image_0.png b/GettingStarted/QuickStartDemo/Image_0.png new file mode 100644 index 0000000000..490098554a Binary files /dev/null and b/GettingStarted/QuickStartDemo/Image_0.png differ diff --git a/GettingStarted/QuickStartDemo/Image_1.png b/GettingStarted/QuickStartDemo/Image_1.png new file mode 100644 index 0000000000..b29a667e24 Binary files /dev/null and b/GettingStarted/QuickStartDemo/Image_1.png differ diff --git a/GettingStarted/QuickStartDemo/Image_2.png b/GettingStarted/QuickStartDemo/Image_2.png new file mode 100644 index 0000000000..a1b97a968d Binary files /dev/null and b/GettingStarted/QuickStartDemo/Image_2.png differ diff --git a/GettingStarted/QuickStartDemo/Image_Initial.png b/GettingStarted/QuickStartDemo/Image_Initial.png new file mode 100644 index 0000000000..403351b8a1 Binary files /dev/null and b/GettingStarted/QuickStartDemo/Image_Initial.png differ diff --git a/GettingStarted/QuickStartDemo/Image_Initial_2.png b/GettingStarted/QuickStartDemo/Image_Initial_2.png new file mode 100644 index 0000000000..b604c6abdd Binary files /dev/null and b/GettingStarted/QuickStartDemo/Image_Initial_2.png differ diff --git a/GettingStarted/QuickStartDemo/Image_checkpoint_0.png b/GettingStarted/QuickStartDemo/Image_checkpoint_0.png new file mode 100644 index 0000000000..7218dd9b4c Binary files /dev/null and b/GettingStarted/QuickStartDemo/Image_checkpoint_0.png differ diff --git a/GettingStarted/QuickStartDemo/Image_goal_0.png b/GettingStarted/QuickStartDemo/Image_goal_0.png new file mode 100644 index 0000000000..83f9f5aec8 Binary files /dev/null and b/GettingStarted/QuickStartDemo/Image_goal_0.png differ diff --git a/GettingStarted/QuickStartDemo/Image_goal_1.png b/GettingStarted/QuickStartDemo/Image_goal_1.png new file mode 100644 index 0000000000..e608e0cdc0 Binary files /dev/null and b/GettingStarted/QuickStartDemo/Image_goal_1.png differ diff --git a/GettingStarted/QuickStartDemo/Image_goal_2.png b/GettingStarted/QuickStartDemo/Image_goal_2.png new file mode 100644 index 0000000000..97447af339 Binary files /dev/null and b/GettingStarted/QuickStartDemo/Image_goal_2.png differ diff --git a/GettingStarted/QuickStartDemo/Image_path.png b/GettingStarted/QuickStartDemo/Image_path.png new file mode 100644 index 0000000000..9742e76f9e Binary files /dev/null and b/GettingStarted/QuickStartDemo/Image_path.png differ diff --git a/GettingStarted/QuickStartDemo/Image_running.png b/GettingStarted/QuickStartDemo/Image_running.png new file mode 100644 index 0000000000..2009c5c5b5 Binary files /dev/null and b/GettingStarted/QuickStartDemo/Image_running.png differ diff --git a/GettingStarted/QuickStartDemo/Image_top.png b/GettingStarted/QuickStartDemo/Image_top.png new file mode 100644 index 0000000000..aa67f28597 Binary files /dev/null and b/GettingStarted/QuickStartDemo/Image_top.png differ diff --git a/GettingStarted/QuickStartDemo/index.html b/GettingStarted/QuickStartDemo/index.html new file mode 100644 index 0000000000..7bd78a9454 --- /dev/null +++ b/GettingStarted/QuickStartDemo/index.html @@ -0,0 +1,2897 @@ + + + + + + + + + + + + + + + + + + + + + + + Quick Start Demo - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Quick Start Demo

+

Below you can find instructions on how to setup the self-driving demo of AWSIM simulation controlled by Autoware. +The instruction assumes using the Ubuntu OS.

+

+

Demo configuration

+

The simulation provided in the AWSIM demo is configured as follows:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AWSIM Demo Settings
VehicleLexus RX 450h
EnvironmentJapan Tokyo Nishishinjuku
SensorsGnss * 1
IMU * 1
LiDAR * 1
Traffic camera * 1
TrafficRandomized traffic
ROS2humble
+

PC specs

+

Please make sure that your machine meets the following requirements in order to run the simulation correctly:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Required PC Specs
OSUbuntu 22.04
CPU6cores and 12thread or higher
GPURTX2080Ti or higher
Nvidia Driver (Windows)>=472.50
Nvidia Driver (Ubuntu 22)>=515.43.04
+

Localhost settings

+

The simulation is based on the appropriate network setting, which allows for trouble-free communication of the AWSIM simulation with the Autoware software. +To apply required localhost settings please add the following lines to ~/.bashrc file:

+
if [ ! -e /tmp/cycloneDDS_configured ]; then
+    sudo sysctl -w net.core.rmem_max=2147483647
+    sudo ip link set lo multicast on
+    touch /tmp/cycloneDDS_configured
+fi
+
+

and these lines to ~/.profile or in either of files: ~/.bash_profile or ~/.bash_login:

+
export ROS_LOCALHOST_ONLY=1
+export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
+
+
+

Warning

+

A system restart is required for these changes to work.

+
+

Start the demo

+

Running the AWSIM simulation demo

+

To run the simulator, please follow the steps below.

+
    +
  1. +

    Install Nvidia GPU driver (Skip if already installed).

    +
      +
    1. Add Nvidia driver to apt repository +
      sudo add-apt-repository ppa:graphics-drivers/ppa
      +sudo apt update
      +
    2. +
    3. +

      Install the recommended version of the driver. +

      sudo ubuntu-drivers autoinstall
      +

      +
      +

      Warning

      +

      Currently, there are cases where the Nvidia driver version is too high, resulting in Segmentation fault. In that case, please lower the Nvidia driver version (525 is recommended.)

      +
      +
    4. +
    5. +

      Reboot your machine to make the installed driver detected by the system. +

      sudo reboot
      +

      +
    6. +
    7. Open terminal and check if nvidia-smi command is available and outputs summary similar to the one presented below. +
      $ nvidia-smi 
      +Fri Oct 14 01:41:05 2022       
      ++-----------------------------------------------------------------------------+
      +| NVIDIA-SMI 515.65.01    Driver Version: 515.65.01    CUDA Version: 11.7     |
      +|-------------------------------+----------------------+----------------------+
      +| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
      +| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
      +|                               |                      |               MIG M. |
      +|===============================+======================+======================|
      +|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
      +| 37%   31C    P8    30W / 250W |    188MiB / 11264MiB |      3%      Default |
      +|                               |                      |                  N/A |
      ++-------------------------------+----------------------+----------------------+
      +
      ++-----------------------------------------------------------------------------+
      +| Processes:                                                                  |
      +|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
      +|        ID   ID                                                   Usage      |
      +|=============================================================================|
      +|    0   N/A  N/A      1151      G   /usr/lib/xorg/Xorg                133MiB |
      +|    0   N/A  N/A      1470      G   /usr/bin/gnome-shell               45MiB |
      ++-----------------------------------------------------------------------------+
      +
    8. +
    +
  2. +
  3. +

    Install Vulkan Graphics Library (Skip if already installed).

    +
      +
    1. Update the environment. +
      sudo apt update
      +
    2. +
    3. Install the library. +
      sudo apt install libvulkan1
      +
    4. +
    +
  4. +
  5. +

    Download and Run AWSIM Demo binary.

    +
      +
    1. +

      Download AWSIM_v1.2.3.zip.

      +

      Download AWSIM Demo for ubuntu

      +
    2. +
    3. +

      Unzip the downloaded file.

      +
    4. +
    5. +

      Make the AWSIM.x86_64 file executable.

      +

      Rightclick the AWSIM.x86_64 file and check the Execute checkbox

      +

      +

      or execute the command below.

      +
      chmod +x <path to AWSIM folder>/AWSIM.x86_64
      +
      +
    6. +
    7. +

      Launch AWSIM.x86_64. +

      ./<path to AWSIM folder>/AWSIM.x86_64
      +

      +
      +

      Warning

      +

      It may take some time for the application to start the so please wait until image similar to the one presented below is visible in your application window.

      +
      +

      +
    8. +
    +
  6. +
+

Launching Autoware

+

In order to configure and run the Autoware software with the AWSIM demo, please:

+
    +
  1. +

    Download map files (pcd, osm) and unzip them.

    +

    Download Map files (pcd, osm)

    +
  2. +
  3. +

    Clone Autoware and move to the directory. +

    git clone https://github.com/autowarefoundation/autoware.git
    +cd autoware
    +

    +
  4. +
  5. Switch branche to awsim-stable. NOTE: The latest main branch is for ROS 2 humble. +
    git checkout awsim-stable
    +
  6. +
  7. Configure the environment. (Skip if Autoware environment has been configured before) +
    ./setup-dev-env.sh
    +
  8. +
  9. Create the src directory and clone external dependent repositories into it. +
    mkdir src
    +vcs import src < autoware.repos
    +
  10. +
  11. Install dependent ROS packages. +
    source /opt/ros/humble/setup.bash
    +rosdep update
    +rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
    +
  12. +
  13. Build the workspace. +
    colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-w"
    +
  14. +
  15. +

    Launch Autoware.

    +
    +

    Warning

    +

    <your mapfile location> must be changed arbitrarily. When specifying the path the ~ operator cannot be used - please specify absolute full path.

    +
    +

    source install/setup.bash
    +ros2 launch autoware_launch e2e_simulator.launch.xml vehicle_model:=sample_vehicle sensor_model:=awsim_sensor_kit map_path:=<your mapfile location>
    +
    +

    +
  16. +
+

Let's run the self-Driving simulation

+
    +
  1. +

    Launch AWSIM and Autoware according to the steps described earlier in this document. +

    +
  2. +
  3. +

    The Autoware will automatically set its pose estimation as presented below. +

    +
  4. +
  5. +

    Set the navigation goal for the vehicle. + +

    +
  6. +
  7. +

    Optionally, you can define an intermediate point through which the vehicle will travel on its way to the destination. + +The generated path can be seen on the image below. +

    +
  8. +
  9. +

    Enable self-driving.

    +
  10. +
+

To make the vehicle start navigating please engage it's operation using the command below.

+
cd autoware
+source install/setup.bash
+ros2 topic pub /autoware/engage autoware_auto_vehicle_msgs/msg/Engage '{engage: True}' -1
+
+

+

The self-driving simulation demo has been successfully launched!

+

Troubleshooting

+

In case of any problems with running the sample AWSIM binary with Autoware, start with checking our Troubleshooting page with the most common problems.

+

Appendix

+ + + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GettingStarted/SetupUnityProject/image_0.png b/GettingStarted/SetupUnityProject/image_0.png new file mode 100644 index 0000000000..139648a0ed Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_0.png differ diff --git a/GettingStarted/SetupUnityProject/image_1.png b/GettingStarted/SetupUnityProject/image_1.png new file mode 100644 index 0000000000..0513ee1fe5 Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_1.png differ diff --git a/GettingStarted/SetupUnityProject/image_10.png b/GettingStarted/SetupUnityProject/image_10.png new file mode 100644 index 0000000000..b326126d99 Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_10.png differ diff --git a/GettingStarted/SetupUnityProject/image_11.png b/GettingStarted/SetupUnityProject/image_11.png new file mode 100644 index 0000000000..d92823d122 Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_11.png differ diff --git a/GettingStarted/SetupUnityProject/image_12.png b/GettingStarted/SetupUnityProject/image_12.png new file mode 100644 index 0000000000..fabe4130c1 Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_12.png differ diff --git a/GettingStarted/SetupUnityProject/image_13.png b/GettingStarted/SetupUnityProject/image_13.png new file mode 100644 index 0000000000..4ffc7e62ca Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_13.png differ diff --git a/GettingStarted/SetupUnityProject/image_2.png b/GettingStarted/SetupUnityProject/image_2.png new file mode 100644 index 0000000000..43daf4bec4 Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_2.png differ diff --git a/GettingStarted/SetupUnityProject/image_3.png b/GettingStarted/SetupUnityProject/image_3.png new file mode 100644 index 0000000000..a8bdf01dfe Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_3.png differ diff --git a/GettingStarted/SetupUnityProject/image_4.png b/GettingStarted/SetupUnityProject/image_4.png new file mode 100644 index 0000000000..9fd756b94c Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_4.png differ diff --git a/GettingStarted/SetupUnityProject/image_5.png b/GettingStarted/SetupUnityProject/image_5.png new file mode 100644 index 0000000000..032e4cf240 Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_5.png differ diff --git a/GettingStarted/SetupUnityProject/image_6.png b/GettingStarted/SetupUnityProject/image_6.png new file mode 100644 index 0000000000..3dc757d3f9 Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_6.png differ diff --git a/GettingStarted/SetupUnityProject/image_7.png b/GettingStarted/SetupUnityProject/image_7.png new file mode 100644 index 0000000000..9bad2760a7 Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_7.png differ diff --git a/GettingStarted/SetupUnityProject/image_7_.png b/GettingStarted/SetupUnityProject/image_7_.png new file mode 100644 index 0000000000..961aac9c22 Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_7_.png differ diff --git a/GettingStarted/SetupUnityProject/image_8.png b/GettingStarted/SetupUnityProject/image_8.png new file mode 100644 index 0000000000..781b2e3e6d Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_8.png differ diff --git a/GettingStarted/SetupUnityProject/image_9.png b/GettingStarted/SetupUnityProject/image_9.png new file mode 100644 index 0000000000..5eb20a4564 Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_9.png differ diff --git a/GettingStarted/SetupUnityProject/image_9_.png b/GettingStarted/SetupUnityProject/image_9_.png new file mode 100644 index 0000000000..4559166c7a Binary files /dev/null and b/GettingStarted/SetupUnityProject/image_9_.png differ diff --git a/GettingStarted/SetupUnityProject/index.html b/GettingStarted/SetupUnityProject/index.html new file mode 100644 index 0000000000..088566c81a --- /dev/null +++ b/GettingStarted/SetupUnityProject/index.html @@ -0,0 +1,2824 @@ + + + + + + + + + + + + + + + + + + + + + + + Setup Unity Project - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Setup Unity Project

+
+

Info

+

It is advised to checkout the Quick Start Demo tutorial before reading this section.

+
+

This page is a tutorial for setting up a AWSIM Unity project.

+

Environment preparation

+

System setup

+
+
+
+
    +
  1. Make sure your machine meets the required hardware specifications.
      +
    • NOTE: PC requirements may vary depending on simulation contents which may change as the simulator develops
    • +
    +
  2. +
  3. Prepare a desktop PC with Ubuntu 22.04 installed.
  4. +
  5. Install Nvidia drivers and Vulkan Graphics API.
  6. +
  7. Install git.
  8. +
  9. +

    Set the ROS 2 middleware and the localhost only mode in ~/.profile (or, in ~/.bash_profile or ~/bash_login if either of those exists) file: +

    export ROS_LOCALHOST_ONLY=1
    +export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
    +

    +
    +

    Warning

    +

    A system restart is required for these changes to work.

    +
    +
  10. +
  11. +

    Set the system optimizations by adding this code to the very bottom of your ~/.bashrc file: +

    if [ ! -e /tmp/cycloneDDS_configured ]; then
    +    sudo sysctl -w net.core.rmem_max=2147483647
    +    sudo ip link set lo multicast on
    +    touch /tmp/cycloneDDS_configured
    +fi
    +

    +
    +

    Info

    +

    As a result, each time you run the terminal (bash prompt), your OS will be configured for the best ROS 2 performance. Make sure you open your terminal at least one before running any instance of AWSIM (or Editor running the AWSIM).

    +
    +
  12. +
+
+
+
    +
  1. Make sure your machine meets the required hardware specifications.
      +
    • NOTE: PC requirements may vary depending on simulation contents which may change as the simulator develops
    • +
    +
  2. +
  3. Prepare a desktop PC with Windows 10 or 11 (64 bit) installed.
  4. +
  5. Install git.
  6. +
  7. Install Microsoft Visual C++ Redistributable packages for Visual Studio 2015, 2017, 2019, and 2022 (X64 Architecture)
  8. +
+
+
+
+

ROS 2

+

AWSIM comes with a standalone flavor of Ros2ForUnity. This means that, to avoid internal conflicts between different ROS 2 versions, you shouldn't run the Editor or AWSIM binary with ROS 2 sourced.

+
+

Warning

+

Do not run the AWSIM, Unity Hub, or the Editor with ROS 2 sourced.

+
+
+
+
+
    +
  • Make sure that the terminal which you are using to run Unity Hub, Editor, or AWSIM doesn't have ROS 2 sourced.
  • +
  • It is common to have ROS 2 sourced automatically with ~/.bashrc or ~/.profile. Make sure it is not obscuring your working environment:
      +
    • Running Unity Hub from the Ubuntu GUI menu takes the environment configuration from ~/.profile.
    • +
    • Running Unity Hub from the terminal uses the current terminal configuration from ~/.profile and ~/.bashrc.
    • +
    • Running Unity Editor from the UnityHub inherits the environment setup from the Unity Hub.
    • +
    +
  • +
+
+
+
    +
  • Make sure your Windows environment variables are ROS 2 free.
  • +
+
+
+
+

Unity installation

+
+

Info

+

AWSIM's Unity version is currently 2021.1.7f1

+
+

Follow the steps below to install Unity on your machine:

+
    +
  1. Install UnityHub to manage Unity projects. Please go to Unity download page and download latest UnityHub.AppImage. +
  2. +
  3. +

    Install Unity 2021.1.7f1 via UnityHub.

    +
      +
    • Open new terminal, navigate to directory where UnityHub.AppImage is download and execute the following command: +
      ./UnityHub.AppImage
      +
    • +
    • To install Unity Editor please proceed as shown on the images below + + +
    • +
    • +

      At this point, your Unity installation process should have started.

      +
      +
      +
      +
      +
      +
        +
      • *NOTE: If the installation process has not started after clicking the green button (image above), please copy the hyperlink (by rightclicking the button and selecting Copy link address) and add it as a argument for Unity Hub app. An example command: +
        ./UnityHub.AppImage unityhub://2021.1.7f1/d91830b65d9b
        +
      • +
      +
    • +
    • +

      After successful installation the version will be available under the Installs tab in Unity Hub. +

      +
    • +
    +
  4. +
+

Open AWSIM project

+

To open the Unity AWSIM project in Unity Editor:

+
+
+
+
    +
  1. +

    Make sure you have the AWSIM repository cloned and ROS 2 is not sourced. +

    git clone git@github.com:tier4/AWSIM.git
    +

    +
  2. +
  3. +

    Launch UnityHub. +

    ./UnityHub.AppImage
    +

    +
    +

    Info

    +

    If you are launching the Unity Hub from the Ubuntu applications menu (without the terminal), make sure that system optimizations are set. To be sure, run the terminal at least once before running the Unity Hub. This will apply the OS settings.

    +
    +
  4. +
  5. +

    Open the project in UnityHub

    +
      +
    • +

      Click the Open button +

      +
    • +
    • +

      Navigate the directory where the AWSIM repository was cloned to +

      +
    • +
    • +

      The project should be added to Projects tab in Unity Hub. To launch the project in Unity Editor simply click the AWSIM item +

      +
    • +
    • +

      The project is now ready to use +

      +
    • +
    +
  6. +
+
+
+
    +
  1. +

    Enter the AWSIM directory (make sure ROS 2 is not sourced). +

    cd AWSIM
    +

    +
  2. +
  3. +

    If your Unity Editor is in default location, run the project using the editor command. +

    ~/Unity/Hub/Editor/2021.1.7f1/Editor/Unity -projectPath .
    +

    +
    +

    Info

    +

    If your Unity Editor is installed in different location, please adjust the path accordingly.

    +
    +
  4. +
+
+
+
+
+

Warning

+

If you get the safe mode dialog when starting UnityEditor, you may need to install openssl.

+
    +
  1. download libssl
    +$ wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.13_amd64.deb
  2. +
  3. install
    +sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.13_amd64.deb
  4. +
+
+

Import external packages

+

To properly run and use AWSIM project in Unity it is required to download map package which is not included in the repository.

+
    +
  1. +

    Download and import Japan_Tokyo_Nishishinjuku.unitypackage_v2

    +

    Download Map files (unitypackage)

    +
  2. +
  3. +

    In Unity Editor, from the menu bar at the top, select Assets -> Import Package -> Custom Package... and navigate the Japan_Tokyo_Nishishinjuku.unitypackage_v2 file. + +

    +
  4. +
  5. Nishishinjuku package has been successfully imported under Assets/AWSIM/Externals/directory. +
  6. +
+
+

Info

+

The Externals directory is added to the .gitignore because the map has a large file size and should not be directly uploaded to the repository.

+
+

Run the demo in Editor

+

The following steps describe how to run the demo in Unity Editor:

+
    +
  1. Open the AutowareSimulation.unity scene placed under Assets/AWSIM/Scenes/Main directory
  2. +
  3. Run the simulation by clicking Play button placed at the top section of Editor. + +



  4. +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GettingStarted/UsingOpenSCENARIO/index.html b/GettingStarted/UsingOpenSCENARIO/index.html new file mode 100644 index 0000000000..015fc647b3 --- /dev/null +++ b/GettingStarted/UsingOpenSCENARIO/index.html @@ -0,0 +1,2624 @@ + + + + + + + + + + + + + + + + + + + + + + + Using OpenSCENARIO - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Using OpenSCENARIO

+
+

Warning

+

Running AWSIM with scenario_simulator_v2 is still a prototype, so stable running is not guaranteed.

+
+

Below you can find instructions on how to setup the OpenSCENARIO execution using scenario_simulator_v2 with AWSIM as a simulator +The instruction assumes using the Ubuntu OS.

+

Prerequisites

+

Follow Setup Unity Project tutorial

+

Build Autoware with scenario_simulator_v2

+

In order to configure the Autoware software with the AWSIM demo, please:

+
    +
  1. Clone RobotecAI's Autoware and move to the directory. +
    git clone git@github.com:RobotecAI/autoware-1.git
    +cd autoware
    +
  2. +
  3. Check out to the awsim-ss2-stable branch +
    git checkout awsim-ss2-stable
    +
  4. +
  5. Configure the environment. (Skip if Autoware environment has been configured before) +
    ./setup-dev-env.sh
    +
  6. +
  7. Create the src directory and clone external dependent repositories into it. +
    mkdir src
    +vcs import src < autoware.repos
    +vcs import src < simulator.repos
    +
  8. +
  9. +

    Download shinjuku_map.zip
    +archive

    +
  10. +
  11. +

    Unzip it to src/simulator directory +

    unzip <Download directory>/shinjuku_map.zip -d src/simulator
    +

    +
  12. +
  13. Install dependent ROS packages. +
    source /opt/ros/humble/setup.bash
    +rosdep update
    +rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
    +
  14. +
  15. Build the workspace. +
    colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-w"
    +
  16. +
+

Running the demo

+
    +
  1. +

    Download AWSIM_v1.2.2_ss2.zip & Run
    +archive

    +
  2. +
  3. +

    Launch scenario_test_runner. +

    source install/setup.bash
    +ros2 launch scenario_test_runner scenario_test_runner.launch.py                        \
    +architecture_type:=awf/universe  record:=false                                         \
    +scenario:='$(find-pkg-share scenario_test_runner)/scenario/sample_awsim.yaml'          \
    +sensor_model:=awsim_sensor_kit  vehicle_model:=sample_vehicle                          \
    +launch_simple_sensor_simulator:=false autoware_launch_file:="e2e_simulator.launch.xml" \
    +initialize_duration:=260 port:=8080
    +
    + ss2_awsim.png

    +
  4. +
+

Troubleshooting

+

In case of problems, make sure that the regular demo work well with the Autoware built above. Follow the troubleshooting page there if necessary.

+

Appendix

+ + + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GettingStarted/UsingOpenSCENARIO/ss2_awsim.png b/GettingStarted/UsingOpenSCENARIO/ss2_awsim.png new file mode 100644 index 0000000000..165adc96f1 Binary files /dev/null and b/GettingStarted/UsingOpenSCENARIO/ss2_awsim.png differ diff --git a/Introduction/AWSIM/awsim.png b/Introduction/AWSIM/awsim.png new file mode 100644 index 0000000000..e1d30b54be Binary files /dev/null and b/Introduction/AWSIM/awsim.png differ diff --git a/Introduction/AWSIM/awsim_draw.drawio b/Introduction/AWSIM/awsim_draw.drawio new file mode 100644 index 0000000000..5ec1ba26ed --- /dev/null +++ b/Introduction/AWSIM/awsim_draw.drawio @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Introduction/AWSIM/awsim_video.mp4 b/Introduction/AWSIM/awsim_video.mp4 new file mode 100644 index 0000000000..8f72e5e24e Binary files /dev/null and b/Introduction/AWSIM/awsim_video.mp4 differ diff --git a/Introduction/AWSIM/egovehicle.png b/Introduction/AWSIM/egovehicle.png new file mode 100644 index 0000000000..71a6afaa0b Binary files /dev/null and b/Introduction/AWSIM/egovehicle.png differ diff --git a/Introduction/AWSIM/egovehicle_draw.drawio b/Introduction/AWSIM/egovehicle_draw.drawio new file mode 100644 index 0000000000..1690a4a6d0 --- /dev/null +++ b/Introduction/AWSIM/egovehicle_draw.drawio @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Introduction/AWSIM/environment.png b/Introduction/AWSIM/environment.png new file mode 100644 index 0000000000..dbbec21f78 Binary files /dev/null and b/Introduction/AWSIM/environment.png differ diff --git a/Introduction/AWSIM/environment_draw.drawio b/Introduction/AWSIM/environment_draw.drawio new file mode 100644 index 0000000000..52727202ef --- /dev/null +++ b/Introduction/AWSIM/environment_draw.drawio @@ -0,0 +1,325 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Introduction/AWSIM/fixed_update_execution.jpg b/Introduction/AWSIM/fixed_update_execution.jpg new file mode 100644 index 0000000000..af421ddae3 --- /dev/null +++ b/Introduction/AWSIM/fixed_update_execution.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6694167095612a8d6f6120d4295faff3990246f7b437c495d8af7914c1eb5378 +size 40596 diff --git a/Introduction/AWSIM/index.html b/Introduction/AWSIM/index.html new file mode 100644 index 0000000000..b3904c7827 --- /dev/null +++ b/Introduction/AWSIM/index.html @@ -0,0 +1,2669 @@ + + + + + + + + + + + + + + + + + + + + + + + AWSIM - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

AWSIM

+ +

AWSIM is an open-source simulator made with Unity for autonomous driving research and development. +It is developed for self-driving software like Autoware. This simulator aims to bridge the gap between the virtual and real worlds, enabling users to train and evaluate their autonomous systems in a safe and controlled environment before deploying them on real vehicles. It provides a realistic virtual environment for training, testing, and evaluating various aspects of autonomous driving systems.

+

AWSIM simulates a variety of real-world scenarios, with accurate physics and sensor models. It offers a wide range of sensors, such as: Cameras, GNSS, IMU and LiDARs, allowing developers to simulate their autonomous vehicle's interactions with the environment accurately. The simulator also models dynamic objects, such as pedestrians, other vehicles, and traffic lights, making it possible to study interactions and decision-making in complex traffic scenarios. This enables the testing and evaluation of perception, planning, and control algorithms under different sensor configurations and scenarios.

+

AWSIM supports a flexible and modular architecture, making it easy to customize and extend its capabilities. Users can modify the current or add a new environment with their own assets and traffic rules to create custom scenarios to suit their specific research needs. This allows for the development and testing of advanced algorithms in diverse driving conditions.

+

Because AWSIM was developed mainly to work with Autoware, it supports:

+
    +
  • Ubuntu 22.04 and Windows 10/11
  • +
  • ROS2 Humble distribution
  • +
+
+

Prerequisites

+

You can read more about the prerequisites and running AWSIM here.

+
+
+

Connection with Autoware

+

Introduction about how the connection between AWSIM and Autoware works can be read here.

+
+

Why was AWSIM developed?

+

The main objectives of AWSIM are to facilitate research and development in autonomous driving, enable benchmarking of algorithms and systems, and foster collaboration and knowledge exchange within the autonomous driving community. By providing a realistic and accessible platform, AWSIM aims to accelerate the progress and innovation in the field of autonomous driving.

+

Architecture

+

+

To describe the architecture of AWSIM, first of all, it is necessary to mention the Scene. It contains all the objects occurring in the simulation of a specific scenario and their configurations. The default AWSIM scene that is developed to work with Autoware is called AutowareSimulation.

+

In the scene we can distinguish basics components such like MainCamera, ClockPublisher, EventSystem and Canvas. A detailed description of the scene and its components can be found here.

+

Besides the elements mentioned above, the scene contains two more, very important and complex components: Environment and EgoVehicle - described below.

+

Environment

+

+

Environment is a component that contains all Visual Elements that simulate the environment in the scene and those that provide control over them. It also contains two components Directional Light and Volume, which ensure suitable lighting for Visual Elements and simulate weather conditions. A detailed description of these components can be found here.

+

In addition to Visual Elements such as buildings or greenery, it contains the entire architecture responsible for traffic. The traffic involves NPCVehicles that are spawned in the simulation by TrafficSimulator - using traffic components. A quick overview of the traffic components is provided below, however, you can read their detailed description here.

+

NPCPedestrians are also Environment components, but they are not controlled by TrafficSimulator. They have added scripts that control their movement - you can read more details here.

+
Traffic Components
+

TrafficLanes and StopLines are elements loaded into Environment from Lanelet2. +TrafficLanes have defined cross-references in such a way as to create routes along the traffic lanes. In addition, each TrafficLane present at the intersection has specific conditions for yielding priority. TrafficSimulator uses TrafficLanes to spawn NPCVehicles and ensure their movement along these lanes. If some TrafficLanes ends just before the intersection, then it has a reference to StopLine. Each StopLine at the intersection with TrafficLights has reference to the nearest TrafficLight. TrafficLights belong to one of the visual element groups and provide an interface to control visual elements that simulate traffic light sources (bulbs). A single TrafficIntersection is responsible for controlling all TrafficLights at one intersection. +Detailed description of mentioned components is in this section.

+

EgoVehicle

+

+

EgoVehicle is a component responsible for simulating an autonomous vehicle moving around the scene. It includes:

+
    +
  • Models and Reflection Probe components related to its visual appearance.
  • +
  • Colliders providing collisions and the ability to move on roads.
  • +
  • Sensors providing data related to the state of the vehicle, including its position and speed in Environment and the state of its surroundings.
  • +
  • Vehicle component that simulates dynamics, controls **Wheel and is responsible for ensuring their movement.
  • +
  • Vehicle Ros Input and Vehicle Keyboard Inputcomponents that have a reference to the Vehicle object and set control commands in it.
  • +
  • Vehicle Visual Effect provides an interface for Vehicle to control the lighting.
  • +
+

A detailed description of EgoVehicle and its components mentioned above can be found here. The sensor placement on EgoVehicle used in the default scene is described here. Details about each of the individual sensors are available in the following sections: Pose, GNSS, LiDAR, IMU, Camera, Vehicle Status.

+

FixedUpdate Limitation

+

In AWSIM, the sensors' publishing methods are triggered from the FixedUpdate function and the output frequency is controlled by:

+
time += Time.deltaTime;
+var interval = 1.0f / OutputHz;
+interval -= 0.00001f; // Allow for accuracy errors.
+if (time < interval)
+    return;
+timer = 0;
+
+

Since this code runs within the FixedUpdate method, it's essential to note that Time.deltaTime is equal to Fixed Timestep, as stated in the Unity Time.deltaTime documentation. Consequently, with each invocation of FixedUpdate, the time variable in the sensor script will increment by a constant value of Fixed Timestep, independent of the actual passage of real-time. Additionally, as outlined in the Unity documentation, the FixedUpdate method might execute multiple times before the Update method is called, resulting in extremely small time intervals between successive FixedUpdate calls. The diagram below illustrates the mechanism of invoking the FixedUpdate event function."

+

+

During each frame (game tick) following actions are performed:

+
    +
  • first, the Delta Time is calculated as the difference between the current frame and the previous frame,
  • +
  • next, the Delta Time is added to the Time (regular time),
  • +
  • afterward, a check is made to determine how much Fixed Time (physics time) is behind the Time,
  • +
  • if the difference between Time and Fixed Time is equal to or greater then Fixed Timestep, the Fixed Update event function is invoked,
  • +
  • if FixedUpdate function were called, the Fixed Timestep is added to the Fixed Time,
  • +
  • once again, a check is performed to assess how much Fixed Time is behind the Time,
  • +
  • if necessary, the FixedUpdate function is called again,
  • +
  • if the difference between the Time and the Fixed Time is smaller than the Fixed Timestep, the Update method is called, followed be scene rendering and other Unity event functions.
  • +
+

As a consequence, this engine feature may result in unexpected behavior when FPS (Frames Per Second) are unstable or under certain combinations of FPS, Fixed Timestep, and sensor OutputHz

+

In case of low frame rates, it is advisable to reduce the Time Scale of the simulation. The Time Scale value impacts simulation time, which refers to the time that is simulated within the model and might or might not progress at the same rate as real-time. Therefore, by reducing the time scale, the progression of simulation time slows down, allowing the simulation more time to perform its tasks.

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Introduction/Autoware/autoware.drawio b/Introduction/Autoware/autoware.drawio new file mode 100644 index 0000000000..4b0063df0e --- /dev/null +++ b/Introduction/Autoware/autoware.drawio @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Introduction/Autoware/autoware.png b/Introduction/Autoware/autoware.png new file mode 100644 index 0000000000..6f0f752b18 Binary files /dev/null and b/Introduction/Autoware/autoware.png differ diff --git a/Introduction/Autoware/autoware_ss.png b/Introduction/Autoware/autoware_ss.png new file mode 100644 index 0000000000..099d1833cf Binary files /dev/null and b/Introduction/Autoware/autoware_ss.png differ diff --git a/Introduction/Autoware/index.html b/Introduction/Autoware/index.html new file mode 100644 index 0000000000..4ba8723169 --- /dev/null +++ b/Introduction/Autoware/index.html @@ -0,0 +1,2538 @@ + + + + + + + + + + + + + + + + + + + + + + + Autoware - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Autoware

+

+

Autoware is an open-source software platform specifically designed for autonomous driving applications. It was created to provide a comprehensive framework for developing and testing autonomous vehicle systems. Autoware offers a collection of modules and libraries that assist in various tasks related to perception, planning, and control, making it easier for researchers and developers to build autonomous driving systems.

+

The primary purpose of Autoware is to enable the development of self-driving technologies by providing a robust and flexible platform. It aims to accelerate the research and deployment of autonomous vehicles by offering a ready-to-use software stack. Autoware focuses on urban driving scenarios and supports various sensors such as LiDAR, Radars, and Cameras, allowing for perception of the vehicle's surroundings.

+

Why use AWSIM with Autoware?

+

Autoware can be used with a AWSIM for several reasons. Firstly, simulators like AWSIM provide a cost-effective and safe environment for testing and validating autonomous driving algorithms before deploying them on real vehicles. Autoware's integration with a simulator allows developers to evaluate and fine-tune their algorithms without the risk of real-world accidents or damage.

+

Additionally, simulators enable developers to recreate complex driving scenarios, including difficult conditions or rare events, which may be difficult to replicate in real-world testing with such high fidelity. Autoware's compatibility with a AWSIM allows seamless integration between the software and the simulated vehicle, enabling comprehensive testing and validation of autonomous driving capabilities. By utilizing a simulator, Autoware can be extensively tested under various scenarios to ensure its robustness and reliability.

+
+

Connection with Autoware

+

Introduction about how the connection between AWSIM and Autoware works can be read here.

+
+

Architecture

+

+

In terms of architecture, Autoware follows a modular approach. It consists of multiple independent modules that communicate with each other through a ROS2. This modular structure allowing users to select and combine different modules based on their specific needs and requirements. The software stack comprises multiple components, including perception, localization, planning, and control modules. Here's a brief overview of each module:

+
    +
  • +

    Sensing - acquires data from sensors different sensors mounted on the autonomous vehicle such as LiDARs, GNSS, IMU and cameras. It pre-processing received data in order to later extract relevant information about the surrounding environment through the Perception module or about vehicle location by the Localization module. +More details here.

    +
  • +
  • +

    Perception - performs advanced processing of sensor data (LiDARs, cameras) to extract meaningful information about the surrounding environment. It performs tasks like object detection (other vehicles, pedestrians), lane detection, and traffic lights recognition. More details here.

    +
  • +
  • +

    Localization - performs a fusion of data from Sensing module like LiDAR, GNSS, IMU, and odometry sensors to estimate the vehicle's position and orientation accurately. More details here.

    +
  • +
  • +

    Planning - generates a safe and feasible trajectory for the autonomous vehicle based on the information gathered from Perception and Localization. It also takes into account various factors from Map like traffic rules and road conditions. More details here.

    +
  • +
  • +

    Control - executes the planned trajectory by sending commands to the vehicle's actuators, such as steering, throttle, and braking. It ensures that the vehicle follows the desired trajectory while maintaining safety and stability. More details here.

    +
  • +
  • +

    Vehicle Interface - is a crucial component that enables communication and interaction between Autoware software system and a vehicle. It facilitates the exchange of control signals and vehicle information necessary for autonomous driving operations. The vehicle interface ensures that Autoware can send commands to the vehicle, such as acceleration, braking, and steering, while also receiving real-time data from the vehicle, such as speed, position, and sensors data. It acts as a bridge, allowing Autoware to seamlessly interface with the specific characteristics and requirements of the vehicle it is operating with. More details here.

    +
  • +
  • +

    Map - the map module creates and maintains a representation of the environment in which the autonomous vehicle operates. It combines data from Lanelet2 (*.osm) and PointCloud (*.pcd) to generate a detailed map. The map contains information about road geometries, lane markings, traffic lights, rules, and other relevant features. Map serves as a crucial reference for planning and decision-making processes. More details here.

    +
  • +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Introduction/CombinationWithAutoware/autoware_awsim_sequence.png b/Introduction/CombinationWithAutoware/autoware_awsim_sequence.png new file mode 100644 index 0000000000..aecc2340ca Binary files /dev/null and b/Introduction/CombinationWithAutoware/autoware_awsim_sequence.png differ diff --git a/Introduction/CombinationWithAutoware/autoware_awsim_sequence_draw.drawio b/Introduction/CombinationWithAutoware/autoware_awsim_sequence_draw.drawio new file mode 100644 index 0000000000..7a6b64c4a9 --- /dev/null +++ b/Introduction/CombinationWithAutoware/autoware_awsim_sequence_draw.drawio @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Introduction/CombinationWithAutoware/awsim_autoware.png b/Introduction/CombinationWithAutoware/awsim_autoware.png new file mode 100644 index 0000000000..5fd83fc4aa Binary files /dev/null and b/Introduction/CombinationWithAutoware/awsim_autoware.png differ diff --git a/Introduction/CombinationWithAutoware/awsim_autoware_draw.drawio b/Introduction/CombinationWithAutoware/awsim_autoware_draw.drawio new file mode 100644 index 0000000000..8a3114ae48 --- /dev/null +++ b/Introduction/CombinationWithAutoware/awsim_autoware_draw.drawio @@ -0,0 +1,456 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Introduction/CombinationWithAutoware/awsim_video.mp4 b/Introduction/CombinationWithAutoware/awsim_video.mp4 new file mode 100644 index 0000000000..b3bf86a170 Binary files /dev/null and b/Introduction/CombinationWithAutoware/awsim_video.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/DRIVE_GREEN.mp4 b/Introduction/CombinationWithAutoware/features/DRIVE_GREEN.mp4 new file mode 100644 index 0000000000..31cb399586 Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/DRIVE_GREEN.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/DRIVE_STRAIGHT.mp4 b/Introduction/CombinationWithAutoware/features/DRIVE_STRAIGHT.mp4 new file mode 100644 index 0000000000..d75d70e42e Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/DRIVE_STRAIGHT.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/DRIVE_TURN.mp4 b/Introduction/CombinationWithAutoware/features/DRIVE_TURN.mp4 new file mode 100644 index 0000000000..c9728279e7 Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/DRIVE_TURN.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/DRIVE_YELLOW.mp4 b/Introduction/CombinationWithAutoware/features/DRIVE_YELLOW.mp4 new file mode 100644 index 0000000000..cb3e75406d Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/DRIVE_YELLOW.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/DRIVE_YELLOW2.mp4 b/Introduction/CombinationWithAutoware/features/DRIVE_YELLOW2.mp4 new file mode 100644 index 0000000000..978f7068c8 Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/DRIVE_YELLOW2.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/WAIT_RED.mp4 b/Introduction/CombinationWithAutoware/features/WAIT_RED.mp4 new file mode 100644 index 0000000000..6b519815bb Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/WAIT_RED.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/WAIT_YELLOW2.mp4 b/Introduction/CombinationWithAutoware/features/WAIT_YELLOW2.mp4 new file mode 100644 index 0000000000..b0b745fe27 Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/WAIT_YELLOW2.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/bad_cut_in.mp4 b/Introduction/CombinationWithAutoware/features/bad_cut_in.mp4 new file mode 100644 index 0000000000..26bcab0cd5 Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/bad_cut_in.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/bad_pedestrian_detection.mp4 b/Introduction/CombinationWithAutoware/features/bad_pedestrian_detection.mp4 new file mode 100644 index 0000000000..a834bddb98 Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/bad_pedestrian_detection.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/pedestrian_crosswalk.mp4 b/Introduction/CombinationWithAutoware/features/pedestrian_crosswalk.mp4 new file mode 100644 index 0000000000..7a5883080d Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/pedestrian_crosswalk.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/pedestrian_road.mp4 b/Introduction/CombinationWithAutoware/features/pedestrian_road.mp4 new file mode 100644 index 0000000000..712cd6c54f Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/pedestrian_road.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/vehicle_cut_in.mp4 b/Introduction/CombinationWithAutoware/features/vehicle_cut_in.mp4 new file mode 100644 index 0000000000..25ef0fe9e5 Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/vehicle_cut_in.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/vehicle_following.mp4 b/Introduction/CombinationWithAutoware/features/vehicle_following.mp4 new file mode 100644 index 0000000000..46b3af92df Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/vehicle_following.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/vehicle_right_of_way.mp4 b/Introduction/CombinationWithAutoware/features/vehicle_right_of_way.mp4 new file mode 100644 index 0000000000..91ad0f1432 Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/vehicle_right_of_way.mp4 differ diff --git a/Introduction/CombinationWithAutoware/features/vehicle_sudden.mp4 b/Introduction/CombinationWithAutoware/features/vehicle_sudden.mp4 new file mode 100644 index 0000000000..d9ab0c80a7 Binary files /dev/null and b/Introduction/CombinationWithAutoware/features/vehicle_sudden.mp4 differ diff --git a/Introduction/CombinationWithAutoware/index.html b/Introduction/CombinationWithAutoware/index.html new file mode 100644 index 0000000000..1ac7fbd0c1 --- /dev/null +++ b/Introduction/CombinationWithAutoware/index.html @@ -0,0 +1,2757 @@ + + + + + + + + + + + + + + + + + + + + + + + CombinationWithAutoware - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

CombinationWithAutoware

+ + + +

Autoware is a powerful open-source software platform for autonomous driving. Its modular architecture, including perception, localization, planning, and control modules, provides a comprehensive framework for developing self-driving vehicles. Autoware combined with AWSIM simulator provides safe testing, validation, and optimization of autonomous driving algorithms in diverse scenarios.

+
+

Run with Autoware

+

If you would like to know how to run AWSIM with Autoware, we encourage you to read this section.

+
+

Features

+

The combination of Autoware and AWSIM provides the opportunity to check the correctness of the vehicle's behavior in various traffic situations. Below are presented some typical features provided by this combination. Moreover, examples of detecting several bad behaviors are included.

+

Engagement

+
    +
  • +

    Driving straight through an intersection with priority

    +

    +
  • +
  • +

    Turning at the intersection

    +

    +
  • +
+

Traffic light recognition

+
    +
  • +

    Stopping at a red light

    +

    +
  • +
  • +

    Driving on a green light

    +

    +
  • +
  • +

    Stopping at yellow light

    +

    +
  • +
  • +

    Still driving at yellow light (only when it is too late to stop)

    +

    +
  • +
+

Interaction with vehicles

+
    +
  • +

    Yield right-of-way when turning right

    +

    +
  • +
  • +

    Following the vehicles ahead

    +

    +
  • +
  • +

    Stopping behind the vehicles ahead

    +

    +
  • +
  • +

    Cutting-in to a different traffic lane

    +

    +
  • +
+

Interaction with pedestrians

+
    +
  • +

    Giving right of way to a pedestrian crossing at a red light

    +

    +
  • +
  • +

    Giving way to a pedestrian crossing beyond a crosswalk

    +

    +
  • +
+

Detecting bad behaviors

+
    +
  • +

    Incorrect and dangerous execution of a lane change

    +

    +
  • +
  • +

    Too late detection of a pedestrian entering the roadway

    +

    +
  • +
+

Combination Architecture

+

+

The combination of AWSIM with Autoware is possible thanks to Vehicle Interface and Sensing modules of Autoware architecture. The component responsible for ensuring connection with these modules from the AWSIM side is EgoVehicle. It has been adapted to the Autoware architecture and provides ROS2 topic-based communication. However, the other essential component is ClockPublisher, which provides simulation time for Autoware - also published on the topic - more details here.

+

EgoVehicle component provides the publication of the current vehicle status through a script working within Vehicle Status. It provides real-time information such as: current speed, current steering of the wheels or current states of lights - these are outputs from AWSIM.

+

On the other hand, Vehicle Ros Input is responsible for providing the values of the outputs from Autoware. It subscribes to the current commands related to the given acceleration, gearbox gear or control of the specified lights.

+

Execution of the received commands is possible thanks to Vehicle, which ensures the setting of appropriate accelerations on the **Wheel and controlling the visual elements of the vehicle.

+

The remaining data delivered from AWSIM to Autoware are sensors data, which provides information about the current state of the surrounding environment and those necessary to accurately estimate EgoVehicle position.

+

More about EgoVehicle and its scripts is described in this section.

+

Sequence diagram

+

Below is a simplified sequential diagram of information exchange in connection between AWSIM and Autoware. As you can see, the first essential information published from AWSIM is Clock - the simulation time. Next, EgoVehicle is spawned and first sensors data are published, which are used in the process of automatic position initialization on Autoware side. At the same time, the simulation on AWSIM side is updated.

+

Next in the diagram is the main information update loop in which:

+
    +
  • During each cycle there is a synchronization with the time from the simulation.
  • +
  • AWSIM publishes data from sensors available in EgoVehicle, which are taken into account in the processes carried out in Autoware.
  • +
  • The control commands from Autoware are subscribed by AWSIM, which are executed on AWSIM side and EgoVehicle update is performed.
  • +
  • The current state of the EgoVehicle is published.
  • +
+

The order of information exchange presented in the diagram is a simplification. The exchange of information takes place through the publish-subscribe model and each data is sent with a predefined frequency.

+

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Introduction/CombinationWithAutoware/stop_red.gif b/Introduction/CombinationWithAutoware/stop_red.gif new file mode 100644 index 0000000000..c3c7a6f62b Binary files /dev/null and b/Introduction/CombinationWithAutoware/stop_red.gif differ diff --git a/Introduction/CombinationWithAutoware/straight_green.gif b/Introduction/CombinationWithAutoware/straight_green.gif new file mode 100644 index 0000000000..120c62d450 Binary files /dev/null and b/Introduction/CombinationWithAutoware/straight_green.gif differ diff --git a/Introduction/CombinationWithAutoware/straight_yellow.gif b/Introduction/CombinationWithAutoware/straight_yellow.gif new file mode 100644 index 0000000000..67ff567e44 Binary files /dev/null and b/Introduction/CombinationWithAutoware/straight_yellow.gif differ diff --git a/Introduction/CombinationWithAutoware/turn_green.gif b/Introduction/CombinationWithAutoware/turn_green.gif new file mode 100644 index 0000000000..4a71aed649 Binary files /dev/null and b/Introduction/CombinationWithAutoware/turn_green.gif differ diff --git a/Introduction/CombinationWithAutowareAndScenarioSimulator/awsim_ss2.png b/Introduction/CombinationWithAutowareAndScenarioSimulator/awsim_ss2.png new file mode 100644 index 0000000000..362fcbfa4b Binary files /dev/null and b/Introduction/CombinationWithAutowareAndScenarioSimulator/awsim_ss2.png differ diff --git a/Introduction/CombinationWithAutowareAndScenarioSimulator/awsim_ss2_draw.drawio b/Introduction/CombinationWithAutowareAndScenarioSimulator/awsim_ss2_draw.drawio new file mode 100644 index 0000000000..394697e82e --- /dev/null +++ b/Introduction/CombinationWithAutowareAndScenarioSimulator/awsim_ss2_draw.drawio @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Introduction/CombinationWithAutowareAndScenarioSimulator/awsim_ss2_sequence.png b/Introduction/CombinationWithAutowareAndScenarioSimulator/awsim_ss2_sequence.png new file mode 100644 index 0000000000..2b3fa12e37 Binary files /dev/null and b/Introduction/CombinationWithAutowareAndScenarioSimulator/awsim_ss2_sequence.png differ diff --git a/Introduction/CombinationWithAutowareAndScenarioSimulator/awsim_ss2_sequence_draw.drawio b/Introduction/CombinationWithAutowareAndScenarioSimulator/awsim_ss2_sequence_draw.drawio new file mode 100644 index 0000000000..72ad5ac03b --- /dev/null +++ b/Introduction/CombinationWithAutowareAndScenarioSimulator/awsim_ss2_sequence_draw.drawio @@ -0,0 +1,396 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Introduction/CombinationWithAutowareAndScenarioSimulator/index.html b/Introduction/CombinationWithAutowareAndScenarioSimulator/index.html new file mode 100644 index 0000000000..ba624c6b77 --- /dev/null +++ b/Introduction/CombinationWithAutowareAndScenarioSimulator/index.html @@ -0,0 +1,2428 @@ + + + + + + + + + + + + + + + + + + + Combination with Autoware and Scenario simulator v2 - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Combination with Autoware and Scenario simulator v2

+

+

Scenario Simulator v2 (SS2) is a scenario testing framework specifically developed for Autoware, an open-source self-driving software platform. It serves as a tool for Autoware developers to conveniently create and execute scenarios across different simulators.

+

The primary goal of SS2 is to provide Autoware developers with an efficient means of writing scenarios once and then executing them in multiple simulators. By offering support for different simulators and scenario description formats, the framework ensures flexibility and compatibility.

+

The default scenario format in this framework is TIER IV Scenario Format version 2.0. The scenario defined on this format is converted by scenario_test_runner to openSCENARIO format, which is then interpreted by openscenario_interpreter. Based on this interpretation, traffic_simulator simulates traffic flow in an urban area. Each NPC has a behavior tree and executes commands from the scenario.

+

The framework uses ZeroMQ Inter-Process communication for seamless interaction between the simulator and the traffic_simulator. To ensure synchronous operation of the simulators, SS2 utilizes the Request/Reply sockets provided by ZeroMQ and exchanges binarized data through Protocol Buffers. This enables the simulators to run in a synchronized manner, enhancing the accuracy and reliability of scenario testing.

+
+

QuickStart Scenario simulator v2 with Autoware

+

If you would like to see how SS2 works with Autoware using default build-in simulator - simple_sensor_simulator (without running AWSIM) - we encourage you to read this tutorial.

+
+

Combination Architecture

+

+

AWSIM scene architecture used in combination with SS2 changes considerably compared to the default scene. Here traffic_simulator from SS2 replaces TrafficSimulator implementation in AWSIM - for this reason it and its StopLines, TrafficLanes and TrafficIntersection components are removed. Also, NPCPedestrian and NPCVehicles are not added as aggregators of NPCs in Environment.

+

Instead, their counterparts are added in ScenarioSimulatorConnector object that is responsible for spawning Entities of the scenario. Entity can be: Pedestrian, Vehicle, MiscObject and Ego. +EgoEntity is the equivalent of EgoVehicle - which is also removed from the default scene. However, it has the same components - it still communicates with Autoware as described here. So it can be considered that EgoVehicle has not changed and NPCPedestrians and NPCVehicles are now controlled directly by the SS2.

+

A detailed description of the SS2 architecture is available here. A description of the communication via ROS2 between SS2 and Autoware can be found here.

+

Sequence diagram

+

In the sequence diagram, the part responsible for AWSIM communication with Autoware also remained unchanged. The description available here is the valid description of the reference shown in the diagram below.

+

Communication between SS2 and AWSIM takes place via Request-Response messages, and is as follows:

+
    +
  1. Launch - Autoware is started and initialized.
  2. +
  3. Initialize - the environment in AWSIM is initialized, basic parameters are set.
  4. +
  5. opt Ego spawn - optional, EgoEntity (with sensors) is spawned in the configuration defined in the scenario.
  6. +
  7. opt NPC spawn loop - optional, all Entities (NPCs) defined in the scenario are spawned, the scenario may contain any number of each Entity type, it may not contain them at all or it may also be any combination of the available ones.
  8. +
  9. update loop - this is the main loop where scenario commands are executed, first EgoEntity is updated - SS2 gets its status, and then every other Entity is updated - the status of each NPCs is set according to the scenario. Next, the simulation frame is updated - here the communication between Autoware and AWSIM takes place. The last step of the loop is to update the traffic light state.
  10. +
  11. despawn loop - after the end of the scenario, all Entities spawned on the scene are despawned (including EgoEnity)
  12. +
  13. Terminate - Autoware is terminated.
  14. +
+

Documentation of the commands used in the sequence is available here.

+

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Introduction/CombinationWithAutowareAndScenarioSimulator/ss.png b/Introduction/CombinationWithAutowareAndScenarioSimulator/ss.png new file mode 100644 index 0000000000..20f9ffd222 Binary files /dev/null and b/Introduction/CombinationWithAutowareAndScenarioSimulator/ss.png differ diff --git a/ProjectGuide/Directory/index.html b/ProjectGuide/Directory/index.html new file mode 100644 index 0000000000..c6111d84c7 --- /dev/null +++ b/ProjectGuide/Directory/index.html @@ -0,0 +1,2493 @@ + + + + + + + + + + + + + + + + + + + + + + + Directory - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Directory

+

AWSIM has the following directory structure. Mostly they are grouped by file type.

+
AWSIM       //  root directory.
+ │
+ │
+ ├─Assets                           // Unity project Assets directory.
+ │  │                               // Place external libraries
+ │  │                               // under this directory.
+ │  │                               // (e.g. RGLUnityPlugin, ROS2ForUnity, etc..)
+ │  │
+ │  │
+ │  ├─AWSIM                         // Includes assets directly related to AWSIM
+ │  |                               // (Scripts, Prefabs etc.)
+ │  │  │
+ │  │  │
+ │  │  ├─Externals                  // Place for large files or
+ │  │  |                            // external project dependencies
+ │  │  |                            // (e.g. Ninshinjuku map asset).
+ │  │  │                            // The directory is added to `.gitignore`
+ │  │  │
+ │  │  ├─HDRPDefaultResources       // Unity HDRP default assets.
+ │  │  │
+ │  │  ├─Materials                  // Materials used commonly in Project.
+ │  │  │
+ │  │  ├─Models                     // 3D models
+ │  │  │  │                         // Textures and materials for 3D models
+ │  │  │  │                         // are also included.
+ │  │  │  │
+ │  │  │  └─<3D Model>              // Directory of each 3D model.
+ │  │  │     │
+ │  │  │     │
+ │  │  │     ├─Materials            // Materials used in 3D model.
+ │  │  │     │
+ │  │  │     │
+ │  │  │     └─Textures             // Textures used in 3D model.
+ │  │  │
+ │  │  │
+ │  │  ├─Prefabs                    // Prefabs not dependent on a specific scene.
+ │  │  │
+ │  │  ├─Scenes                     // Scenes
+ │  │  │  │                         // Includes scene-specific scripts, etc.
+ │  │  │  │
+ │  │  │  │
+ │  │  │  ├─Main                    // Scenes used in the simulation.
+ │  │  │  │
+ │  │  │  │
+ │  │  │  └─Samples                 // Sample Scenes showcasing components.
+ │  │  │
+ │  │  │
+ │  │  └─Scripts                    // C# scripts.
+ │  │
+ │  │
+ │  ├─RGLUnityPlugin        // Robotec GPU LiDAR external Library.
+ │  │                       // see: https://github.com/RobotecAI/RobotecGPULidar
+ │  │
+ │  │
+ │  └─Ros2ForUnity          // ROS2 communication external Library.
+ │                          // see: https://github.com/RobotecAI/ros2-for-unity
+ │
+ ├─Packages         // Unity automatically generated directories.
+ ├─ProjectSettings  //
+ ├─UserSettings     //
+ │
+ │
+ └─docs             // AWSIM documentation. Generated using mkdocs.
+                    // see: https://www.mkdocs.org/
+
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProjectGuide/ExternalLibraries/index.html b/ProjectGuide/ExternalLibraries/index.html new file mode 100644 index 0000000000..ebccf7e791 --- /dev/null +++ b/ProjectGuide/ExternalLibraries/index.html @@ -0,0 +1,2449 @@ + + + + + + + + + + + + + + + + + + + + + + + External Libraries - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProjectGuide/GitBranch/index.html b/ProjectGuide/GitBranch/index.html new file mode 100644 index 0000000000..0541104bac --- /dev/null +++ b/ProjectGuide/GitBranch/index.html @@ -0,0 +1,2531 @@ + + + + + + + + + + + + + + + + + + + + + + + Git Branch - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Git branch

+

The document presents the rules of branching adopted in the AWSIM development process.

+

Branches

+ + + + + + + + + + + + + + + + + + + + + +
branchexplain
mainStable branch. Contains all the latest releases.
feature/***Feature implementation branch created from main.
After implementation, it is merged into main.
gh-pagesDocumentation hosted on GitHub pages.
+

Branch flow

+
    +
  1. Create feature/*** branch from main.
  2. +
  3. Implement in feature/*** branch.
  4. +
  5. Create a PR from the feature/*** branch to main branch. Merge after review.
  6. +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProjectGuide/HotkeyList/index.html b/ProjectGuide/HotkeyList/index.html new file mode 100644 index 0000000000..58c1037db2 --- /dev/null +++ b/ProjectGuide/HotkeyList/index.html @@ -0,0 +1,2583 @@ + + + + + + + + + + + + + + + + + + + + + + + Hotkey List - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Hotkey List

+

VehicleKeyboardInput.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
keyfeature
DChange drive gear.
Pparking gear.
RReverse gear.
NNeutral gear.
1Left turn signal.
2Right turn signal.
3Hazard.
4Turn signal off.
Up arrowAccelerate.
Left arrowSteering (Left).
Right arrowSteering (Right).
Down arrowBreaking.
+

FollowCamera.cs

+ + + + + + + + + + + + + + + + + + + + + +
keyfeature
CCamera rotation on/off toggle.
Mouse dragRotate Camera angle.
Mouse wheelZoom in/out of camera.
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProjectGuide/RunningHeadless/index.html b/ProjectGuide/RunningHeadless/index.html new file mode 100644 index 0000000000..df922b25d9 --- /dev/null +++ b/ProjectGuide/RunningHeadless/index.html @@ -0,0 +1,2568 @@ + + + + + + + + + + + + + + + + + + + + + + + Running headless - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Running headless

+ +

Headless

+

By default, AWSIM is a standard windowed application. This is core functionality and essential for running the simulation manually on a local PC with an attached display, but it starts to be problematic for CI and testing on the cloud instances.

+

Unity provides a few options for running binaries headless, but all of them have two things in common:

+
    +
  • they still require a window server (X11 on Linux), or
  • +
  • they disable the support for GPU devices.
  • +
+

Since AWSIM requires GPU for sensor simulation, it is required to use 3rd party utilities. The best utility for that is Xvfb.

+
+

Headless with Xvfb is only supported on Ubuntu

+
+

Xvfb

+

Xvfb, which stands for "X Virtual Framebuffer", is a display server implementing the X11 display server protocol. It enables the running of graphical applications without the need for a physical display by creating a virtual frame buffer in memory.

+

This tool is transparent for the AWSIM and the pipeline in which it is working and can be conveniently used to mimic the headless functionalities.

+

Installing

+

Xvfb is a standard Ubuntu package and can be installed with apt:

+
sudo apt update
+sudo apt install xvfb 
+
+

Running the AWSIM with Xvfb

+

To run the AWSIM binary, all that is needed to do, is to prefix the command with xvfb-run:

+
xvfb-run ./AWSIM.x86_64
+
+

Please note that xvfb-run comes with multiple options, like choosing the virtual screen size or color palette. Please see the manual for all the options.

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProjectGuide/Scenes/AutowareSimulation.png b/ProjectGuide/Scenes/AutowareSimulation.png new file mode 100644 index 0000000000..153d4f4d06 Binary files /dev/null and b/ProjectGuide/Scenes/AutowareSimulation.png differ diff --git a/ProjectGuide/Scenes/InstanceSegmentationDemo.png b/ProjectGuide/Scenes/InstanceSegmentationDemo.png new file mode 100644 index 0000000000..47465de68e Binary files /dev/null and b/ProjectGuide/Scenes/InstanceSegmentationDemo.png differ diff --git a/ProjectGuide/Scenes/LidarDisablingTest.png b/ProjectGuide/Scenes/LidarDisablingTest.png new file mode 100644 index 0000000000..da8d4fc806 Binary files /dev/null and b/ProjectGuide/Scenes/LidarDisablingTest.png differ diff --git a/ProjectGuide/Scenes/LidarSceneDevelop.png b/ProjectGuide/Scenes/LidarSceneDevelop.png new file mode 100644 index 0000000000..3ccf784912 Binary files /dev/null and b/ProjectGuide/Scenes/LidarSceneDevelop.png differ diff --git a/ProjectGuide/Scenes/LidarSkinnedStress.png b/ProjectGuide/Scenes/LidarSkinnedStress.png new file mode 100644 index 0000000000..1fbd5e8700 Binary files /dev/null and b/ProjectGuide/Scenes/LidarSkinnedStress.png differ diff --git a/ProjectGuide/Scenes/NPCPedestrianSample.png b/ProjectGuide/Scenes/NPCPedestrianSample.png new file mode 100644 index 0000000000..c0e99b56a3 Binary files /dev/null and b/ProjectGuide/Scenes/NPCPedestrianSample.png differ diff --git a/ProjectGuide/Scenes/NPCVehicleSample.png b/ProjectGuide/Scenes/NPCVehicleSample.png new file mode 100644 index 0000000000..d7a6496078 Binary files /dev/null and b/ProjectGuide/Scenes/NPCVehicleSample.png differ diff --git a/ProjectGuide/Scenes/PointCloudMapping.png b/ProjectGuide/Scenes/PointCloudMapping.png new file mode 100644 index 0000000000..3e67a3a24c Binary files /dev/null and b/ProjectGuide/Scenes/PointCloudMapping.png differ diff --git a/ProjectGuide/Scenes/RadarTestScene.png b/ProjectGuide/Scenes/RadarTestScene.png new file mode 100644 index 0000000000..89d75be91d Binary files /dev/null and b/ProjectGuide/Scenes/RadarTestScene.png differ diff --git a/ProjectGuide/Scenes/SensorConfig.png b/ProjectGuide/Scenes/SensorConfig.png new file mode 100644 index 0000000000..4a859fe9ac Binary files /dev/null and b/ProjectGuide/Scenes/SensorConfig.png differ diff --git a/ProjectGuide/Scenes/TrafficIntersectionSample.png b/ProjectGuide/Scenes/TrafficIntersectionSample.png new file mode 100644 index 0000000000..c28fd3fc3e Binary files /dev/null and b/ProjectGuide/Scenes/TrafficIntersectionSample.png differ diff --git a/ProjectGuide/Scenes/TrafficLightSample.png b/ProjectGuide/Scenes/TrafficLightSample.png new file mode 100644 index 0000000000..f0ab2686d4 Binary files /dev/null and b/ProjectGuide/Scenes/TrafficLightSample.png differ diff --git a/ProjectGuide/Scenes/disabled.png b/ProjectGuide/Scenes/disabled.png new file mode 100644 index 0000000000..acfa879a0a Binary files /dev/null and b/ProjectGuide/Scenes/disabled.png differ diff --git a/ProjectGuide/Scenes/disabling_test.mp4 b/ProjectGuide/Scenes/disabling_test.mp4 new file mode 100644 index 0000000000..4c5607af98 Binary files /dev/null and b/ProjectGuide/Scenes/disabling_test.mp4 differ diff --git a/ProjectGuide/Scenes/human_test.mp4 b/ProjectGuide/Scenes/human_test.mp4 new file mode 100644 index 0000000000..2b5c76c727 Binary files /dev/null and b/ProjectGuide/Scenes/human_test.mp4 differ diff --git a/ProjectGuide/Scenes/index.html b/ProjectGuide/Scenes/index.html new file mode 100644 index 0000000000..690ab41cc1 --- /dev/null +++ b/ProjectGuide/Scenes/index.html @@ -0,0 +1,2850 @@ + + + + + + + + + + + + + + + + + + + + + + + Scenes - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Scenes

+ +

In the AWSIM Unity project there is one main scene (AutowareSimulation) and several additional ones that can be helpful during development. +This section describes the purpose of each scene in the project.

+

main +samples

+

AutowareSimulation

+

The AutowareSimulation scene is the main scene that is designed to run the AWSIM simulation together with Autoware. +It allows for effortless operation, just run this scene, run Autoware with the correct map file and everything should work right out of the box.

+

+

PointCloudMapping

+

The PointCloudMapping is a scene that is designed to create a point cloud using the Unity world. +Using the RGLUnityPlugin and prefab Environment - on which there are models with Meshes - we are able to obtain a *.pcd file of the simulated world.

+ + +

SensorConfig

+

Scene SensorConfig was developed to perform a quick test of sensors added to the EgoVehicle prefab. +Replace the Lexus prefab with a vehicle prefab you developed and check whether all data that should be published is present, whether it is on the appropriate topics and whether the data is correct.

+ + +

NPCVehicleSample

+

The NPCVehicleSample was developed to conduct a quick test of the developed vehicle. +Replace the taxi prefab with a vehicle prefab you developed (EgoVehicle or NPCVehicle) and check whether the basic things are configured correctly. +The description of how to develop your own vehicle and add it to the project is in this section.

+ + +

NPCPedestrianSample

+

The NPCPedestrianSample was developed to conduct a quick test of the developed pedestrian. +Replace the NPC prefab in NPC Pedestrian Test script with a prefab you developed and check whether the basic things are configured correctly.

+ + +

TrafficIntersectionSample

+

The TrafficIntersectionSample was developed to conduct a quick test of the developed traffic intersection. +Replace the intersection configuration with your own and check whether it works correctly. +You can add additional groups of lights and create much larger, more complex sequences. +A description of how to configure your own traffic intersection is in this section.

+ + +

TrafficLightSample

+

The TrafficLightSample was developed to conduct a quick test of a developed traffic lights model in cooperation with the script controlling it. +Replace the lights and configuration with your own and check whether it works correctly.

+ + +

RandomTrafficYielding

+

The RandomTrafficYielding was developed to conduct a tests of a developed yielding rules at the single intersection.

+ + +

RandomTrafficYieldingBirdEye

+

The RandomTrafficYielding was developed to conduct a tests of a developed yielding rules with multiple vehicles moving around the entire environment. +yielding_rules_birdeye

+

RGL test scenes

+

The scenes described below are used for tests related to the external library RGLUnityPlugin (RGL) - you can read more about it in this section.

+

LidarSceneDevelopSample

+

The scene LidarSceneDevelopSample can be used as a complete, minimalistic example of how to setup RGL. +It contains RGLSceneManager component, four lidars, and an environment composed of floor and walls.

+ + +

LidarSkinnedStress

+

The scene LidarSkinnedStress can be used to test the performance of RGL. +E.g. how performance is affected when using Regular Meshes compared to Skinned Meshes. +The scene contains a large number of animated models that require meshes to be updated every frame, thus requiring more resources (CPU and data exchange with GPU).

+ + +

LidarDisablingTest

+

The scene LidarDisablingTest can be used to test RGL performance with similar objects but with different configurations. +It allows you to check whether RGL works correctly when various components that can be sources of Meshes are disabled (Colliders, Regular Meshes, Skinned Meshes, ...).

+

disabled

+ + +

LidarInstanceSegmentationDemo

+

The LidarInstanceSegmentationDemo is a demo scene for instance segmentation feature. It contains a set of GameObjects with ID assigned and sample lidar that publishes output to the ROS2 topic. The GameObjects are grouped to present different methods to assign IDs.

+

InstanceSegmentationDemo

+

To run demo scene:

+
    +
  1. Open scene: Assets/AWSIM/Scenes/Samples/LidarInstanceSegmentationDemo.unity
  2. +
  3. Run simulation
  4. +
  5. Open rviz2
  6. +
  7. Setup rviz2 as follows:
      +
    • Fixed frame: world,
    • +
    • PointCloud2 topic: lidar/instance_id,
    • +
    • Topic QoS as in the screen above.
    • +
    • Channel name: enitity_id,
    • +
    • To better visualization disable Autocompute intensity and set min to 0 and max to 50.
    • +
    +
  8. +
+

RadarSceneDevelopSample

+

The scene RadarSceneDevelopSample demonstrates the use of the RadarSensor component along with LiDARSensor. +LiDAR hit points are shown as small red points, and radar hit points are shown as bigger blue boxes.

+

RadarTestScene.png

+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProjectGuide/Scenes/intersection_test.mp4 b/ProjectGuide/Scenes/intersection_test.mp4 new file mode 100644 index 0000000000..48a7c3e0be Binary files /dev/null and b/ProjectGuide/Scenes/intersection_test.mp4 differ diff --git a/ProjectGuide/Scenes/light_test.mp4 b/ProjectGuide/Scenes/light_test.mp4 new file mode 100644 index 0000000000..4ef21cf005 Binary files /dev/null and b/ProjectGuide/Scenes/light_test.mp4 differ diff --git a/ProjectGuide/Scenes/main.png b/ProjectGuide/Scenes/main.png new file mode 100644 index 0000000000..95742018cf Binary files /dev/null and b/ProjectGuide/Scenes/main.png differ diff --git a/ProjectGuide/Scenes/mapping.mp4 b/ProjectGuide/Scenes/mapping.mp4 new file mode 100644 index 0000000000..837985755f Binary files /dev/null and b/ProjectGuide/Scenes/mapping.mp4 differ diff --git a/ProjectGuide/Scenes/samples.png b/ProjectGuide/Scenes/samples.png new file mode 100644 index 0000000000..0154d82b52 Binary files /dev/null and b/ProjectGuide/Scenes/samples.png differ diff --git a/ProjectGuide/Scenes/scene_develop.mp4 b/ProjectGuide/Scenes/scene_develop.mp4 new file mode 100644 index 0000000000..f69eeca8e1 Binary files /dev/null and b/ProjectGuide/Scenes/scene_develop.mp4 differ diff --git a/ProjectGuide/Scenes/sensor_config_test.mp4 b/ProjectGuide/Scenes/sensor_config_test.mp4 new file mode 100644 index 0000000000..f98aff06c1 Binary files /dev/null and b/ProjectGuide/Scenes/sensor_config_test.mp4 differ diff --git a/ProjectGuide/Scenes/skinned_stress.mp4 b/ProjectGuide/Scenes/skinned_stress.mp4 new file mode 100644 index 0000000000..ecac779f39 Binary files /dev/null and b/ProjectGuide/Scenes/skinned_stress.mp4 differ diff --git a/ProjectGuide/Scenes/vehicle_test.mp4 b/ProjectGuide/Scenes/vehicle_test.mp4 new file mode 100644 index 0000000000..1b08e82d87 Binary files /dev/null and b/ProjectGuide/Scenes/vehicle_test.mp4 differ diff --git a/ProjectGuide/Scenes/yielding_rules.mp4 b/ProjectGuide/Scenes/yielding_rules.mp4 new file mode 100644 index 0000000000..c2f43a743b Binary files /dev/null and b/ProjectGuide/Scenes/yielding_rules.mp4 differ diff --git a/ProjectGuide/Scenes/yielding_rules_birdeye.png b/ProjectGuide/Scenes/yielding_rules_birdeye.png new file mode 100644 index 0000000000..ebfb9a4654 Binary files /dev/null and b/ProjectGuide/Scenes/yielding_rules_birdeye.png differ diff --git a/ProjectGuide/Testing/all_tests.png b/ProjectGuide/Testing/all_tests.png new file mode 100644 index 0000000000..4dcf5fe47f Binary files /dev/null and b/ProjectGuide/Testing/all_tests.png differ diff --git a/ProjectGuide/Testing/arch_testing.png b/ProjectGuide/Testing/arch_testing.png new file mode 100644 index 0000000000..2a6f7f5df7 Binary files /dev/null and b/ProjectGuide/Testing/arch_testing.png differ diff --git a/ProjectGuide/Testing/index.html b/ProjectGuide/Testing/index.html new file mode 100644 index 0000000000..c6d59bf087 --- /dev/null +++ b/ProjectGuide/Testing/index.html @@ -0,0 +1,2693 @@ + + + + + + + + + + + + + + + + + + + + + + + Testing - AWSIM document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Testing

+ +

Unity Test Framework

+

The AWSIM simulator utilizes the Unity Test Framework (UTS) for comprehensive testing procedures.

+

The Unity Test Framework is a testing framework provided by Unity Technologies for testing Unity applications and games. It is primarily used for automated testing of code written in C# within Unity projects. The framework allows developers to write test scripts to verify the behavior of their code, including unit tests for individual components and integration tests for multiple components working together.

+

It provides various assertion methods to check expected outcomes and supports organizing tests into test suites for better management. The UTS is integrated directly into the Unity Editor, making it convenient for developers to run tests and analyze results within their development environment.

+

UTS uses an integration of NUnit library and looks for tests inside any assembly that references NUnit (detailed info can be found here). AWSIM assembly is explicitely defined inside the project, so it can be referencered correctly by the test module.

+

Architecture

+

Edit Mode Tests and Play Mode Tests comparison

+

The framework enables testing code in both Edit Mode and Play Mode.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Play ModeEdit Mode
EnvironmentRun within the Unity Editor and require entering the play mode.Run within the Unity Editor, without entering the play mode.
SpeedCan be more complex and take more time to set up and execute due to the need for scene loading and game simulation.They tend to be faster to execute compared to play mode tests since they don't require scene loading or game simulation.
Use CasesThey allow testing components that rely on Unity's runtime environment, such as physics, animations, or MonoBehaviour lifecycle methods. Play mode tests also provide a more realistic testing environment by simulating gameplay and interactions between game objects.Are suitable for testing editor scripts, pure C# logic, or components that don't rely heavily on Unity's runtime environment.
+

In summary, Edit Mode tests are well-suited for testing isolated code components and editor-related functionality, while Play Mode tests are more appropriate for integration testing within the runtime environment of a Unity application or game.

+

Tips for writing good tests

+
    +
  • Prioritize EditMode testing over PlayMode.
  • +
  • Create one test class per class as much as possible.
  • +
  • Write tests from a high-risk point of view.
  • +
  • Add the suffix Test to the test class. (ex. ImuSensorTest)
  • +
+

Running tests

+
    +
  1. +

    To access the Unity Test Framework in the Unity Editor, open the Test Runner window; go to Window > General > Test Runner.

    +

    Test runner

    +
  2. +
  3. +

    In the Test Runner window, you'll see two tabs: Play Mode and Edit Mode. Choose the appropriate mode depending on the type of tests you want to run:

    +
      +
    • Play Mode for AWSIM integration tests that require the Unity runtime environment.
    • +
    • Edit Mode for AWSIM unit tests that don't require entering play mode.
    • +
    +
  4. +
  5. +

    After selecting the desired test mode, click the Run All button to execute all AWSIM tests.

    +
      +
    • Alternatively, you can run individual test groups or specific tests by selecting them and clicking the Run Selected button.
    • +
    +
  6. +
  7. +

    As the tests run, the Test Runner window will display the progress and results. Green checkmarks indicate passed tests, while red crosses indicate failed tests.

    +
    +

    Info

    +

    In Play Mode, Unity will load test scenes during the process.

    +
    +

    Test runner

    +
  8. +
  9. +

    All tests should pass.

    +
    +

    Info

    +

    You can click on individual tests to view more details, including any log messages or assertions that failed.

    +
    +

    Test runner

    +
  10. +
+

Play mode tests

+

Vehicle ROS2 Input Test:

+
    +
  • GearChanging: Using the ROS 2 interface - changing gear from PARK to DRIVE and moving forward, then changing gear from DRIVE to PARK and REVERSE and moving backward. Checking the expected vehicle positions.
  • +
  • TurningLeft: Using the ROS 2 interface - moving the Ego vehicle and turning left. Check if the goal position is valid.
  • +
  • TurningRight: Using the ROS 2 interface - moving the Ego vehicle and turning right. Check if the goal position is valid.
  • +
+

Sensors Test:

+
    +
  • GNSS: Using the ROS 2 interface - verified the number of generated messages based on the sensor frequency.
  • +
  • IMU: Using the ROS 2 interface - verified the number of generated messages based on the sensor frequency.
  • +
  • LiDAR: Using the ROS 2 interface - verified the number of generated messages based on the sensor frequency.
  • +
  • Radar: Using the ROS 2 interface - verified the number of generated messages based on the sensor frequency.
  • +
+

Traffic Test:

+
    +
  • Despawn: Assuring that the NPCs despawn correctly when reaching the end of the lanelet.
  • +
  • RandomTrafficSpawn: Checking the correctness of spawning multiple NPCs on multiple lanes.
  • +
  • SeedSpawn: Determinism of spawning different NPC prefabs based on different seed value.
  • +
+

Edit mode tests

+

Ego:

+
    +
  • GearsInput: Gear shift translations between ROS 2 and Unity interface.
  • +
  • TurnSignalInput: Turn signal translations between ROS 2 and Unity interface.
  • +
+

Sensors:

+
    +
  • GNSS: GNSS data checks for various MGRS offsets and sensor positions.
  • +
  • IMU: IMU data check for gravity parameter set to true or false.
  • +
+

Traffic:

+
    +
  • TrafficPrimitives: Stop line center point, traffic lane positions and traffic lane with stop line interface.
  • +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProjectGuide/Testing/running_tests.png b/ProjectGuide/Testing/running_tests.png new file mode 100644 index 0000000000..22e089b5fa Binary files /dev/null and b/ProjectGuide/Testing/running_tests.png differ diff --git a/ProjectGuide/Testing/test_runner.png b/ProjectGuide/Testing/test_runner.png new file mode 100644 index 0000000000..17e69ab704 Binary files /dev/null and b/ProjectGuide/Testing/test_runner.png differ diff --git a/assets/images/favicon.png b/assets/images/favicon.png new file mode 100644 index 0000000000..1cf13b9f9d Binary files /dev/null and b/assets/images/favicon.png differ diff --git a/assets/javascripts/bundle.fe8b6f2b.min.js b/assets/javascripts/bundle.fe8b6f2b.min.js new file mode 100644 index 0000000000..cf778d4288 --- /dev/null +++ b/assets/javascripts/bundle.fe8b6f2b.min.js @@ -0,0 +1,29 @@ +"use strict";(()=>{var Fi=Object.create;var gr=Object.defineProperty;var ji=Object.getOwnPropertyDescriptor;var Wi=Object.getOwnPropertyNames,Dt=Object.getOwnPropertySymbols,Ui=Object.getPrototypeOf,xr=Object.prototype.hasOwnProperty,no=Object.prototype.propertyIsEnumerable;var oo=(e,t,r)=>t in e?gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,R=(e,t)=>{for(var r in t||(t={}))xr.call(t,r)&&oo(e,r,t[r]);if(Dt)for(var r of Dt(t))no.call(t,r)&&oo(e,r,t[r]);return e};var io=(e,t)=>{var r={};for(var o in e)xr.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Dt)for(var o of Dt(e))t.indexOf(o)<0&&no.call(e,o)&&(r[o]=e[o]);return r};var yr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Di=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Wi(t))!xr.call(e,n)&&n!==r&&gr(e,n,{get:()=>t[n],enumerable:!(o=ji(t,n))||o.enumerable});return e};var Vt=(e,t,r)=>(r=e!=null?Fi(Ui(e)):{},Di(t||!e||!e.__esModule?gr(r,"default",{value:e,enumerable:!0}):r,e));var ao=(e,t,r)=>new Promise((o,n)=>{var i=p=>{try{s(r.next(p))}catch(c){n(c)}},a=p=>{try{s(r.throw(p))}catch(c){n(c)}},s=p=>p.done?o(p.value):Promise.resolve(p.value).then(i,a);s((r=r.apply(e,t)).next())});var co=yr((Er,so)=>{(function(e,t){typeof Er=="object"&&typeof so!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(Er,function(){"use strict";function e(r){var o=!0,n=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(H){return!!(H&&H!==document&&H.nodeName!=="HTML"&&H.nodeName!=="BODY"&&"classList"in H&&"contains"in H.classList)}function p(H){var mt=H.type,ze=H.tagName;return!!(ze==="INPUT"&&a[mt]&&!H.readOnly||ze==="TEXTAREA"&&!H.readOnly||H.isContentEditable)}function c(H){H.classList.contains("focus-visible")||(H.classList.add("focus-visible"),H.setAttribute("data-focus-visible-added",""))}function l(H){H.hasAttribute("data-focus-visible-added")&&(H.classList.remove("focus-visible"),H.removeAttribute("data-focus-visible-added"))}function f(H){H.metaKey||H.altKey||H.ctrlKey||(s(r.activeElement)&&c(r.activeElement),o=!0)}function u(H){o=!1}function h(H){s(H.target)&&(o||p(H.target))&&c(H.target)}function w(H){s(H.target)&&(H.target.classList.contains("focus-visible")||H.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(i),i=window.setTimeout(function(){n=!1},100),l(H.target))}function A(H){document.visibilityState==="hidden"&&(n&&(o=!0),te())}function te(){document.addEventListener("mousemove",J),document.addEventListener("mousedown",J),document.addEventListener("mouseup",J),document.addEventListener("pointermove",J),document.addEventListener("pointerdown",J),document.addEventListener("pointerup",J),document.addEventListener("touchmove",J),document.addEventListener("touchstart",J),document.addEventListener("touchend",J)}function ie(){document.removeEventListener("mousemove",J),document.removeEventListener("mousedown",J),document.removeEventListener("mouseup",J),document.removeEventListener("pointermove",J),document.removeEventListener("pointerdown",J),document.removeEventListener("pointerup",J),document.removeEventListener("touchmove",J),document.removeEventListener("touchstart",J),document.removeEventListener("touchend",J)}function J(H){H.target.nodeName&&H.target.nodeName.toLowerCase()==="html"||(o=!1,ie())}document.addEventListener("keydown",f,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",A,!0),te(),r.addEventListener("focus",h,!0),r.addEventListener("blur",w,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var Yr=yr((Rt,Kr)=>{/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */(function(t,r){typeof Rt=="object"&&typeof Kr=="object"?Kr.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Rt=="object"?Rt.ClipboardJS=r():t.ClipboardJS=r()})(Rt,function(){return function(){var e={686:function(o,n,i){"use strict";i.d(n,{default:function(){return Ii}});var a=i(279),s=i.n(a),p=i(370),c=i.n(p),l=i(817),f=i.n(l);function u(V){try{return document.execCommand(V)}catch(_){return!1}}var h=function(_){var M=f()(_);return u("cut"),M},w=h;function A(V){var _=document.documentElement.getAttribute("dir")==="rtl",M=document.createElement("textarea");M.style.fontSize="12pt",M.style.border="0",M.style.padding="0",M.style.margin="0",M.style.position="absolute",M.style[_?"right":"left"]="-9999px";var j=window.pageYOffset||document.documentElement.scrollTop;return M.style.top="".concat(j,"px"),M.setAttribute("readonly",""),M.value=V,M}var te=function(_,M){var j=A(_);M.container.appendChild(j);var D=f()(j);return u("copy"),j.remove(),D},ie=function(_){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},j="";return typeof _=="string"?j=te(_,M):_ instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(_==null?void 0:_.type)?j=te(_.value,M):(j=f()(_),u("copy")),j},J=ie;function H(V){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?H=function(M){return typeof M}:H=function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},H(V)}var mt=function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=_.action,j=M===void 0?"copy":M,D=_.container,Y=_.target,ke=_.text;if(j!=="copy"&&j!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(Y!==void 0)if(Y&&H(Y)==="object"&&Y.nodeType===1){if(j==="copy"&&Y.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(j==="cut"&&(Y.hasAttribute("readonly")||Y.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(ke)return J(ke,{container:D});if(Y)return j==="cut"?w(Y):J(Y,{container:D})},ze=mt;function Ie(V){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ie=function(M){return typeof M}:Ie=function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},Ie(V)}function _i(V,_){if(!(V instanceof _))throw new TypeError("Cannot call a class as a function")}function ro(V,_){for(var M=0;M<_.length;M++){var j=_[M];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(V,j.key,j)}}function Ai(V,_,M){return _&&ro(V.prototype,_),M&&ro(V,M),V}function Ci(V,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");V.prototype=Object.create(_&&_.prototype,{constructor:{value:V,writable:!0,configurable:!0}}),_&&br(V,_)}function br(V,_){return br=Object.setPrototypeOf||function(j,D){return j.__proto__=D,j},br(V,_)}function Hi(V){var _=Pi();return function(){var j=Wt(V),D;if(_){var Y=Wt(this).constructor;D=Reflect.construct(j,arguments,Y)}else D=j.apply(this,arguments);return ki(this,D)}}function ki(V,_){return _&&(Ie(_)==="object"||typeof _=="function")?_:$i(V)}function $i(V){if(V===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V}function Pi(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(V){return!1}}function Wt(V){return Wt=Object.setPrototypeOf?Object.getPrototypeOf:function(M){return M.__proto__||Object.getPrototypeOf(M)},Wt(V)}function vr(V,_){var M="data-clipboard-".concat(V);if(_.hasAttribute(M))return _.getAttribute(M)}var Ri=function(V){Ci(M,V);var _=Hi(M);function M(j,D){var Y;return _i(this,M),Y=_.call(this),Y.resolveOptions(D),Y.listenClick(j),Y}return Ai(M,[{key:"resolveOptions",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof D.action=="function"?D.action:this.defaultAction,this.target=typeof D.target=="function"?D.target:this.defaultTarget,this.text=typeof D.text=="function"?D.text:this.defaultText,this.container=Ie(D.container)==="object"?D.container:document.body}},{key:"listenClick",value:function(D){var Y=this;this.listener=c()(D,"click",function(ke){return Y.onClick(ke)})}},{key:"onClick",value:function(D){var Y=D.delegateTarget||D.currentTarget,ke=this.action(Y)||"copy",Ut=ze({action:ke,container:this.container,target:this.target(Y),text:this.text(Y)});this.emit(Ut?"success":"error",{action:ke,text:Ut,trigger:Y,clearSelection:function(){Y&&Y.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(D){return vr("action",D)}},{key:"defaultTarget",value:function(D){var Y=vr("target",D);if(Y)return document.querySelector(Y)}},{key:"defaultText",value:function(D){return vr("text",D)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(D){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return J(D,Y)}},{key:"cut",value:function(D){return w(D)}},{key:"isSupported",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],Y=typeof D=="string"?[D]:D,ke=!!document.queryCommandSupported;return Y.forEach(function(Ut){ke=ke&&!!document.queryCommandSupported(Ut)}),ke}}]),M}(s()),Ii=Ri},828:function(o){var n=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,p){for(;s&&s.nodeType!==n;){if(typeof s.matches=="function"&&s.matches(p))return s;s=s.parentNode}}o.exports=a},438:function(o,n,i){var a=i(828);function s(l,f,u,h,w){var A=c.apply(this,arguments);return l.addEventListener(u,A,w),{destroy:function(){l.removeEventListener(u,A,w)}}}function p(l,f,u,h,w){return typeof l.addEventListener=="function"?s.apply(null,arguments):typeof u=="function"?s.bind(null,document).apply(null,arguments):(typeof l=="string"&&(l=document.querySelectorAll(l)),Array.prototype.map.call(l,function(A){return s(A,f,u,h,w)}))}function c(l,f,u,h){return function(w){w.delegateTarget=a(w.target,f),w.delegateTarget&&h.call(l,w)}}o.exports=p},879:function(o,n){n.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},n.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||n.node(i[0]))},n.string=function(i){return typeof i=="string"||i instanceof String},n.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}},370:function(o,n,i){var a=i(879),s=i(438);function p(u,h,w){if(!u&&!h&&!w)throw new Error("Missing required arguments");if(!a.string(h))throw new TypeError("Second argument must be a String");if(!a.fn(w))throw new TypeError("Third argument must be a Function");if(a.node(u))return c(u,h,w);if(a.nodeList(u))return l(u,h,w);if(a.string(u))return f(u,h,w);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function c(u,h,w){return u.addEventListener(h,w),{destroy:function(){u.removeEventListener(h,w)}}}function l(u,h,w){return Array.prototype.forEach.call(u,function(A){A.addEventListener(h,w)}),{destroy:function(){Array.prototype.forEach.call(u,function(A){A.removeEventListener(h,w)})}}}function f(u,h,w){return s(document.body,u,h,w)}o.exports=p},817:function(o){function n(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var p=window.getSelection(),c=document.createRange();c.selectNodeContents(i),p.removeAllRanges(),p.addRange(c),a=p.toString()}return a}o.exports=n},279:function(o){function n(){}n.prototype={on:function(i,a,s){var p=this.e||(this.e={});return(p[i]||(p[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var p=this;function c(){p.off(i,c),a.apply(s,arguments)}return c._=a,this.on(i,c,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),p=0,c=s.length;for(p;p{"use strict";/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var ts=/["'&<>]/;ei.exports=rs;function rs(e){var t=""+e,r=ts.exec(t);if(!r)return t;var o,n="",i=0,a=0;for(i=r.index;i0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function N(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),n,i=[],a;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(s){a={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i}function q(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,i;o1||s(u,h)})})}function s(u,h){try{p(o[u](h))}catch(w){f(i[0][3],w)}}function p(u){u.value instanceof nt?Promise.resolve(u.value.v).then(c,l):f(i[0][2],u)}function c(u){s("next",u)}function l(u){s("throw",u)}function f(u,h){u(h),i.shift(),i.length&&s(i[0][0],i[0][1])}}function mo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof de=="function"?de(e):e[Symbol.iterator](),r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r);function o(i){r[i]=e[i]&&function(a){return new Promise(function(s,p){a=e[i](a),n(s,p,a.done,a.value)})}}function n(i,a,s,p){Promise.resolve(p).then(function(c){i({value:c,done:s})},a)}}function k(e){return typeof e=="function"}function ft(e){var t=function(o){Error.call(o),o.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var zt=ft(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: +`+r.map(function(o,n){return n+1+") "+o.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=r}});function qe(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Fe=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,o,n,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=de(a),p=s.next();!p.done;p=s.next()){var c=p.value;c.remove(this)}}catch(A){t={error:A}}finally{try{p&&!p.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var l=this.initialTeardown;if(k(l))try{l()}catch(A){i=A instanceof zt?A.errors:[A]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var u=de(f),h=u.next();!h.done;h=u.next()){var w=h.value;try{fo(w)}catch(A){i=i!=null?i:[],A instanceof zt?i=q(q([],N(i)),N(A.errors)):i.push(A)}}}catch(A){o={error:A}}finally{try{h&&!h.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}}if(i)throw new zt(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)fo(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&qe(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&qe(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Tr=Fe.EMPTY;function qt(e){return e instanceof Fe||e&&"closed"in e&&k(e.remove)&&k(e.add)&&k(e.unsubscribe)}function fo(e){k(e)?e():e.unsubscribe()}var $e={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var ut={setTimeout:function(e,t){for(var r=[],o=2;o0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var o=this,n=this,i=n.hasError,a=n.isStopped,s=n.observers;return i||a?Tr:(this.currentObservers=null,s.push(r),new Fe(function(){o.currentObservers=null,qe(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var o=this,n=o.hasError,i=o.thrownError,a=o.isStopped;n?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new F;return r.source=this,r},t.create=function(r,o){return new Eo(r,o)},t}(F);var Eo=function(e){re(t,e);function t(r,o){var n=e.call(this)||this;return n.destination=r,n.source=o,n}return t.prototype.next=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.next)===null||n===void 0||n.call(o,r)},t.prototype.error=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.error)===null||n===void 0||n.call(o,r)},t.prototype.complete=function(){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||o===void 0||o.call(r)},t.prototype._subscribe=function(r){var o,n;return(n=(o=this.source)===null||o===void 0?void 0:o.subscribe(r))!==null&&n!==void 0?n:Tr},t}(g);var _r=function(e){re(t,e);function t(r){var o=e.call(this)||this;return o._value=r,o}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var o=e.prototype._subscribe.call(this,r);return!o.closed&&r.next(this._value),o},t.prototype.getValue=function(){var r=this,o=r.hasError,n=r.thrownError,i=r._value;if(o)throw n;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t}(g);var Lt={now:function(){return(Lt.delegate||Date).now()},delegate:void 0};var _t=function(e){re(t,e);function t(r,o,n){r===void 0&&(r=1/0),o===void 0&&(o=1/0),n===void 0&&(n=Lt);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=o,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=o===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,o),i}return t.prototype.next=function(r){var o=this,n=o.isStopped,i=o._buffer,a=o._infiniteTimeWindow,s=o._timestampProvider,p=o._windowTime;n||(i.push(r),!a&&i.push(s.now()+p)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var o=this._innerSubscribe(r),n=this,i=n._infiniteTimeWindow,a=n._buffer,s=a.slice(),p=0;p0?e.prototype.schedule.call(this,r,o):(this.delay=o,this.state=r,this.scheduler.flush(this),this)},t.prototype.execute=function(r,o){return o>0||this.closed?e.prototype.execute.call(this,r,o):this._execute(r,o)},t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!=null&&n>0||n==null&&this.delay>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.flush(this),0)},t}(vt);var So=function(e){re(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(gt);var Hr=new So(To);var Oo=function(e){re(t,e);function t(r,o){var n=e.call(this,r,o)||this;return n.scheduler=r,n.work=o,n}return t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!==null&&n>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.actions.push(this),r._scheduled||(r._scheduled=bt.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,o,n){var i;if(n===void 0&&(n=0),n!=null?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,o,n);var a=r.actions;o!=null&&((i=a[a.length-1])===null||i===void 0?void 0:i.id)!==o&&(bt.cancelAnimationFrame(o),r._scheduled=void 0)},t}(vt);var Mo=function(e){re(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var o=this._scheduled;this._scheduled=void 0;var n=this.actions,i;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while((r=n[0])&&r.id===o&&n.shift());if(this._active=!1,i){for(;(r=n[0])&&r.id===o&&n.shift();)r.unsubscribe();throw i}},t}(gt);var me=new Mo(Oo);var O=new F(function(e){return e.complete()});function Yt(e){return e&&k(e.schedule)}function kr(e){return e[e.length-1]}function Xe(e){return k(kr(e))?e.pop():void 0}function He(e){return Yt(kr(e))?e.pop():void 0}function Bt(e,t){return typeof kr(e)=="number"?e.pop():t}var xt=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function Gt(e){return k(e==null?void 0:e.then)}function Jt(e){return k(e[ht])}function Xt(e){return Symbol.asyncIterator&&k(e==null?void 0:e[Symbol.asyncIterator])}function Zt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Gi(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var er=Gi();function tr(e){return k(e==null?void 0:e[er])}function rr(e){return lo(this,arguments,function(){var r,o,n,i;return Nt(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,nt(r.read())];case 3:return o=a.sent(),n=o.value,i=o.done,i?[4,nt(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,nt(n)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function or(e){return k(e==null?void 0:e.getReader)}function W(e){if(e instanceof F)return e;if(e!=null){if(Jt(e))return Ji(e);if(xt(e))return Xi(e);if(Gt(e))return Zi(e);if(Xt(e))return Lo(e);if(tr(e))return ea(e);if(or(e))return ta(e)}throw Zt(e)}function Ji(e){return new F(function(t){var r=e[ht]();if(k(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Xi(e){return new F(function(t){for(var r=0;r=2;return function(o){return o.pipe(e?b(function(n,i){return e(n,i,o)}):le,Te(1),r?Be(t):zo(function(){return new ir}))}}function Fr(e){return e<=0?function(){return O}:y(function(t,r){var o=[];t.subscribe(T(r,function(n){o.push(n),e=2,!0))}function pe(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new g}:t,o=e.resetOnError,n=o===void 0?!0:o,i=e.resetOnComplete,a=i===void 0?!0:i,s=e.resetOnRefCountZero,p=s===void 0?!0:s;return function(c){var l,f,u,h=0,w=!1,A=!1,te=function(){f==null||f.unsubscribe(),f=void 0},ie=function(){te(),l=u=void 0,w=A=!1},J=function(){var H=l;ie(),H==null||H.unsubscribe()};return y(function(H,mt){h++,!A&&!w&&te();var ze=u=u!=null?u:r();mt.add(function(){h--,h===0&&!A&&!w&&(f=Wr(J,p))}),ze.subscribe(mt),!l&&h>0&&(l=new at({next:function(Ie){return ze.next(Ie)},error:function(Ie){A=!0,te(),f=Wr(ie,n,Ie),ze.error(Ie)},complete:function(){w=!0,te(),f=Wr(ie,a),ze.complete()}}),W(H).subscribe(l))})(c)}}function Wr(e,t){for(var r=[],o=2;oe.next(document)),e}function $(e,t=document){return Array.from(t.querySelectorAll(e))}function P(e,t=document){let r=fe(e,t);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function fe(e,t=document){return t.querySelector(e)||void 0}function Re(){var e,t,r,o;return(o=(r=(t=(e=document.activeElement)==null?void 0:e.shadowRoot)==null?void 0:t.activeElement)!=null?r:document.activeElement)!=null?o:void 0}var xa=S(d(document.body,"focusin"),d(document.body,"focusout")).pipe(_e(1),Q(void 0),m(()=>Re()||document.body),G(1));function et(e){return xa.pipe(m(t=>e.contains(t)),K())}function kt(e,t){return C(()=>S(d(e,"mouseenter").pipe(m(()=>!0)),d(e,"mouseleave").pipe(m(()=>!1))).pipe(t?Ht(r=>Me(+!r*t)):le,Q(e.matches(":hover"))))}function Bo(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)Bo(e,r)}function x(e,t,...r){let o=document.createElement(e);if(t)for(let n of Object.keys(t))typeof t[n]!="undefined"&&(typeof t[n]!="boolean"?o.setAttribute(n,t[n]):o.setAttribute(n,""));for(let n of r)Bo(o,n);return o}function sr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function wt(e){let t=x("script",{src:e});return C(()=>(document.head.appendChild(t),S(d(t,"load"),d(t,"error").pipe(v(()=>$r(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(m(()=>{}),L(()=>document.head.removeChild(t)),Te(1))))}var Go=new g,ya=C(()=>typeof ResizeObserver=="undefined"?wt("https://unpkg.com/resize-observer-polyfill"):I(void 0)).pipe(m(()=>new ResizeObserver(e=>e.forEach(t=>Go.next(t)))),v(e=>S(Ke,I(e)).pipe(L(()=>e.disconnect()))),G(1));function ce(e){return{width:e.offsetWidth,height:e.offsetHeight}}function ge(e){let t=e;for(;t.clientWidth===0&&t.parentElement;)t=t.parentElement;return ya.pipe(E(r=>r.observe(t)),v(r=>Go.pipe(b(o=>o.target===t),L(()=>r.unobserve(t)))),m(()=>ce(e)),Q(ce(e)))}function Tt(e){return{width:e.scrollWidth,height:e.scrollHeight}}function cr(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}function Jo(e){let t=[],r=e.parentElement;for(;r;)(e.clientWidth>r.clientWidth||e.clientHeight>r.clientHeight)&&t.push(r),r=(e=r).parentElement;return t.length===0&&t.push(document.documentElement),t}function Ue(e){return{x:e.offsetLeft,y:e.offsetTop}}function Xo(e){let t=e.getBoundingClientRect();return{x:t.x+window.scrollX,y:t.y+window.scrollY}}function Zo(e){return S(d(window,"load"),d(window,"resize")).pipe(Le(0,me),m(()=>Ue(e)),Q(Ue(e)))}function pr(e){return{x:e.scrollLeft,y:e.scrollTop}}function De(e){return S(d(e,"scroll"),d(window,"scroll"),d(window,"resize")).pipe(Le(0,me),m(()=>pr(e)),Q(pr(e)))}var en=new g,Ea=C(()=>I(new IntersectionObserver(e=>{for(let t of e)en.next(t)},{threshold:0}))).pipe(v(e=>S(Ke,I(e)).pipe(L(()=>e.disconnect()))),G(1));function tt(e){return Ea.pipe(E(t=>t.observe(e)),v(t=>en.pipe(b(({target:r})=>r===e),L(()=>t.unobserve(e)),m(({isIntersecting:r})=>r))))}function tn(e,t=16){return De(e).pipe(m(({y:r})=>{let o=ce(e),n=Tt(e);return r>=n.height-o.height-t}),K())}var lr={drawer:P("[data-md-toggle=drawer]"),search:P("[data-md-toggle=search]")};function rn(e){return lr[e].checked}function Je(e,t){lr[e].checked!==t&&lr[e].click()}function Ve(e){let t=lr[e];return d(t,"change").pipe(m(()=>t.checked),Q(t.checked))}function wa(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function Ta(){return S(d(window,"compositionstart").pipe(m(()=>!0)),d(window,"compositionend").pipe(m(()=>!1))).pipe(Q(!1))}function on(){let e=d(window,"keydown").pipe(b(t=>!(t.metaKey||t.ctrlKey)),m(t=>({mode:rn("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),b(({mode:t,type:r})=>{if(t==="global"){let o=Re();if(typeof o!="undefined")return!wa(o,r)}return!0}),pe());return Ta().pipe(v(t=>t?O:e))}function xe(){return new URL(location.href)}function pt(e,t=!1){if(B("navigation.instant")&&!t){let r=x("a",{href:e.href});document.body.appendChild(r),r.click(),r.remove()}else location.href=e.href}function nn(){return new g}function an(){return location.hash.slice(1)}function sn(e){let t=x("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function Sa(e){return S(d(window,"hashchange"),e).pipe(m(an),Q(an()),b(t=>t.length>0),G(1))}function cn(e){return Sa(e).pipe(m(t=>fe(`[id="${t}"]`)),b(t=>typeof t!="undefined"))}function $t(e){let t=matchMedia(e);return ar(r=>t.addListener(()=>r(t.matches))).pipe(Q(t.matches))}function pn(){let e=matchMedia("print");return S(d(window,"beforeprint").pipe(m(()=>!0)),d(window,"afterprint").pipe(m(()=>!1))).pipe(Q(e.matches))}function Nr(e,t){return e.pipe(v(r=>r?t():O))}function zr(e,t){return new F(r=>{let o=new XMLHttpRequest;return o.open("GET",`${e}`),o.responseType="blob",o.addEventListener("load",()=>{o.status>=200&&o.status<300?(r.next(o.response),r.complete()):r.error(new Error(o.statusText))}),o.addEventListener("error",()=>{r.error(new Error("Network error"))}),o.addEventListener("abort",()=>{r.complete()}),typeof(t==null?void 0:t.progress$)!="undefined"&&(o.addEventListener("progress",n=>{var i;if(n.lengthComputable)t.progress$.next(n.loaded/n.total*100);else{let a=(i=o.getResponseHeader("Content-Length"))!=null?i:0;t.progress$.next(n.loaded/+a*100)}}),t.progress$.next(5)),o.send(),()=>o.abort()})}function Ne(e,t){return zr(e,t).pipe(v(r=>r.text()),m(r=>JSON.parse(r)),G(1))}function ln(e,t){let r=new DOMParser;return zr(e,t).pipe(v(o=>o.text()),m(o=>r.parseFromString(o,"text/html")),G(1))}function mn(e,t){let r=new DOMParser;return zr(e,t).pipe(v(o=>o.text()),m(o=>r.parseFromString(o,"text/xml")),G(1))}function fn(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function un(){return S(d(window,"scroll",{passive:!0}),d(window,"resize",{passive:!0})).pipe(m(fn),Q(fn()))}function dn(){return{width:innerWidth,height:innerHeight}}function hn(){return d(window,"resize",{passive:!0}).pipe(m(dn),Q(dn()))}function bn(){return z([un(),hn()]).pipe(m(([e,t])=>({offset:e,size:t})),G(1))}function mr(e,{viewport$:t,header$:r}){let o=t.pipe(Z("size")),n=z([o,r]).pipe(m(()=>Ue(e)));return z([r,t,n]).pipe(m(([{height:i},{offset:a,size:s},{x:p,y:c}])=>({offset:{x:a.x-p,y:a.y-c+i},size:s})))}function Oa(e){return d(e,"message",t=>t.data)}function Ma(e){let t=new g;return t.subscribe(r=>e.postMessage(r)),t}function vn(e,t=new Worker(e)){let r=Oa(t),o=Ma(t),n=new g;n.subscribe(o);let i=o.pipe(X(),ne(!0));return n.pipe(X(),Pe(r.pipe(U(i))),pe())}var La=P("#__config"),St=JSON.parse(La.textContent);St.base=`${new URL(St.base,xe())}`;function ye(){return St}function B(e){return St.features.includes(e)}function Ee(e,t){return typeof t!="undefined"?St.translations[e].replace("#",t.toString()):St.translations[e]}function Se(e,t=document){return P(`[data-md-component=${e}]`,t)}function ae(e,t=document){return $(`[data-md-component=${e}]`,t)}function _a(e){let t=P(".md-typeset > :first-child",e);return d(t,"click",{once:!0}).pipe(m(()=>P(".md-typeset",e)),m(r=>({hash:__md_hash(r.innerHTML)})))}function gn(e){if(!B("announce.dismiss")||!e.childElementCount)return O;if(!e.hidden){let t=P(".md-typeset",e);__md_hash(t.innerHTML)===__md_get("__announce")&&(e.hidden=!0)}return C(()=>{let t=new g;return t.subscribe(({hash:r})=>{e.hidden=!0,__md_set("__announce",r)}),_a(e).pipe(E(r=>t.next(r)),L(()=>t.complete()),m(r=>R({ref:e},r)))})}function Aa(e,{target$:t}){return t.pipe(m(r=>({hidden:r!==e})))}function xn(e,t){let r=new g;return r.subscribe(({hidden:o})=>{e.hidden=o}),Aa(e,t).pipe(E(o=>r.next(o)),L(()=>r.complete()),m(o=>R({ref:e},o)))}function Pt(e,t){return t==="inline"?x("div",{class:"md-tooltip md-tooltip--inline",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"})):x("div",{class:"md-tooltip",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"}))}function yn(...e){return x("div",{class:"md-tooltip2",role:"tooltip"},x("div",{class:"md-tooltip2__inner md-typeset"},e))}function En(e,t){if(t=t?`${t}_annotation_${e}`:void 0,t){let r=t?`#${t}`:void 0;return x("aside",{class:"md-annotation",tabIndex:0},Pt(t),x("a",{href:r,class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}else return x("aside",{class:"md-annotation",tabIndex:0},Pt(t),x("span",{class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}function wn(e){return x("button",{class:"md-clipboard md-icon",title:Ee("clipboard.copy"),"data-clipboard-target":`#${e} > code`})}function qr(e,t){let r=t&2,o=t&1,n=Object.keys(e.terms).filter(p=>!e.terms[p]).reduce((p,c)=>[...p,x("del",null,c)," "],[]).slice(0,-1),i=ye(),a=new URL(e.location,i.base);B("search.highlight")&&a.searchParams.set("h",Object.entries(e.terms).filter(([,p])=>p).reduce((p,[c])=>`${p} ${c}`.trim(),""));let{tags:s}=ye();return x("a",{href:`${a}`,class:"md-search-result__link",tabIndex:-1},x("article",{class:"md-search-result__article md-typeset","data-md-score":e.score.toFixed(2)},r>0&&x("div",{class:"md-search-result__icon md-icon"}),r>0&&x("h1",null,e.title),r<=0&&x("h2",null,e.title),o>0&&e.text.length>0&&e.text,e.tags&&e.tags.map(p=>{let c=s?p in s?`md-tag-icon md-tag--${s[p]}`:"md-tag-icon":"";return x("span",{class:`md-tag ${c}`},p)}),o>0&&n.length>0&&x("p",{class:"md-search-result__terms"},Ee("search.result.term.missing"),": ",...n)))}function Tn(e){let t=e[0].score,r=[...e],o=ye(),n=r.findIndex(l=>!`${new URL(l.location,o.base)}`.includes("#")),[i]=r.splice(n,1),a=r.findIndex(l=>l.scoreqr(l,1)),...p.length?[x("details",{class:"md-search-result__more"},x("summary",{tabIndex:-1},x("div",null,p.length>0&&p.length===1?Ee("search.result.more.one"):Ee("search.result.more.other",p.length))),...p.map(l=>qr(l,1)))]:[]];return x("li",{class:"md-search-result__item"},c)}function Sn(e){return x("ul",{class:"md-source__facts"},Object.entries(e).map(([t,r])=>x("li",{class:`md-source__fact md-source__fact--${t}`},typeof r=="number"?sr(r):r)))}function Qr(e){let t=`tabbed-control tabbed-control--${e}`;return x("div",{class:t,hidden:!0},x("button",{class:"tabbed-button",tabIndex:-1,"aria-hidden":"true"}))}function On(e){return x("div",{class:"md-typeset__scrollwrap"},x("div",{class:"md-typeset__table"},e))}function Ca(e){var o;let t=ye(),r=new URL(`../${e.version}/`,t.base);return x("li",{class:"md-version__item"},x("a",{href:`${r}`,class:"md-version__link"},e.title,((o=t.version)==null?void 0:o.alias)&&e.aliases.length>0&&x("span",{class:"md-version__alias"},e.aliases[0])))}function Mn(e,t){var o;let r=ye();return e=e.filter(n=>{var i;return!((i=n.properties)!=null&&i.hidden)}),x("div",{class:"md-version"},x("button",{class:"md-version__current","aria-label":Ee("select.version")},t.title,((o=r.version)==null?void 0:o.alias)&&t.aliases.length>0&&x("span",{class:"md-version__alias"},t.aliases[0])),x("ul",{class:"md-version__list"},e.map(Ca)))}var Ha=0;function ka(e){let t=z([et(e),kt(e)]).pipe(m(([o,n])=>o||n),K()),r=C(()=>Jo(e)).pipe(oe(De),ct(1),m(()=>Xo(e)));return t.pipe(Ae(o=>o),v(()=>z([t,r])),m(([o,n])=>({active:o,offset:n})),pe())}function $a(e,t){let{content$:r,viewport$:o}=t,n=`__tooltip2_${Ha++}`;return C(()=>{let i=new g,a=new _r(!1);i.pipe(X(),ne(!1)).subscribe(a);let s=a.pipe(Ht(c=>Me(+!c*250,Hr)),K(),v(c=>c?r:O),E(c=>c.id=n),pe());z([i.pipe(m(({active:c})=>c)),s.pipe(v(c=>kt(c,250)),Q(!1))]).pipe(m(c=>c.some(l=>l))).subscribe(a);let p=a.pipe(b(c=>c),ee(s,o),m(([c,l,{size:f}])=>{let u=e.getBoundingClientRect(),h=u.width/2;if(l.role==="tooltip")return{x:h,y:8+u.height};if(u.y>=f.height/2){let{height:w}=ce(l);return{x:h,y:-16-w}}else return{x:h,y:16+u.height}}));return z([s,i,p]).subscribe(([c,{offset:l},f])=>{c.style.setProperty("--md-tooltip-host-x",`${l.x}px`),c.style.setProperty("--md-tooltip-host-y",`${l.y}px`),c.style.setProperty("--md-tooltip-x",`${f.x}px`),c.style.setProperty("--md-tooltip-y",`${f.y}px`),c.classList.toggle("md-tooltip2--top",f.y<0),c.classList.toggle("md-tooltip2--bottom",f.y>=0)}),a.pipe(b(c=>c),ee(s,(c,l)=>l),b(c=>c.role==="tooltip")).subscribe(c=>{let l=ce(P(":scope > *",c));c.style.setProperty("--md-tooltip-width",`${l.width}px`),c.style.setProperty("--md-tooltip-tail","0px")}),a.pipe(K(),be(me),ee(s)).subscribe(([c,l])=>{l.classList.toggle("md-tooltip2--active",c)}),z([a.pipe(b(c=>c)),s]).subscribe(([c,l])=>{l.role==="dialog"?(e.setAttribute("aria-controls",n),e.setAttribute("aria-haspopup","dialog")):e.setAttribute("aria-describedby",n)}),a.pipe(b(c=>!c)).subscribe(()=>{e.removeAttribute("aria-controls"),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-haspopup")}),ka(e).pipe(E(c=>i.next(c)),L(()=>i.complete()),m(c=>R({ref:e},c)))})}function lt(e,{viewport$:t},r=document.body){return $a(e,{content$:new F(o=>{let n=e.title,i=yn(n);return o.next(i),e.removeAttribute("title"),r.append(i),()=>{i.remove(),e.setAttribute("title",n)}}),viewport$:t})}function Pa(e,t){let r=C(()=>z([Zo(e),De(t)])).pipe(m(([{x:o,y:n},i])=>{let{width:a,height:s}=ce(e);return{x:o-i.x+a/2,y:n-i.y+s/2}}));return et(e).pipe(v(o=>r.pipe(m(n=>({active:o,offset:n})),Te(+!o||1/0))))}function Ln(e,t,{target$:r}){let[o,n]=Array.from(e.children);return C(()=>{let i=new g,a=i.pipe(X(),ne(!0));return i.subscribe({next({offset:s}){e.style.setProperty("--md-tooltip-x",`${s.x}px`),e.style.setProperty("--md-tooltip-y",`${s.y}px`)},complete(){e.style.removeProperty("--md-tooltip-x"),e.style.removeProperty("--md-tooltip-y")}}),tt(e).pipe(U(a)).subscribe(s=>{e.toggleAttribute("data-md-visible",s)}),S(i.pipe(b(({active:s})=>s)),i.pipe(_e(250),b(({active:s})=>!s))).subscribe({next({active:s}){s?e.prepend(o):o.remove()},complete(){e.prepend(o)}}),i.pipe(Le(16,me)).subscribe(({active:s})=>{o.classList.toggle("md-tooltip--active",s)}),i.pipe(ct(125,me),b(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:s})=>s)).subscribe({next(s){s?e.style.setProperty("--md-tooltip-0",`${-s}px`):e.style.removeProperty("--md-tooltip-0")},complete(){e.style.removeProperty("--md-tooltip-0")}}),d(n,"click").pipe(U(a),b(s=>!(s.metaKey||s.ctrlKey))).subscribe(s=>{s.stopPropagation(),s.preventDefault()}),d(n,"mousedown").pipe(U(a),ee(i)).subscribe(([s,{active:p}])=>{var c;if(s.button!==0||s.metaKey||s.ctrlKey)s.preventDefault();else if(p){s.preventDefault();let l=e.parentElement.closest(".md-annotation");l instanceof HTMLElement?l.focus():(c=Re())==null||c.blur()}}),r.pipe(U(a),b(s=>s===o),Ge(125)).subscribe(()=>e.focus()),Pa(e,t).pipe(E(s=>i.next(s)),L(()=>i.complete()),m(s=>R({ref:e},s)))})}function Ra(e){return e.tagName==="CODE"?$(".c, .c1, .cm",e):[e]}function Ia(e){let t=[];for(let r of Ra(e)){let o=[],n=document.createNodeIterator(r,NodeFilter.SHOW_TEXT);for(let i=n.nextNode();i;i=n.nextNode())o.push(i);for(let i of o){let a;for(;a=/(\(\d+\))(!)?/.exec(i.textContent);){let[,s,p]=a;if(typeof p=="undefined"){let c=i.splitText(a.index);i=c.splitText(s.length),t.push(c)}else{i.textContent=s,t.push(i);break}}}}return t}function _n(e,t){t.append(...Array.from(e.childNodes))}function fr(e,t,{target$:r,print$:o}){let n=t.closest("[id]"),i=n==null?void 0:n.id,a=new Map;for(let s of Ia(t)){let[,p]=s.textContent.match(/\((\d+)\)/);fe(`:scope > li:nth-child(${p})`,e)&&(a.set(p,En(p,i)),s.replaceWith(a.get(p)))}return a.size===0?O:C(()=>{let s=new g,p=s.pipe(X(),ne(!0)),c=[];for(let[l,f]of a)c.push([P(".md-typeset",f),P(`:scope > li:nth-child(${l})`,e)]);return o.pipe(U(p)).subscribe(l=>{e.hidden=!l,e.classList.toggle("md-annotation-list",l);for(let[f,u]of c)l?_n(f,u):_n(u,f)}),S(...[...a].map(([,l])=>Ln(l,t,{target$:r}))).pipe(L(()=>s.complete()),pe())})}function An(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return An(t)}}function Cn(e,t){return C(()=>{let r=An(e);return typeof r!="undefined"?fr(r,e,t):O})}var Hn=Vt(Yr());var Fa=0;function kn(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return kn(t)}}function ja(e){return ge(e).pipe(m(({width:t})=>({scrollable:Tt(e).width>t})),Z("scrollable"))}function $n(e,t){let{matches:r}=matchMedia("(hover)"),o=C(()=>{let n=new g,i=n.pipe(Fr(1));n.subscribe(({scrollable:c})=>{c&&r?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")});let a=[];if(Hn.default.isSupported()&&(e.closest(".copy")||B("content.code.copy")&&!e.closest(".no-copy"))){let c=e.closest("pre");c.id=`__code_${Fa++}`;let l=wn(c.id);c.insertBefore(l,e),B("content.tooltips")&&a.push(lt(l,{viewport$}))}let s=e.closest(".highlight");if(s instanceof HTMLElement){let c=kn(s);if(typeof c!="undefined"&&(s.classList.contains("annotate")||B("content.code.annotate"))){let l=fr(c,e,t);a.push(ge(s).pipe(U(i),m(({width:f,height:u})=>f&&u),K(),v(f=>f?l:O)))}}return $(":scope > span[id]",e).length&&e.classList.add("md-code__content"),ja(e).pipe(E(c=>n.next(c)),L(()=>n.complete()),m(c=>R({ref:e},c)),Pe(...a))});return B("content.lazy")?tt(e).pipe(b(n=>n),Te(1),v(()=>o)):o}function Wa(e,{target$:t,print$:r}){let o=!0;return S(t.pipe(m(n=>n.closest("details:not([open])")),b(n=>e===n),m(()=>({action:"open",reveal:!0}))),r.pipe(b(n=>n||!o),E(()=>o=e.open),m(n=>({action:n?"open":"close"}))))}function Pn(e,t){return C(()=>{let r=new g;return r.subscribe(({action:o,reveal:n})=>{e.toggleAttribute("open",o==="open"),n&&e.scrollIntoView()}),Wa(e,t).pipe(E(o=>r.next(o)),L(()=>r.complete()),m(o=>R({ref:e},o)))})}var Rn=".node circle,.node ellipse,.node path,.node polygon,.node rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}marker{fill:var(--md-mermaid-edge-color)!important}.edgeLabel .label rect{fill:#0000}.label{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.label foreignObject{line-height:normal;overflow:visible}.label div .edgeLabel{color:var(--md-mermaid-label-fg-color)}.edgeLabel,.edgeLabel rect,.label div .edgeLabel{background-color:var(--md-mermaid-label-bg-color)}.edgeLabel,.edgeLabel rect{fill:var(--md-mermaid-label-bg-color);color:var(--md-mermaid-edge-color)}.edgePath .path,.flowchart-link{stroke:var(--md-mermaid-edge-color);stroke-width:.05rem}.edgePath .arrowheadPath{fill:var(--md-mermaid-edge-color);stroke:none}.cluster rect{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}.cluster span{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}g #flowchart-circleEnd,g #flowchart-circleStart,g #flowchart-crossEnd,g #flowchart-crossStart,g #flowchart-pointEnd,g #flowchart-pointStart{stroke:none}g.classGroup line,g.classGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.classGroup text{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.classLabel .box{fill:var(--md-mermaid-label-bg-color);background-color:var(--md-mermaid-label-bg-color);opacity:1}.classLabel .label{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.node .divider{stroke:var(--md-mermaid-node-fg-color)}.relation{stroke:var(--md-mermaid-edge-color)}.cardinality{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.cardinality text{fill:inherit!important}defs #classDiagram-compositionEnd,defs #classDiagram-compositionStart,defs #classDiagram-dependencyEnd,defs #classDiagram-dependencyStart,defs #classDiagram-extensionEnd,defs #classDiagram-extensionStart{fill:var(--md-mermaid-edge-color)!important;stroke:var(--md-mermaid-edge-color)!important}defs #classDiagram-aggregationEnd,defs #classDiagram-aggregationStart{fill:var(--md-mermaid-label-bg-color)!important;stroke:var(--md-mermaid-edge-color)!important}g.stateGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.stateGroup .state-title{fill:var(--md-mermaid-label-fg-color)!important;font-family:var(--md-mermaid-font-family)}g.stateGroup .composit{fill:var(--md-mermaid-label-bg-color)}.nodeLabel,.nodeLabel p{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}a .nodeLabel{text-decoration:underline}.node circle.state-end,.node circle.state-start,.start-state{fill:var(--md-mermaid-edge-color);stroke:none}.end-state-inner,.end-state-outer{fill:var(--md-mermaid-edge-color)}.end-state-inner,.node circle.state-end{stroke:var(--md-mermaid-label-bg-color)}.transition{stroke:var(--md-mermaid-edge-color)}[id^=state-fork] rect,[id^=state-join] rect{fill:var(--md-mermaid-edge-color)!important;stroke:none!important}.statediagram-cluster.statediagram-cluster .inner{fill:var(--md-default-bg-color)}.statediagram-cluster rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}.statediagram-state rect.divider{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}defs #statediagram-barbEnd{stroke:var(--md-mermaid-edge-color)}.attributeBoxEven,.attributeBoxOdd{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}.entityBox{fill:var(--md-mermaid-label-bg-color);stroke:var(--md-mermaid-node-fg-color)}.entityLabel{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.relationshipLabelBox{fill:var(--md-mermaid-label-bg-color);fill-opacity:1;background-color:var(--md-mermaid-label-bg-color);opacity:1}.relationshipLabel{fill:var(--md-mermaid-label-fg-color)}.relationshipLine{stroke:var(--md-mermaid-edge-color)}defs #ONE_OR_MORE_END *,defs #ONE_OR_MORE_START *,defs #ONLY_ONE_END *,defs #ONLY_ONE_START *,defs #ZERO_OR_MORE_END *,defs #ZERO_OR_MORE_START *,defs #ZERO_OR_ONE_END *,defs #ZERO_OR_ONE_START *{stroke:var(--md-mermaid-edge-color)!important}defs #ZERO_OR_MORE_END circle,defs #ZERO_OR_MORE_START circle{fill:var(--md-mermaid-label-bg-color)}.actor{fill:var(--md-mermaid-sequence-actor-bg-color);stroke:var(--md-mermaid-sequence-actor-border-color)}text.actor>tspan{fill:var(--md-mermaid-sequence-actor-fg-color);font-family:var(--md-mermaid-font-family)}line{stroke:var(--md-mermaid-sequence-actor-line-color)}.actor-man circle,.actor-man line{fill:var(--md-mermaid-sequence-actorman-bg-color);stroke:var(--md-mermaid-sequence-actorman-line-color)}.messageLine0,.messageLine1{stroke:var(--md-mermaid-sequence-message-line-color)}.note{fill:var(--md-mermaid-sequence-note-bg-color);stroke:var(--md-mermaid-sequence-note-border-color)}.loopText,.loopText>tspan,.messageText,.noteText>tspan{stroke:none;font-family:var(--md-mermaid-font-family)!important}.messageText{fill:var(--md-mermaid-sequence-message-fg-color)}.loopText,.loopText>tspan{fill:var(--md-mermaid-sequence-loop-fg-color)}.noteText>tspan{fill:var(--md-mermaid-sequence-note-fg-color)}#arrowhead path{fill:var(--md-mermaid-sequence-message-line-color);stroke:none}.loopLine{fill:var(--md-mermaid-sequence-loop-bg-color);stroke:var(--md-mermaid-sequence-loop-border-color)}.labelBox{fill:var(--md-mermaid-sequence-label-bg-color);stroke:none}.labelText,.labelText>span{fill:var(--md-mermaid-sequence-label-fg-color);font-family:var(--md-mermaid-font-family)}.sequenceNumber{fill:var(--md-mermaid-sequence-number-fg-color)}rect.rect{fill:var(--md-mermaid-sequence-box-bg-color);stroke:none}rect.rect+text.text{fill:var(--md-mermaid-sequence-box-fg-color)}defs #sequencenumber{fill:var(--md-mermaid-sequence-number-bg-color)!important}";var Br,Da=0;function Va(){return typeof mermaid=="undefined"||mermaid instanceof Element?wt("https://unpkg.com/mermaid@10/dist/mermaid.min.js"):I(void 0)}function In(e){return e.classList.remove("mermaid"),Br||(Br=Va().pipe(E(()=>mermaid.initialize({startOnLoad:!1,themeCSS:Rn,sequence:{actorFontSize:"16px",messageFontSize:"16px",noteFontSize:"16px"}})),m(()=>{}),G(1))),Br.subscribe(()=>ao(this,null,function*(){e.classList.add("mermaid");let t=`__mermaid_${Da++}`,r=x("div",{class:"mermaid"}),o=e.textContent,{svg:n,fn:i}=yield mermaid.render(t,o),a=r.attachShadow({mode:"closed"});a.innerHTML=n,e.replaceWith(r),i==null||i(a)})),Br.pipe(m(()=>({ref:e})))}var Fn=x("table");function jn(e){return e.replaceWith(Fn),Fn.replaceWith(On(e)),I({ref:e})}function Na(e){let t=e.find(r=>r.checked)||e[0];return S(...e.map(r=>d(r,"change").pipe(m(()=>P(`label[for="${r.id}"]`))))).pipe(Q(P(`label[for="${t.id}"]`)),m(r=>({active:r})))}function Wn(e,{viewport$:t,target$:r}){let o=P(".tabbed-labels",e),n=$(":scope > input",e),i=Qr("prev");e.append(i);let a=Qr("next");return e.append(a),C(()=>{let s=new g,p=s.pipe(X(),ne(!0));z([s,ge(e),tt(e)]).pipe(U(p),Le(1,me)).subscribe({next([{active:c},l]){let f=Ue(c),{width:u}=ce(c);e.style.setProperty("--md-indicator-x",`${f.x}px`),e.style.setProperty("--md-indicator-width",`${u}px`);let h=pr(o);(f.xh.x+l.width)&&o.scrollTo({left:Math.max(0,f.x-16),behavior:"smooth"})},complete(){e.style.removeProperty("--md-indicator-x"),e.style.removeProperty("--md-indicator-width")}}),z([De(o),ge(o)]).pipe(U(p)).subscribe(([c,l])=>{let f=Tt(o);i.hidden=c.x<16,a.hidden=c.x>f.width-l.width-16}),S(d(i,"click").pipe(m(()=>-1)),d(a,"click").pipe(m(()=>1))).pipe(U(p)).subscribe(c=>{let{width:l}=ce(o);o.scrollBy({left:l*c,behavior:"smooth"})}),r.pipe(U(p),b(c=>n.includes(c))).subscribe(c=>c.click()),o.classList.add("tabbed-labels--linked");for(let c of n){let l=P(`label[for="${c.id}"]`);l.replaceChildren(x("a",{href:`#${l.htmlFor}`,tabIndex:-1},...Array.from(l.childNodes))),d(l.firstElementChild,"click").pipe(U(p),b(f=>!(f.metaKey||f.ctrlKey)),E(f=>{f.preventDefault(),f.stopPropagation()})).subscribe(()=>{history.replaceState({},"",`#${l.htmlFor}`),l.click()})}return B("content.tabs.link")&&s.pipe(Ce(1),ee(t)).subscribe(([{active:c},{offset:l}])=>{let f=c.innerText.trim();if(c.hasAttribute("data-md-switching"))c.removeAttribute("data-md-switching");else{let u=e.offsetTop-l.y;for(let w of $("[data-tabs]"))for(let A of $(":scope > input",w)){let te=P(`label[for="${A.id}"]`);if(te!==c&&te.innerText.trim()===f){te.setAttribute("data-md-switching",""),A.click();break}}window.scrollTo({top:e.offsetTop-u});let h=__md_get("__tabs")||[];__md_set("__tabs",[...new Set([f,...h])])}}),s.pipe(U(p)).subscribe(()=>{for(let c of $("audio, video",e))c.pause()}),Na(n).pipe(E(c=>s.next(c)),L(()=>s.complete()),m(c=>R({ref:e},c)))}).pipe(Qe(se))}function Un(e,{viewport$:t,target$:r,print$:o}){return S(...$(".annotate:not(.highlight)",e).map(n=>Cn(n,{target$:r,print$:o})),...$("pre:not(.mermaid) > code",e).map(n=>$n(n,{target$:r,print$:o})),...$("pre.mermaid",e).map(n=>In(n)),...$("table:not([class])",e).map(n=>jn(n)),...$("details",e).map(n=>Pn(n,{target$:r,print$:o})),...$("[data-tabs]",e).map(n=>Wn(n,{viewport$:t,target$:r})),...$("[title]",e).filter(()=>B("content.tooltips")).map(n=>lt(n,{viewport$:t})))}function za(e,{alert$:t}){return t.pipe(v(r=>S(I(!0),I(!1).pipe(Ge(2e3))).pipe(m(o=>({message:r,active:o})))))}function Dn(e,t){let r=P(".md-typeset",e);return C(()=>{let o=new g;return o.subscribe(({message:n,active:i})=>{e.classList.toggle("md-dialog--active",i),r.textContent=n}),za(e,t).pipe(E(n=>o.next(n)),L(()=>o.complete()),m(n=>R({ref:e},n)))})}var qa=0;function Qa(e,t){document.body.append(e);let{width:r}=ce(e);e.style.setProperty("--md-tooltip-width",`${r}px`),e.remove();let o=cr(t),n=typeof o!="undefined"?De(o):I({x:0,y:0}),i=S(et(t),kt(t)).pipe(K());return z([i,n]).pipe(m(([a,s])=>{let{x:p,y:c}=Ue(t),l=ce(t),f=t.closest("table");return f&&t.parentElement&&(p+=f.offsetLeft+t.parentElement.offsetLeft,c+=f.offsetTop+t.parentElement.offsetTop),{active:a,offset:{x:p-s.x+l.width/2-r/2,y:c-s.y+l.height+8}}}))}function Vn(e){let t=e.title;if(!t.length)return O;let r=`__tooltip_${qa++}`,o=Pt(r,"inline"),n=P(".md-typeset",o);return n.innerHTML=t,C(()=>{let i=new g;return i.subscribe({next({offset:a}){o.style.setProperty("--md-tooltip-x",`${a.x}px`),o.style.setProperty("--md-tooltip-y",`${a.y}px`)},complete(){o.style.removeProperty("--md-tooltip-x"),o.style.removeProperty("--md-tooltip-y")}}),S(i.pipe(b(({active:a})=>a)),i.pipe(_e(250),b(({active:a})=>!a))).subscribe({next({active:a}){a?(e.insertAdjacentElement("afterend",o),e.setAttribute("aria-describedby",r),e.removeAttribute("title")):(o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t))},complete(){o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t)}}),i.pipe(Le(16,me)).subscribe(({active:a})=>{o.classList.toggle("md-tooltip--active",a)}),i.pipe(ct(125,me),b(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:a})=>a)).subscribe({next(a){a?o.style.setProperty("--md-tooltip-0",`${-a}px`):o.style.removeProperty("--md-tooltip-0")},complete(){o.style.removeProperty("--md-tooltip-0")}}),Qa(o,e).pipe(E(a=>i.next(a)),L(()=>i.complete()),m(a=>R({ref:e},a)))}).pipe(Qe(se))}function Ka({viewport$:e}){if(!B("header.autohide"))return I(!1);let t=e.pipe(m(({offset:{y:n}})=>n),Ye(2,1),m(([n,i])=>[nMath.abs(i-n.y)>100),m(([,[n]])=>n),K()),o=Ve("search");return z([e,o]).pipe(m(([{offset:n},i])=>n.y>400&&!i),K(),v(n=>n?r:I(!1)),Q(!1))}function Nn(e,t){return C(()=>z([ge(e),Ka(t)])).pipe(m(([{height:r},o])=>({height:r,hidden:o})),K((r,o)=>r.height===o.height&&r.hidden===o.hidden),G(1))}function zn(e,{header$:t,main$:r}){return C(()=>{let o=new g,n=o.pipe(X(),ne(!0));o.pipe(Z("active"),We(t)).subscribe(([{active:a},{hidden:s}])=>{e.classList.toggle("md-header--shadow",a&&!s),e.hidden=s});let i=ue($("[title]",e)).pipe(b(()=>B("content.tooltips")),oe(a=>Vn(a)));return r.subscribe(o),t.pipe(U(n),m(a=>R({ref:e},a)),Pe(i.pipe(U(n))))})}function Ya(e,{viewport$:t,header$:r}){return mr(e,{viewport$:t,header$:r}).pipe(m(({offset:{y:o}})=>{let{height:n}=ce(e);return{active:o>=n}}),Z("active"))}function qn(e,t){return C(()=>{let r=new g;r.subscribe({next({active:n}){e.classList.toggle("md-header__title--active",n)},complete(){e.classList.remove("md-header__title--active")}});let o=fe(".md-content h1");return typeof o=="undefined"?O:Ya(o,t).pipe(E(n=>r.next(n)),L(()=>r.complete()),m(n=>R({ref:e},n)))})}function Qn(e,{viewport$:t,header$:r}){let o=r.pipe(m(({height:i})=>i),K()),n=o.pipe(v(()=>ge(e).pipe(m(({height:i})=>({top:e.offsetTop,bottom:e.offsetTop+i})),Z("bottom"))));return z([o,n,t]).pipe(m(([i,{top:a,bottom:s},{offset:{y:p},size:{height:c}}])=>(c=Math.max(0,c-Math.max(0,a-p,i)-Math.max(0,c+p-s)),{offset:a-i,height:c,active:a-i<=p})),K((i,a)=>i.offset===a.offset&&i.height===a.height&&i.active===a.active))}function Ba(e){let t=__md_get("__palette")||{index:e.findIndex(o=>matchMedia(o.getAttribute("data-md-color-media")).matches)},r=Math.max(0,Math.min(t.index,e.length-1));return I(...e).pipe(oe(o=>d(o,"change").pipe(m(()=>o))),Q(e[r]),m(o=>({index:e.indexOf(o),color:{media:o.getAttribute("data-md-color-media"),scheme:o.getAttribute("data-md-color-scheme"),primary:o.getAttribute("data-md-color-primary"),accent:o.getAttribute("data-md-color-accent")}})),G(1))}function Kn(e){let t=$("input",e),r=x("meta",{name:"theme-color"});document.head.appendChild(r);let o=x("meta",{name:"color-scheme"});document.head.appendChild(o);let n=$t("(prefers-color-scheme: light)");return C(()=>{let i=new g;return i.subscribe(a=>{if(document.body.setAttribute("data-md-color-switching",""),a.color.media==="(prefers-color-scheme)"){let s=matchMedia("(prefers-color-scheme: light)"),p=document.querySelector(s.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");a.color.scheme=p.getAttribute("data-md-color-scheme"),a.color.primary=p.getAttribute("data-md-color-primary"),a.color.accent=p.getAttribute("data-md-color-accent")}for(let[s,p]of Object.entries(a.color))document.body.setAttribute(`data-md-color-${s}`,p);for(let s=0;sa.key==="Enter"),ee(i,(a,s)=>s)).subscribe(({index:a})=>{a=(a+1)%t.length,t[a].click(),t[a].focus()}),i.pipe(m(()=>{let a=Se("header"),s=window.getComputedStyle(a);return o.content=s.colorScheme,s.backgroundColor.match(/\d+/g).map(p=>(+p).toString(16).padStart(2,"0")).join("")})).subscribe(a=>r.content=`#${a}`),i.pipe(be(se)).subscribe(()=>{document.body.removeAttribute("data-md-color-switching")}),Ba(t).pipe(U(n.pipe(Ce(1))),st(),E(a=>i.next(a)),L(()=>i.complete()),m(a=>R({ref:e},a)))})}function Yn(e,{progress$:t}){return C(()=>{let r=new g;return r.subscribe(({value:o})=>{e.style.setProperty("--md-progress-value",`${o}`)}),t.pipe(E(o=>r.next({value:o})),L(()=>r.complete()),m(o=>({ref:e,value:o})))})}var Gr=Vt(Yr());function Ga(e){e.setAttribute("data-md-copying","");let t=e.closest("[data-copy]"),r=t?t.getAttribute("data-copy"):e.innerText;return e.removeAttribute("data-md-copying"),r.trimEnd()}function Bn({alert$:e}){Gr.default.isSupported()&&new F(t=>{new Gr.default("[data-clipboard-target], [data-clipboard-text]",{text:r=>r.getAttribute("data-clipboard-text")||Ga(P(r.getAttribute("data-clipboard-target")))}).on("success",r=>t.next(r))}).pipe(E(t=>{t.trigger.focus()}),m(()=>Ee("clipboard.copied"))).subscribe(e)}function Gn(e,t){return e.protocol=t.protocol,e.hostname=t.hostname,e}function Ja(e,t){let r=new Map;for(let o of $("url",e)){let n=P("loc",o),i=[Gn(new URL(n.textContent),t)];r.set(`${i[0]}`,i);for(let a of $("[rel=alternate]",o)){let s=a.getAttribute("href");s!=null&&i.push(Gn(new URL(s),t))}}return r}function ur(e){return mn(new URL("sitemap.xml",e)).pipe(m(t=>Ja(t,new URL(e))),ve(()=>I(new Map)))}function Xa(e,t){if(!(e.target instanceof Element))return O;let r=e.target.closest("a");if(r===null)return O;if(r.target||e.metaKey||e.ctrlKey)return O;let o=new URL(r.href);return o.search=o.hash="",t.has(`${o}`)?(e.preventDefault(),I(new URL(r.href))):O}function Jn(e){let t=new Map;for(let r of $(":scope > *",e.head))t.set(r.outerHTML,r);return t}function Xn(e){for(let t of $("[href], [src]",e))for(let r of["href","src"]){let o=t.getAttribute(r);if(o&&!/^(?:[a-z]+:)?\/\//i.test(o)){t[r]=t[r];break}}return I(e)}function Za(e){for(let o of["[data-md-component=announce]","[data-md-component=container]","[data-md-component=header-topic]","[data-md-component=outdated]","[data-md-component=logo]","[data-md-component=skip]",...B("navigation.tabs.sticky")?["[data-md-component=tabs]"]:[]]){let n=fe(o),i=fe(o,e);typeof n!="undefined"&&typeof i!="undefined"&&n.replaceWith(i)}let t=Jn(document);for(let[o,n]of Jn(e))t.has(o)?t.delete(o):document.head.appendChild(n);for(let o of t.values()){let n=o.getAttribute("name");n!=="theme-color"&&n!=="color-scheme"&&o.remove()}let r=Se("container");return je($("script",r)).pipe(v(o=>{let n=e.createElement("script");if(o.src){for(let i of o.getAttributeNames())n.setAttribute(i,o.getAttribute(i));return o.replaceWith(n),new F(i=>{n.onload=()=>i.complete()})}else return n.textContent=o.textContent,o.replaceWith(n),O}),X(),ne(document))}function Zn({location$:e,viewport$:t,progress$:r}){let o=ye();if(location.protocol==="file:")return O;let n=ur(o.base);I(document).subscribe(Xn);let i=d(document.body,"click").pipe(We(n),v(([p,c])=>Xa(p,c)),pe()),a=d(window,"popstate").pipe(m(xe),pe());i.pipe(ee(t)).subscribe(([p,{offset:c}])=>{history.replaceState(c,""),history.pushState(null,"",p)}),S(i,a).subscribe(e);let s=e.pipe(Z("pathname"),v(p=>ln(p,{progress$:r}).pipe(ve(()=>(pt(p,!0),O)))),v(Xn),v(Za),pe());return S(s.pipe(ee(e,(p,c)=>c)),s.pipe(v(()=>e),Z("pathname"),v(()=>e),Z("hash")),e.pipe(K((p,c)=>p.pathname===c.pathname&&p.hash===c.hash),v(()=>i),E(()=>history.back()))).subscribe(p=>{var c,l;history.state!==null||!p.hash?window.scrollTo(0,(l=(c=history.state)==null?void 0:c.y)!=null?l:0):(history.scrollRestoration="auto",sn(p.hash),history.scrollRestoration="manual")}),e.subscribe(()=>{history.scrollRestoration="manual"}),d(window,"beforeunload").subscribe(()=>{history.scrollRestoration="auto"}),t.pipe(Z("offset"),_e(100)).subscribe(({offset:p})=>{history.replaceState(p,"")}),s}var ri=Vt(ti());function oi(e){let t=e.separator.split("|").map(n=>n.replace(/(\(\?[!=<][^)]+\))/g,"").length===0?"\uFFFD":n).join("|"),r=new RegExp(t,"img"),o=(n,i,a)=>`${i}${a}`;return n=>{n=n.replace(/[\s*+\-:~^]+/g," ").trim();let i=new RegExp(`(^|${e.separator}|)(${n.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(r,"|")})`,"img");return a=>(0,ri.default)(a).replace(i,o).replace(/<\/mark>(\s+)]*>/img,"$1")}}function It(e){return e.type===1}function dr(e){return e.type===3}function ni(e,t){let r=vn(e);return S(I(location.protocol!=="file:"),Ve("search")).pipe(Ae(o=>o),v(()=>t)).subscribe(({config:o,docs:n})=>r.next({type:0,data:{config:o,docs:n,options:{suggest:B("search.suggest")}}})),r}function ii({document$:e}){let t=ye(),r=Ne(new URL("../versions.json",t.base)).pipe(ve(()=>O)),o=r.pipe(m(n=>{let[,i]=t.base.match(/([^/]+)\/?$/);return n.find(({version:a,aliases:s})=>a===i||s.includes(i))||n[0]}));r.pipe(m(n=>new Map(n.map(i=>[`${new URL(`../${i.version}/`,t.base)}`,i]))),v(n=>d(document.body,"click").pipe(b(i=>!i.metaKey&&!i.ctrlKey),ee(o),v(([i,a])=>{if(i.target instanceof Element){let s=i.target.closest("a");if(s&&!s.target&&n.has(s.href)){let p=s.href;return!i.target.closest(".md-version")&&n.get(p)===a?O:(i.preventDefault(),I(p))}}return O}),v(i=>ur(new URL(i)).pipe(m(a=>{let p=xe().href.replace(t.base,i);return a.has(p.split("#")[0])?new URL(p):new URL(i)})))))).subscribe(n=>pt(n,!0)),z([r,o]).subscribe(([n,i])=>{P(".md-header__topic").appendChild(Mn(n,i))}),e.pipe(v(()=>o)).subscribe(n=>{var a;let i=__md_get("__outdated",sessionStorage);if(i===null){i=!0;let s=((a=t.version)==null?void 0:a.default)||"latest";Array.isArray(s)||(s=[s]);e:for(let p of s)for(let c of n.aliases.concat(n.version))if(new RegExp(p,"i").test(c)){i=!1;break e}__md_set("__outdated",i,sessionStorage)}if(i)for(let s of ae("outdated"))s.hidden=!1})}function ns(e,{worker$:t}){let{searchParams:r}=xe();r.has("q")&&(Je("search",!0),e.value=r.get("q"),e.focus(),Ve("search").pipe(Ae(i=>!i)).subscribe(()=>{let i=xe();i.searchParams.delete("q"),history.replaceState({},"",`${i}`)}));let o=et(e),n=S(t.pipe(Ae(It)),d(e,"keyup"),o).pipe(m(()=>e.value),K());return z([n,o]).pipe(m(([i,a])=>({value:i,focus:a})),G(1))}function ai(e,{worker$:t}){let r=new g,o=r.pipe(X(),ne(!0));z([t.pipe(Ae(It)),r],(i,a)=>a).pipe(Z("value")).subscribe(({value:i})=>t.next({type:2,data:i})),r.pipe(Z("focus")).subscribe(({focus:i})=>{i&&Je("search",i)}),d(e.form,"reset").pipe(U(o)).subscribe(()=>e.focus());let n=P("header [for=__search]");return d(n,"click").subscribe(()=>e.focus()),ns(e,{worker$:t}).pipe(E(i=>r.next(i)),L(()=>r.complete()),m(i=>R({ref:e},i)),G(1))}function si(e,{worker$:t,query$:r}){let o=new g,n=tn(e.parentElement).pipe(b(Boolean)),i=e.parentElement,a=P(":scope > :first-child",e),s=P(":scope > :last-child",e);Ve("search").subscribe(l=>s.setAttribute("role",l?"list":"presentation")),o.pipe(ee(r),Ur(t.pipe(Ae(It)))).subscribe(([{items:l},{value:f}])=>{switch(l.length){case 0:a.textContent=f.length?Ee("search.result.none"):Ee("search.result.placeholder");break;case 1:a.textContent=Ee("search.result.one");break;default:let u=sr(l.length);a.textContent=Ee("search.result.other",u)}});let p=o.pipe(E(()=>s.innerHTML=""),v(({items:l})=>S(I(...l.slice(0,10)),I(...l.slice(10)).pipe(Ye(4),Vr(n),v(([f])=>f)))),m(Tn),pe());return p.subscribe(l=>s.appendChild(l)),p.pipe(oe(l=>{let f=fe("details",l);return typeof f=="undefined"?O:d(f,"toggle").pipe(U(o),m(()=>f))})).subscribe(l=>{l.open===!1&&l.offsetTop<=i.scrollTop&&i.scrollTo({top:l.offsetTop})}),t.pipe(b(dr),m(({data:l})=>l)).pipe(E(l=>o.next(l)),L(()=>o.complete()),m(l=>R({ref:e},l)))}function is(e,{query$:t}){return t.pipe(m(({value:r})=>{let o=xe();return o.hash="",r=r.replace(/\s+/g,"+").replace(/&/g,"%26").replace(/=/g,"%3D"),o.search=`q=${r}`,{url:o}}))}function ci(e,t){let r=new g,o=r.pipe(X(),ne(!0));return r.subscribe(({url:n})=>{e.setAttribute("data-clipboard-text",e.href),e.href=`${n}`}),d(e,"click").pipe(U(o)).subscribe(n=>n.preventDefault()),is(e,t).pipe(E(n=>r.next(n)),L(()=>r.complete()),m(n=>R({ref:e},n)))}function pi(e,{worker$:t,keyboard$:r}){let o=new g,n=Se("search-query"),i=S(d(n,"keydown"),d(n,"focus")).pipe(be(se),m(()=>n.value),K());return o.pipe(We(i),m(([{suggest:s},p])=>{let c=p.split(/([\s-]+)/);if(s!=null&&s.length&&c[c.length-1]){let l=s[s.length-1];l.startsWith(c[c.length-1])&&(c[c.length-1]=l)}else c.length=0;return c})).subscribe(s=>e.innerHTML=s.join("").replace(/\s/g," ")),r.pipe(b(({mode:s})=>s==="search")).subscribe(s=>{switch(s.type){case"ArrowRight":e.innerText.length&&n.selectionStart===n.value.length&&(n.value=e.innerText);break}}),t.pipe(b(dr),m(({data:s})=>s)).pipe(E(s=>o.next(s)),L(()=>o.complete()),m(()=>({ref:e})))}function li(e,{index$:t,keyboard$:r}){let o=ye();try{let n=ni(o.search,t),i=Se("search-query",e),a=Se("search-result",e);d(e,"click").pipe(b(({target:p})=>p instanceof Element&&!!p.closest("a"))).subscribe(()=>Je("search",!1)),r.pipe(b(({mode:p})=>p==="search")).subscribe(p=>{let c=Re();switch(p.type){case"Enter":if(c===i){let l=new Map;for(let f of $(":first-child [href]",a)){let u=f.firstElementChild;l.set(f,parseFloat(u.getAttribute("data-md-score")))}if(l.size){let[[f]]=[...l].sort(([,u],[,h])=>h-u);f.click()}p.claim()}break;case"Escape":case"Tab":Je("search",!1),i.blur();break;case"ArrowUp":case"ArrowDown":if(typeof c=="undefined")i.focus();else{let l=[i,...$(":not(details) > [href], summary, details[open] [href]",a)],f=Math.max(0,(Math.max(0,l.indexOf(c))+l.length+(p.type==="ArrowUp"?-1:1))%l.length);l[f].focus()}p.claim();break;default:i!==Re()&&i.focus()}}),r.pipe(b(({mode:p})=>p==="global")).subscribe(p=>{switch(p.type){case"f":case"s":case"/":i.focus(),i.select(),p.claim();break}});let s=ai(i,{worker$:n});return S(s,si(a,{worker$:n,query$:s})).pipe(Pe(...ae("search-share",e).map(p=>ci(p,{query$:s})),...ae("search-suggest",e).map(p=>pi(p,{worker$:n,keyboard$:r}))))}catch(n){return e.hidden=!0,Ke}}function mi(e,{index$:t,location$:r}){return z([t,r.pipe(Q(xe()),b(o=>!!o.searchParams.get("h")))]).pipe(m(([o,n])=>oi(o.config)(n.searchParams.get("h"))),m(o=>{var a;let n=new Map,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(let s=i.nextNode();s;s=i.nextNode())if((a=s.parentElement)!=null&&a.offsetHeight){let p=s.textContent,c=o(p);c.length>p.length&&n.set(s,c)}for(let[s,p]of n){let{childNodes:c}=x("span",null,p);s.replaceWith(...Array.from(c))}return{ref:e,nodes:n}}))}function as(e,{viewport$:t,main$:r}){let o=e.closest(".md-grid"),n=o.offsetTop-o.parentElement.offsetTop;return z([r,t]).pipe(m(([{offset:i,height:a},{offset:{y:s}}])=>(a=a+Math.min(n,Math.max(0,s-i))-n,{height:a,locked:s>=i+n})),K((i,a)=>i.height===a.height&&i.locked===a.locked))}function Jr(e,o){var n=o,{header$:t}=n,r=io(n,["header$"]);let i=P(".md-sidebar__scrollwrap",e),{y:a}=Ue(i);return C(()=>{let s=new g,p=s.pipe(X(),ne(!0)),c=s.pipe(Le(0,me));return c.pipe(ee(t)).subscribe({next([{height:l},{height:f}]){i.style.height=`${l-2*a}px`,e.style.top=`${f}px`},complete(){i.style.height="",e.style.top=""}}),c.pipe(Ae()).subscribe(()=>{for(let l of $(".md-nav__link--active[href]",e)){if(!l.clientHeight)continue;let f=l.closest(".md-sidebar__scrollwrap");if(typeof f!="undefined"){let u=l.offsetTop-f.offsetTop,{height:h}=ce(f);f.scrollTo({top:u-h/2})}}}),ue($("label[tabindex]",e)).pipe(oe(l=>d(l,"click").pipe(be(se),m(()=>l),U(p)))).subscribe(l=>{let f=P(`[id="${l.htmlFor}"]`);P(`[aria-labelledby="${l.id}"]`).setAttribute("aria-expanded",`${f.checked}`)}),as(e,r).pipe(E(l=>s.next(l)),L(()=>s.complete()),m(l=>R({ref:e},l)))})}function fi(e,t){if(typeof t!="undefined"){let r=`https://api.github.com/repos/${e}/${t}`;return Ct(Ne(`${r}/releases/latest`).pipe(ve(()=>O),m(o=>({version:o.tag_name})),Be({})),Ne(r).pipe(ve(()=>O),m(o=>({stars:o.stargazers_count,forks:o.forks_count})),Be({}))).pipe(m(([o,n])=>R(R({},o),n)))}else{let r=`https://api.github.com/users/${e}`;return Ne(r).pipe(m(o=>({repositories:o.public_repos})),Be({}))}}function ui(e,t){let r=`https://${e}/api/v4/projects/${encodeURIComponent(t)}`;return Ne(r).pipe(ve(()=>O),m(({star_count:o,forks_count:n})=>({stars:o,forks:n})),Be({}))}function di(e){let t=e.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i);if(t){let[,r,o]=t;return fi(r,o)}if(t=e.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i),t){let[,r,o]=t;return ui(r,o)}return O}var ss;function cs(e){return ss||(ss=C(()=>{let t=__md_get("__source",sessionStorage);if(t)return I(t);if(ae("consent").length){let o=__md_get("__consent");if(!(o&&o.github))return O}return di(e.href).pipe(E(o=>__md_set("__source",o,sessionStorage)))}).pipe(ve(()=>O),b(t=>Object.keys(t).length>0),m(t=>({facts:t})),G(1)))}function hi(e){let t=P(":scope > :last-child",e);return C(()=>{let r=new g;return r.subscribe(({facts:o})=>{t.appendChild(Sn(o)),t.classList.add("md-source__repository--active")}),cs(e).pipe(E(o=>r.next(o)),L(()=>r.complete()),m(o=>R({ref:e},o)))})}function ps(e,{viewport$:t,header$:r}){return ge(document.body).pipe(v(()=>mr(e,{header$:r,viewport$:t})),m(({offset:{y:o}})=>({hidden:o>=10})),Z("hidden"))}function bi(e,t){return C(()=>{let r=new g;return r.subscribe({next({hidden:o}){e.hidden=o},complete(){e.hidden=!1}}),(B("navigation.tabs.sticky")?I({hidden:!1}):ps(e,t)).pipe(E(o=>r.next(o)),L(()=>r.complete()),m(o=>R({ref:e},o)))})}function ls(e,{viewport$:t,header$:r}){let o=new Map,n=$(".md-nav__link",e);for(let s of n){let p=decodeURIComponent(s.hash.substring(1)),c=fe(`[id="${p}"]`);typeof c!="undefined"&&o.set(s,c)}let i=r.pipe(Z("height"),m(({height:s})=>{let p=Se("main"),c=P(":scope > :first-child",p);return s+.8*(c.offsetTop-p.offsetTop)}),pe());return ge(document.body).pipe(Z("height"),v(s=>C(()=>{let p=[];return I([...o].reduce((c,[l,f])=>{for(;p.length&&o.get(p[p.length-1]).tagName>=f.tagName;)p.pop();let u=f.offsetTop;for(;!u&&f.parentElement;)f=f.parentElement,u=f.offsetTop;let h=f.offsetParent;for(;h;h=h.offsetParent)u+=h.offsetTop;return c.set([...p=[...p,l]].reverse(),u)},new Map))}).pipe(m(p=>new Map([...p].sort(([,c],[,l])=>c-l))),We(i),v(([p,c])=>t.pipe(jr(([l,f],{offset:{y:u},size:h})=>{let w=u+h.height>=Math.floor(s.height);for(;f.length;){let[,A]=f[0];if(A-c=u&&!w)f=[l.pop(),...f];else break}return[l,f]},[[],[...p]]),K((l,f)=>l[0]===f[0]&&l[1]===f[1])))))).pipe(m(([s,p])=>({prev:s.map(([c])=>c),next:p.map(([c])=>c)})),Q({prev:[],next:[]}),Ye(2,1),m(([s,p])=>s.prev.length{let i=new g,a=i.pipe(X(),ne(!0));if(i.subscribe(({prev:s,next:p})=>{for(let[c]of p)c.classList.remove("md-nav__link--passed"),c.classList.remove("md-nav__link--active");for(let[c,[l]]of s.entries())l.classList.add("md-nav__link--passed"),l.classList.toggle("md-nav__link--active",c===s.length-1)}),B("toc.follow")){let s=S(t.pipe(_e(1),m(()=>{})),t.pipe(_e(250),m(()=>"smooth")));i.pipe(b(({prev:p})=>p.length>0),We(o.pipe(be(se))),ee(s)).subscribe(([[{prev:p}],c])=>{let[l]=p[p.length-1];if(l.offsetHeight){let f=cr(l);if(typeof f!="undefined"){let u=l.offsetTop-f.offsetTop,{height:h}=ce(f);f.scrollTo({top:u-h/2,behavior:c})}}})}return B("navigation.tracking")&&t.pipe(U(a),Z("offset"),_e(250),Ce(1),U(n.pipe(Ce(1))),st({delay:250}),ee(i)).subscribe(([,{prev:s}])=>{let p=xe(),c=s[s.length-1];if(c&&c.length){let[l]=c,{hash:f}=new URL(l.href);p.hash!==f&&(p.hash=f,history.replaceState({},"",`${p}`))}else p.hash="",history.replaceState({},"",`${p}`)}),ls(e,{viewport$:t,header$:r}).pipe(E(s=>i.next(s)),L(()=>i.complete()),m(s=>R({ref:e},s)))})}function ms(e,{viewport$:t,main$:r,target$:o}){let n=t.pipe(m(({offset:{y:a}})=>a),Ye(2,1),m(([a,s])=>a>s&&s>0),K()),i=r.pipe(m(({active:a})=>a));return z([i,n]).pipe(m(([a,s])=>!(a&&s)),K(),U(o.pipe(Ce(1))),ne(!0),st({delay:250}),m(a=>({hidden:a})))}function gi(e,{viewport$:t,header$:r,main$:o,target$:n}){let i=new g,a=i.pipe(X(),ne(!0));return i.subscribe({next({hidden:s}){e.hidden=s,s?(e.setAttribute("tabindex","-1"),e.blur()):e.removeAttribute("tabindex")},complete(){e.style.top="",e.hidden=!0,e.removeAttribute("tabindex")}}),r.pipe(U(a),Z("height")).subscribe(({height:s})=>{e.style.top=`${s+16}px`}),d(e,"click").subscribe(s=>{s.preventDefault(),window.scrollTo({top:0})}),ms(e,{viewport$:t,main$:o,target$:n}).pipe(E(s=>i.next(s)),L(()=>i.complete()),m(s=>R({ref:e},s)))}function xi({document$:e,viewport$:t}){e.pipe(v(()=>$(".md-ellipsis")),oe(r=>tt(r).pipe(U(e.pipe(Ce(1))),b(o=>o),m(()=>r),Te(1))),b(r=>r.offsetWidth{let o=r.innerText,n=r.closest("a")||r;return n.title=o,B("content.tooltips")?lt(n,{viewport$:t}).pipe(U(e.pipe(Ce(1))),L(()=>n.removeAttribute("title"))):O})).subscribe(),B("content.tooltips")&&e.pipe(v(()=>$(".md-status")),oe(r=>lt(r,{viewport$:t}))).subscribe()}function yi({document$:e,tablet$:t}){e.pipe(v(()=>$(".md-toggle--indeterminate")),E(r=>{r.indeterminate=!0,r.checked=!1}),oe(r=>d(r,"change").pipe(Dr(()=>r.classList.contains("md-toggle--indeterminate")),m(()=>r))),ee(t)).subscribe(([r,o])=>{r.classList.remove("md-toggle--indeterminate"),o&&(r.checked=!1)})}function fs(){return/(iPad|iPhone|iPod)/.test(navigator.userAgent)}function Ei({document$:e}){e.pipe(v(()=>$("[data-md-scrollfix]")),E(t=>t.removeAttribute("data-md-scrollfix")),b(fs),oe(t=>d(t,"touchstart").pipe(m(()=>t)))).subscribe(t=>{let r=t.scrollTop;r===0?t.scrollTop=1:r+t.offsetHeight===t.scrollHeight&&(t.scrollTop=r-1)})}function wi({viewport$:e,tablet$:t}){z([Ve("search"),t]).pipe(m(([r,o])=>r&&!o),v(r=>I(r).pipe(Ge(r?400:100))),ee(e)).subscribe(([r,{offset:{y:o}}])=>{if(r)document.body.setAttribute("data-md-scrolllock",""),document.body.style.top=`-${o}px`;else{let n=-1*parseInt(document.body.style.top,10);document.body.removeAttribute("data-md-scrolllock"),document.body.style.top="",n&&window.scrollTo(0,n)}})}Object.entries||(Object.entries=function(e){let t=[];for(let r of Object.keys(e))t.push([r,e[r]]);return t});Object.values||(Object.values=function(e){let t=[];for(let r of Object.keys(e))t.push(e[r]);return t});typeof Element!="undefined"&&(Element.prototype.scrollTo||(Element.prototype.scrollTo=function(e,t){typeof e=="object"?(this.scrollLeft=e.left,this.scrollTop=e.top):(this.scrollLeft=e,this.scrollTop=t)}),Element.prototype.replaceWith||(Element.prototype.replaceWith=function(...e){let t=this.parentNode;if(t){e.length===0&&t.removeChild(this);for(let r=e.length-1;r>=0;r--){let o=e[r];typeof o=="string"?o=document.createTextNode(o):o.parentNode&&o.parentNode.removeChild(o),r?t.insertBefore(this.previousSibling,o):t.replaceChild(o,this)}}}));function us(){return location.protocol==="file:"?wt(`${new URL("search/search_index.js",Xr.base)}`).pipe(m(()=>__index),G(1)):Ne(new URL("search/search_index.json",Xr.base))}document.documentElement.classList.remove("no-js");document.documentElement.classList.add("js");var ot=Yo(),jt=nn(),Ot=cn(jt),Zr=on(),Oe=bn(),hr=$t("(min-width: 960px)"),Si=$t("(min-width: 1220px)"),Oi=pn(),Xr=ye(),Mi=document.forms.namedItem("search")?us():Ke,eo=new g;Bn({alert$:eo});var to=new g;B("navigation.instant")&&Zn({location$:jt,viewport$:Oe,progress$:to}).subscribe(ot);var Ti;((Ti=Xr.version)==null?void 0:Ti.provider)==="mike"&&ii({document$:ot});S(jt,Ot).pipe(Ge(125)).subscribe(()=>{Je("drawer",!1),Je("search",!1)});Zr.pipe(b(({mode:e})=>e==="global")).subscribe(e=>{switch(e.type){case"p":case",":let t=fe("link[rel=prev]");typeof t!="undefined"&&pt(t);break;case"n":case".":let r=fe("link[rel=next]");typeof r!="undefined"&&pt(r);break;case"Enter":let o=Re();o instanceof HTMLLabelElement&&o.click()}});xi({viewport$:Oe,document$:ot});yi({document$:ot,tablet$:hr});Ei({document$:ot});wi({viewport$:Oe,tablet$:hr});var rt=Nn(Se("header"),{viewport$:Oe}),Ft=ot.pipe(m(()=>Se("main")),v(e=>Qn(e,{viewport$:Oe,header$:rt})),G(1)),ds=S(...ae("consent").map(e=>xn(e,{target$:Ot})),...ae("dialog").map(e=>Dn(e,{alert$:eo})),...ae("header").map(e=>zn(e,{viewport$:Oe,header$:rt,main$:Ft})),...ae("palette").map(e=>Kn(e)),...ae("progress").map(e=>Yn(e,{progress$:to})),...ae("search").map(e=>li(e,{index$:Mi,keyboard$:Zr})),...ae("source").map(e=>hi(e))),hs=C(()=>S(...ae("announce").map(e=>gn(e)),...ae("content").map(e=>Un(e,{viewport$:Oe,target$:Ot,print$:Oi})),...ae("content").map(e=>B("search.highlight")?mi(e,{index$:Mi,location$:jt}):O),...ae("header-title").map(e=>qn(e,{viewport$:Oe,header$:rt})),...ae("sidebar").map(e=>e.getAttribute("data-md-type")==="navigation"?Nr(Si,()=>Jr(e,{viewport$:Oe,header$:rt,main$:Ft})):Nr(hr,()=>Jr(e,{viewport$:Oe,header$:rt,main$:Ft}))),...ae("tabs").map(e=>bi(e,{viewport$:Oe,header$:rt})),...ae("toc").map(e=>vi(e,{viewport$:Oe,header$:rt,main$:Ft,target$:Ot})),...ae("top").map(e=>gi(e,{viewport$:Oe,header$:rt,main$:Ft,target$:Ot})))),Li=ot.pipe(v(()=>hs),Pe(ds),G(1));Li.subscribe();window.document$=ot;window.location$=jt;window.target$=Ot;window.keyboard$=Zr;window.viewport$=Oe;window.tablet$=hr;window.screen$=Si;window.print$=Oi;window.alert$=eo;window.progress$=to;window.component$=Li;})(); +//# sourceMappingURL=bundle.fe8b6f2b.min.js.map + diff --git a/assets/javascripts/bundle.fe8b6f2b.min.js.map b/assets/javascripts/bundle.fe8b6f2b.min.js.map new file mode 100644 index 0000000000..82635852ae --- /dev/null +++ b/assets/javascripts/bundle.fe8b6f2b.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["node_modules/focus-visible/dist/focus-visible.js", "node_modules/clipboard/dist/clipboard.js", "node_modules/escape-html/index.js", "src/templates/assets/javascripts/bundle.ts", "node_modules/rxjs/node_modules/tslib/tslib.es6.js", "node_modules/rxjs/src/internal/util/isFunction.ts", "node_modules/rxjs/src/internal/util/createErrorClass.ts", "node_modules/rxjs/src/internal/util/UnsubscriptionError.ts", "node_modules/rxjs/src/internal/util/arrRemove.ts", "node_modules/rxjs/src/internal/Subscription.ts", "node_modules/rxjs/src/internal/config.ts", "node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts", "node_modules/rxjs/src/internal/util/reportUnhandledError.ts", "node_modules/rxjs/src/internal/util/noop.ts", "node_modules/rxjs/src/internal/NotificationFactories.ts", "node_modules/rxjs/src/internal/util/errorContext.ts", "node_modules/rxjs/src/internal/Subscriber.ts", "node_modules/rxjs/src/internal/symbol/observable.ts", "node_modules/rxjs/src/internal/util/identity.ts", "node_modules/rxjs/src/internal/util/pipe.ts", "node_modules/rxjs/src/internal/Observable.ts", "node_modules/rxjs/src/internal/util/lift.ts", "node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts", "node_modules/rxjs/src/internal/scheduler/animationFrameProvider.ts", "node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts", "node_modules/rxjs/src/internal/Subject.ts", "node_modules/rxjs/src/internal/BehaviorSubject.ts", "node_modules/rxjs/src/internal/scheduler/dateTimestampProvider.ts", "node_modules/rxjs/src/internal/ReplaySubject.ts", "node_modules/rxjs/src/internal/scheduler/Action.ts", "node_modules/rxjs/src/internal/scheduler/intervalProvider.ts", "node_modules/rxjs/src/internal/scheduler/AsyncAction.ts", "node_modules/rxjs/src/internal/Scheduler.ts", "node_modules/rxjs/src/internal/scheduler/AsyncScheduler.ts", "node_modules/rxjs/src/internal/scheduler/async.ts", "node_modules/rxjs/src/internal/scheduler/QueueAction.ts", "node_modules/rxjs/src/internal/scheduler/QueueScheduler.ts", "node_modules/rxjs/src/internal/scheduler/queue.ts", "node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts", "node_modules/rxjs/src/internal/scheduler/AnimationFrameScheduler.ts", "node_modules/rxjs/src/internal/scheduler/animationFrame.ts", "node_modules/rxjs/src/internal/observable/empty.ts", "node_modules/rxjs/src/internal/util/isScheduler.ts", "node_modules/rxjs/src/internal/util/args.ts", "node_modules/rxjs/src/internal/util/isArrayLike.ts", "node_modules/rxjs/src/internal/util/isPromise.ts", "node_modules/rxjs/src/internal/util/isInteropObservable.ts", "node_modules/rxjs/src/internal/util/isAsyncIterable.ts", "node_modules/rxjs/src/internal/util/throwUnobservableError.ts", "node_modules/rxjs/src/internal/symbol/iterator.ts", "node_modules/rxjs/src/internal/util/isIterable.ts", "node_modules/rxjs/src/internal/util/isReadableStreamLike.ts", "node_modules/rxjs/src/internal/observable/innerFrom.ts", "node_modules/rxjs/src/internal/util/executeSchedule.ts", "node_modules/rxjs/src/internal/operators/observeOn.ts", "node_modules/rxjs/src/internal/operators/subscribeOn.ts", "node_modules/rxjs/src/internal/scheduled/scheduleObservable.ts", "node_modules/rxjs/src/internal/scheduled/schedulePromise.ts", "node_modules/rxjs/src/internal/scheduled/scheduleArray.ts", "node_modules/rxjs/src/internal/scheduled/scheduleIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleAsyncIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleReadableStreamLike.ts", "node_modules/rxjs/src/internal/scheduled/scheduled.ts", "node_modules/rxjs/src/internal/observable/from.ts", "node_modules/rxjs/src/internal/observable/of.ts", "node_modules/rxjs/src/internal/observable/throwError.ts", "node_modules/rxjs/src/internal/util/EmptyError.ts", "node_modules/rxjs/src/internal/util/isDate.ts", "node_modules/rxjs/src/internal/operators/map.ts", "node_modules/rxjs/src/internal/util/mapOneOrManyArgs.ts", "node_modules/rxjs/src/internal/util/argsArgArrayOrObject.ts", "node_modules/rxjs/src/internal/util/createObject.ts", "node_modules/rxjs/src/internal/observable/combineLatest.ts", "node_modules/rxjs/src/internal/operators/mergeInternals.ts", "node_modules/rxjs/src/internal/operators/mergeMap.ts", "node_modules/rxjs/src/internal/operators/mergeAll.ts", "node_modules/rxjs/src/internal/operators/concatAll.ts", "node_modules/rxjs/src/internal/observable/concat.ts", "node_modules/rxjs/src/internal/observable/defer.ts", "node_modules/rxjs/src/internal/observable/fromEvent.ts", "node_modules/rxjs/src/internal/observable/fromEventPattern.ts", "node_modules/rxjs/src/internal/observable/timer.ts", "node_modules/rxjs/src/internal/observable/merge.ts", "node_modules/rxjs/src/internal/observable/never.ts", "node_modules/rxjs/src/internal/util/argsOrArgArray.ts", "node_modules/rxjs/src/internal/operators/filter.ts", "node_modules/rxjs/src/internal/observable/zip.ts", "node_modules/rxjs/src/internal/operators/audit.ts", "node_modules/rxjs/src/internal/operators/auditTime.ts", "node_modules/rxjs/src/internal/operators/bufferCount.ts", "node_modules/rxjs/src/internal/operators/catchError.ts", "node_modules/rxjs/src/internal/operators/scanInternals.ts", "node_modules/rxjs/src/internal/operators/combineLatest.ts", "node_modules/rxjs/src/internal/operators/combineLatestWith.ts", "node_modules/rxjs/src/internal/operators/debounce.ts", "node_modules/rxjs/src/internal/operators/debounceTime.ts", "node_modules/rxjs/src/internal/operators/defaultIfEmpty.ts", "node_modules/rxjs/src/internal/operators/take.ts", "node_modules/rxjs/src/internal/operators/ignoreElements.ts", "node_modules/rxjs/src/internal/operators/mapTo.ts", "node_modules/rxjs/src/internal/operators/delayWhen.ts", "node_modules/rxjs/src/internal/operators/delay.ts", "node_modules/rxjs/src/internal/operators/distinctUntilChanged.ts", "node_modules/rxjs/src/internal/operators/distinctUntilKeyChanged.ts", "node_modules/rxjs/src/internal/operators/throwIfEmpty.ts", "node_modules/rxjs/src/internal/operators/endWith.ts", "node_modules/rxjs/src/internal/operators/finalize.ts", "node_modules/rxjs/src/internal/operators/first.ts", "node_modules/rxjs/src/internal/operators/takeLast.ts", "node_modules/rxjs/src/internal/operators/merge.ts", "node_modules/rxjs/src/internal/operators/mergeWith.ts", "node_modules/rxjs/src/internal/operators/repeat.ts", "node_modules/rxjs/src/internal/operators/scan.ts", "node_modules/rxjs/src/internal/operators/share.ts", "node_modules/rxjs/src/internal/operators/shareReplay.ts", "node_modules/rxjs/src/internal/operators/skip.ts", "node_modules/rxjs/src/internal/operators/skipUntil.ts", "node_modules/rxjs/src/internal/operators/startWith.ts", "node_modules/rxjs/src/internal/operators/switchMap.ts", "node_modules/rxjs/src/internal/operators/takeUntil.ts", "node_modules/rxjs/src/internal/operators/takeWhile.ts", "node_modules/rxjs/src/internal/operators/tap.ts", "node_modules/rxjs/src/internal/operators/throttle.ts", "node_modules/rxjs/src/internal/operators/throttleTime.ts", "node_modules/rxjs/src/internal/operators/withLatestFrom.ts", "node_modules/rxjs/src/internal/operators/zip.ts", "node_modules/rxjs/src/internal/operators/zipWith.ts", "src/templates/assets/javascripts/browser/document/index.ts", "src/templates/assets/javascripts/browser/element/_/index.ts", "src/templates/assets/javascripts/browser/element/focus/index.ts", "src/templates/assets/javascripts/browser/element/hover/index.ts", "src/templates/assets/javascripts/utilities/h/index.ts", "src/templates/assets/javascripts/utilities/round/index.ts", "src/templates/assets/javascripts/browser/script/index.ts", "src/templates/assets/javascripts/browser/element/size/_/index.ts", "src/templates/assets/javascripts/browser/element/size/content/index.ts", "src/templates/assets/javascripts/browser/element/offset/_/index.ts", "src/templates/assets/javascripts/browser/element/offset/content/index.ts", "src/templates/assets/javascripts/browser/element/visibility/index.ts", "src/templates/assets/javascripts/browser/toggle/index.ts", "src/templates/assets/javascripts/browser/keyboard/index.ts", "src/templates/assets/javascripts/browser/location/_/index.ts", "src/templates/assets/javascripts/browser/location/hash/index.ts", "src/templates/assets/javascripts/browser/media/index.ts", "src/templates/assets/javascripts/browser/request/index.ts", "src/templates/assets/javascripts/browser/viewport/offset/index.ts", "src/templates/assets/javascripts/browser/viewport/size/index.ts", "src/templates/assets/javascripts/browser/viewport/_/index.ts", "src/templates/assets/javascripts/browser/viewport/at/index.ts", "src/templates/assets/javascripts/browser/worker/index.ts", "src/templates/assets/javascripts/_/index.ts", "src/templates/assets/javascripts/components/_/index.ts", "src/templates/assets/javascripts/components/announce/index.ts", "src/templates/assets/javascripts/components/consent/index.ts", "src/templates/assets/javascripts/templates/tooltip/index.tsx", "src/templates/assets/javascripts/templates/annotation/index.tsx", "src/templates/assets/javascripts/templates/clipboard/index.tsx", "src/templates/assets/javascripts/templates/search/index.tsx", "src/templates/assets/javascripts/templates/source/index.tsx", "src/templates/assets/javascripts/templates/tabbed/index.tsx", "src/templates/assets/javascripts/templates/table/index.tsx", "src/templates/assets/javascripts/templates/version/index.tsx", "src/templates/assets/javascripts/components/tooltip2/index.ts", "src/templates/assets/javascripts/components/content/annotation/_/index.ts", "src/templates/assets/javascripts/components/content/annotation/list/index.ts", "src/templates/assets/javascripts/components/content/annotation/block/index.ts", "src/templates/assets/javascripts/components/content/code/_/index.ts", "src/templates/assets/javascripts/components/content/details/index.ts", "src/templates/assets/javascripts/components/content/mermaid/index.css", "src/templates/assets/javascripts/components/content/mermaid/index.ts", "src/templates/assets/javascripts/components/content/table/index.ts", "src/templates/assets/javascripts/components/content/tabs/index.ts", "src/templates/assets/javascripts/components/content/_/index.ts", "src/templates/assets/javascripts/components/dialog/index.ts", "src/templates/assets/javascripts/components/tooltip/index.ts", "src/templates/assets/javascripts/components/header/_/index.ts", "src/templates/assets/javascripts/components/header/title/index.ts", "src/templates/assets/javascripts/components/main/index.ts", "src/templates/assets/javascripts/components/palette/index.ts", "src/templates/assets/javascripts/components/progress/index.ts", "src/templates/assets/javascripts/integrations/clipboard/index.ts", "src/templates/assets/javascripts/integrations/sitemap/index.ts", "src/templates/assets/javascripts/integrations/instant/index.ts", "src/templates/assets/javascripts/integrations/search/highlighter/index.ts", "src/templates/assets/javascripts/integrations/search/worker/message/index.ts", "src/templates/assets/javascripts/integrations/search/worker/_/index.ts", "src/templates/assets/javascripts/integrations/version/index.ts", "src/templates/assets/javascripts/components/search/query/index.ts", "src/templates/assets/javascripts/components/search/result/index.ts", "src/templates/assets/javascripts/components/search/share/index.ts", "src/templates/assets/javascripts/components/search/suggest/index.ts", "src/templates/assets/javascripts/components/search/_/index.ts", "src/templates/assets/javascripts/components/search/highlight/index.ts", "src/templates/assets/javascripts/components/sidebar/index.ts", "src/templates/assets/javascripts/components/source/facts/github/index.ts", "src/templates/assets/javascripts/components/source/facts/gitlab/index.ts", "src/templates/assets/javascripts/components/source/facts/_/index.ts", "src/templates/assets/javascripts/components/source/_/index.ts", "src/templates/assets/javascripts/components/tabs/index.ts", "src/templates/assets/javascripts/components/toc/index.ts", "src/templates/assets/javascripts/components/top/index.ts", "src/templates/assets/javascripts/patches/ellipsis/index.ts", "src/templates/assets/javascripts/patches/indeterminate/index.ts", "src/templates/assets/javascripts/patches/scrollfix/index.ts", "src/templates/assets/javascripts/patches/scrolllock/index.ts", "src/templates/assets/javascripts/polyfills/index.ts"], + "sourcesContent": ["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (factory());\n}(this, (function () { 'use strict';\n\n /**\n * Applies the :focus-visible polyfill at the given scope.\n * A scope in this case is either the top-level Document or a Shadow Root.\n *\n * @param {(Document|ShadowRoot)} scope\n * @see https://github.com/WICG/focus-visible\n */\n function applyFocusVisiblePolyfill(scope) {\n var hadKeyboardEvent = true;\n var hadFocusVisibleRecently = false;\n var hadFocusVisibleRecentlyTimeout = null;\n\n var inputTypesAllowlist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n };\n\n /**\n * Helper function for legacy browsers and iframes which sometimes focus\n * elements like document, body, and non-interactive SVG.\n * @param {Element} el\n */\n function isValidFocusTarget(el) {\n if (\n el &&\n el !== document &&\n el.nodeName !== 'HTML' &&\n el.nodeName !== 'BODY' &&\n 'classList' in el &&\n 'contains' in el.classList\n ) {\n return true;\n }\n return false;\n }\n\n /**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} el\n * @return {boolean}\n */\n function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n\n if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !el.readOnly) {\n return true;\n }\n\n if (el.isContentEditable) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Add the `focus-visible` class to the given element if it was not added by\n * the author.\n * @param {Element} el\n */\n function addFocusVisibleClass(el) {\n if (el.classList.contains('focus-visible')) {\n return;\n }\n el.classList.add('focus-visible');\n el.setAttribute('data-focus-visible-added', '');\n }\n\n /**\n * Remove the `focus-visible` class from the given element if it was not\n * originally added by the author.\n * @param {Element} el\n */\n function removeFocusVisibleClass(el) {\n if (!el.hasAttribute('data-focus-visible-added')) {\n return;\n }\n el.classList.remove('focus-visible');\n el.removeAttribute('data-focus-visible-added');\n }\n\n /**\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * Apply `focus-visible` to any current active element and keep track\n * of our keyboard modality state with `hadKeyboardEvent`.\n * @param {KeyboardEvent} e\n */\n function onKeyDown(e) {\n if (e.metaKey || e.altKey || e.ctrlKey) {\n return;\n }\n\n if (isValidFocusTarget(scope.activeElement)) {\n addFocusVisibleClass(scope.activeElement);\n }\n\n hadKeyboardEvent = true;\n }\n\n /**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n * @param {Event} e\n */\n function onPointerDown(e) {\n hadKeyboardEvent = false;\n }\n\n /**\n * On `focus`, add the `focus-visible` class to the target if:\n * - the target received focus as a result of keyboard navigation, or\n * - the event target is an element that will likely require interaction\n * via the keyboard (e.g. a text box)\n * @param {Event} e\n */\n function onFocus(e) {\n // Prevent IE from focusing the document or HTML element.\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {\n addFocusVisibleClass(e.target);\n }\n }\n\n /**\n * On `blur`, remove the `focus-visible` class from the target.\n * @param {Event} e\n */\n function onBlur(e) {\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (\n e.target.classList.contains('focus-visible') ||\n e.target.hasAttribute('data-focus-visible-added')\n ) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function() {\n hadFocusVisibleRecently = false;\n }, 100);\n removeFocusVisibleClass(e.target);\n }\n }\n\n /**\n * If the user changes tabs, keep track of whether or not the previously\n * focused element had .focus-visible.\n * @param {Event} e\n */\n function onVisibilityChange(e) {\n if (document.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n addInitialPointerMoveListeners();\n }\n }\n\n /**\n * Add a group of listeners to detect usage of any pointing devices.\n * These listeners will be added when the polyfill first loads, and anytime\n * the window is blurred, so that they are active when the window regains\n * focus.\n */\n function addInitialPointerMoveListeners() {\n document.addEventListener('mousemove', onInitialPointerMove);\n document.addEventListener('mousedown', onInitialPointerMove);\n document.addEventListener('mouseup', onInitialPointerMove);\n document.addEventListener('pointermove', onInitialPointerMove);\n document.addEventListener('pointerdown', onInitialPointerMove);\n document.addEventListener('pointerup', onInitialPointerMove);\n document.addEventListener('touchmove', onInitialPointerMove);\n document.addEventListener('touchstart', onInitialPointerMove);\n document.addEventListener('touchend', onInitialPointerMove);\n }\n\n function removeInitialPointerMoveListeners() {\n document.removeEventListener('mousemove', onInitialPointerMove);\n document.removeEventListener('mousedown', onInitialPointerMove);\n document.removeEventListener('mouseup', onInitialPointerMove);\n document.removeEventListener('pointermove', onInitialPointerMove);\n document.removeEventListener('pointerdown', onInitialPointerMove);\n document.removeEventListener('pointerup', onInitialPointerMove);\n document.removeEventListener('touchmove', onInitialPointerMove);\n document.removeEventListener('touchstart', onInitialPointerMove);\n document.removeEventListener('touchend', onInitialPointerMove);\n }\n\n /**\n * When the polfyill first loads, assume the user is in keyboard modality.\n * If any event is received from a pointing device (e.g. mouse, pointer,\n * touch), turn off keyboard modality.\n * This accounts for situations where focus enters the page from the URL bar.\n * @param {Event} e\n */\n function onInitialPointerMove(e) {\n // Work around a Safari quirk that fires a mousemove on whenever the\n // window blurs, even if you're tabbing out of the page. \u00AF\\_(\u30C4)_/\u00AF\n if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {\n return;\n }\n\n hadKeyboardEvent = false;\n removeInitialPointerMoveListeners();\n }\n\n // For some kinds of state, we are interested in changes at the global scope\n // only. For example, global pointer input, global key presses and global\n // visibility change should affect the state at every scope:\n document.addEventListener('keydown', onKeyDown, true);\n document.addEventListener('mousedown', onPointerDown, true);\n document.addEventListener('pointerdown', onPointerDown, true);\n document.addEventListener('touchstart', onPointerDown, true);\n document.addEventListener('visibilitychange', onVisibilityChange, true);\n\n addInitialPointerMoveListeners();\n\n // For focus and blur, we specifically care about state changes in the local\n // scope. This is because focus / blur events that originate from within a\n // shadow root are not re-dispatched from the host element if it was already\n // the active element in its own scope:\n scope.addEventListener('focus', onFocus, true);\n scope.addEventListener('blur', onBlur, true);\n\n // We detect that a node is a ShadowRoot by ensuring that it is a\n // DocumentFragment and also has a host property. This check covers native\n // implementation and polyfill implementation transparently. If we only cared\n // about the native implementation, we could just check if the scope was\n // an instance of a ShadowRoot.\n if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {\n // Since a ShadowRoot is a special kind of DocumentFragment, it does not\n // have a root element to add a class to. So, we add this attribute to the\n // host element instead:\n scope.host.setAttribute('data-js-focus-visible', '');\n } else if (scope.nodeType === Node.DOCUMENT_NODE) {\n document.documentElement.classList.add('js-focus-visible');\n document.documentElement.setAttribute('data-js-focus-visible', '');\n }\n }\n\n // It is important to wrap all references to global window and document in\n // these checks to support server-side rendering use cases\n // @see https://github.com/WICG/focus-visible/issues/199\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n // Make the polyfill helper globally available. This can be used as a signal\n // to interested libraries that wish to coordinate with the polyfill for e.g.,\n // applying the polyfill to a shadow root:\n window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;\n\n // Notify interested libraries of the polyfill's presence, in case the\n // polyfill was loaded lazily:\n var event;\n\n try {\n event = new CustomEvent('focus-visible-polyfill-ready');\n } catch (error) {\n // IE11 does not support using CustomEvent as a constructor directly:\n event = document.createEvent('CustomEvent');\n event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});\n }\n\n window.dispatchEvent(event);\n }\n\n if (typeof document !== 'undefined') {\n // Apply the polyfill to the global document, so that no JavaScript\n // coordination is required to use the polyfill in the top-level document:\n applyFocusVisiblePolyfill(document);\n }\n\n})));\n", "/*!\n * clipboard.js v2.0.11\n * https://clipboardjs.com/\n *\n * Licensed MIT \u00A9 Zeno Rocha\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ClipboardJS\"] = factory();\n\telse\n\t\troot[\"ClipboardJS\"] = factory();\n})(this, function() {\nreturn /******/ (function() { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ 686:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"default\": function() { return /* binding */ clipboard; }\n});\n\n// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js\nvar tiny_emitter = __webpack_require__(279);\nvar tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter);\n// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js\nvar listen = __webpack_require__(370);\nvar listen_default = /*#__PURE__*/__webpack_require__.n(listen);\n// EXTERNAL MODULE: ./node_modules/select/src/select.js\nvar src_select = __webpack_require__(817);\nvar select_default = /*#__PURE__*/__webpack_require__.n(src_select);\n;// CONCATENATED MODULE: ./src/common/command.js\n/**\n * Executes a given operation type.\n * @param {String} type\n * @return {Boolean}\n */\nfunction command(type) {\n try {\n return document.execCommand(type);\n } catch (err) {\n return false;\n }\n}\n;// CONCATENATED MODULE: ./src/actions/cut.js\n\n\n/**\n * Cut action wrapper.\n * @param {String|HTMLElement} target\n * @return {String}\n */\n\nvar ClipboardActionCut = function ClipboardActionCut(target) {\n var selectedText = select_default()(target);\n command('cut');\n return selectedText;\n};\n\n/* harmony default export */ var actions_cut = (ClipboardActionCut);\n;// CONCATENATED MODULE: ./src/common/create-fake-element.js\n/**\n * Creates a fake textarea element with a value.\n * @param {String} value\n * @return {HTMLElement}\n */\nfunction createFakeElement(value) {\n var isRTL = document.documentElement.getAttribute('dir') === 'rtl';\n var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS\n\n fakeElement.style.fontSize = '12pt'; // Reset box model\n\n fakeElement.style.border = '0';\n fakeElement.style.padding = '0';\n fakeElement.style.margin = '0'; // Move element out of screen horizontally\n\n fakeElement.style.position = 'absolute';\n fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically\n\n var yPosition = window.pageYOffset || document.documentElement.scrollTop;\n fakeElement.style.top = \"\".concat(yPosition, \"px\");\n fakeElement.setAttribute('readonly', '');\n fakeElement.value = value;\n return fakeElement;\n}\n;// CONCATENATED MODULE: ./src/actions/copy.js\n\n\n\n/**\n * Create fake copy action wrapper using a fake element.\n * @param {String} target\n * @param {Object} options\n * @return {String}\n */\n\nvar fakeCopyAction = function fakeCopyAction(value, options) {\n var fakeElement = createFakeElement(value);\n options.container.appendChild(fakeElement);\n var selectedText = select_default()(fakeElement);\n command('copy');\n fakeElement.remove();\n return selectedText;\n};\n/**\n * Copy action wrapper.\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @return {String}\n */\n\n\nvar ClipboardActionCopy = function ClipboardActionCopy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n var selectedText = '';\n\n if (typeof target === 'string') {\n selectedText = fakeCopyAction(target, options);\n } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {\n // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n selectedText = fakeCopyAction(target.value, options);\n } else {\n selectedText = select_default()(target);\n command('copy');\n }\n\n return selectedText;\n};\n\n/* harmony default export */ var actions_copy = (ClipboardActionCopy);\n;// CONCATENATED MODULE: ./src/actions/default.js\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\n/**\n * Inner function which performs selection from either `text` or `target`\n * properties and then executes copy or cut operations.\n * @param {Object} options\n */\n\nvar ClipboardActionDefault = function ClipboardActionDefault() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // Defines base properties passed from constructor.\n var _options$action = options.action,\n action = _options$action === void 0 ? 'copy' : _options$action,\n container = options.container,\n target = options.target,\n text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.\n\n if (action !== 'copy' && action !== 'cut') {\n throw new Error('Invalid \"action\" value, use either \"copy\" or \"cut\"');\n } // Sets the `target` property using an element that will be have its content copied.\n\n\n if (target !== undefined) {\n if (target && _typeof(target) === 'object' && target.nodeType === 1) {\n if (action === 'copy' && target.hasAttribute('disabled')) {\n throw new Error('Invalid \"target\" attribute. Please use \"readonly\" instead of \"disabled\" attribute');\n }\n\n if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {\n throw new Error('Invalid \"target\" attribute. You can\\'t cut text from elements with \"readonly\" or \"disabled\" attributes');\n }\n } else {\n throw new Error('Invalid \"target\" value, use a valid Element');\n }\n } // Define selection strategy based on `text` property.\n\n\n if (text) {\n return actions_copy(text, {\n container: container\n });\n } // Defines which selection strategy based on `target` property.\n\n\n if (target) {\n return action === 'cut' ? actions_cut(target) : actions_copy(target, {\n container: container\n });\n }\n};\n\n/* harmony default export */ var actions_default = (ClipboardActionDefault);\n;// CONCATENATED MODULE: ./src/clipboard.js\nfunction clipboard_typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return clipboard_typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n/**\n * Helper function to retrieve attribute value.\n * @param {String} suffix\n * @param {Element} element\n */\n\nfunction getAttributeValue(suffix, element) {\n var attribute = \"data-clipboard-\".concat(suffix);\n\n if (!element.hasAttribute(attribute)) {\n return;\n }\n\n return element.getAttribute(attribute);\n}\n/**\n * Base class which takes one or more elements, adds event listeners to them,\n * and instantiates a new `ClipboardAction` on each click.\n */\n\n\nvar Clipboard = /*#__PURE__*/function (_Emitter) {\n _inherits(Clipboard, _Emitter);\n\n var _super = _createSuper(Clipboard);\n\n /**\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n * @param {Object} options\n */\n function Clipboard(trigger, options) {\n var _this;\n\n _classCallCheck(this, Clipboard);\n\n _this = _super.call(this);\n\n _this.resolveOptions(options);\n\n _this.listenClick(trigger);\n\n return _this;\n }\n /**\n * Defines if attributes would be resolved using internal setter functions\n * or custom functions that were passed in the constructor.\n * @param {Object} options\n */\n\n\n _createClass(Clipboard, [{\n key: \"resolveOptions\",\n value: function resolveOptions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.action = typeof options.action === 'function' ? options.action : this.defaultAction;\n this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;\n this.text = typeof options.text === 'function' ? options.text : this.defaultText;\n this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;\n }\n /**\n * Adds a click event listener to the passed trigger.\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n */\n\n }, {\n key: \"listenClick\",\n value: function listenClick(trigger) {\n var _this2 = this;\n\n this.listener = listen_default()(trigger, 'click', function (e) {\n return _this2.onClick(e);\n });\n }\n /**\n * Defines a new `ClipboardAction` on each click event.\n * @param {Event} e\n */\n\n }, {\n key: \"onClick\",\n value: function onClick(e) {\n var trigger = e.delegateTarget || e.currentTarget;\n var action = this.action(trigger) || 'copy';\n var text = actions_default({\n action: action,\n container: this.container,\n target: this.target(trigger),\n text: this.text(trigger)\n }); // Fires an event based on the copy operation result.\n\n this.emit(text ? 'success' : 'error', {\n action: action,\n text: text,\n trigger: trigger,\n clearSelection: function clearSelection() {\n if (trigger) {\n trigger.focus();\n }\n\n window.getSelection().removeAllRanges();\n }\n });\n }\n /**\n * Default `action` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultAction\",\n value: function defaultAction(trigger) {\n return getAttributeValue('action', trigger);\n }\n /**\n * Default `target` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultTarget\",\n value: function defaultTarget(trigger) {\n var selector = getAttributeValue('target', trigger);\n\n if (selector) {\n return document.querySelector(selector);\n }\n }\n /**\n * Allow fire programmatically a copy action\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @returns Text copied.\n */\n\n }, {\n key: \"defaultText\",\n\n /**\n * Default `text` lookup function.\n * @param {Element} trigger\n */\n value: function defaultText(trigger) {\n return getAttributeValue('text', trigger);\n }\n /**\n * Destroy lifecycle.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.listener.destroy();\n }\n }], [{\n key: \"copy\",\n value: function copy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n return actions_copy(target, options);\n }\n /**\n * Allow fire programmatically a cut action\n * @param {String|HTMLElement} target\n * @returns Text cutted.\n */\n\n }, {\n key: \"cut\",\n value: function cut(target) {\n return actions_cut(target);\n }\n /**\n * Returns the support of the given action, or all actions if no action is\n * given.\n * @param {String} [action]\n */\n\n }, {\n key: \"isSupported\",\n value: function isSupported() {\n var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];\n var actions = typeof action === 'string' ? [action] : action;\n var support = !!document.queryCommandSupported;\n actions.forEach(function (action) {\n support = support && !!document.queryCommandSupported(action);\n });\n return support;\n }\n }]);\n\n return Clipboard;\n}((tiny_emitter_default()));\n\n/* harmony default export */ var clipboard = (Clipboard);\n\n/***/ }),\n\n/***/ 828:\n/***/ (function(module) {\n\nvar DOCUMENT_NODE_TYPE = 9;\n\n/**\n * A polyfill for Element.matches()\n */\nif (typeof Element !== 'undefined' && !Element.prototype.matches) {\n var proto = Element.prototype;\n\n proto.matches = proto.matchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector ||\n proto.webkitMatchesSelector;\n}\n\n/**\n * Finds the closest parent that matches a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @return {Function}\n */\nfunction closest (element, selector) {\n while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {\n if (typeof element.matches === 'function' &&\n element.matches(selector)) {\n return element;\n }\n element = element.parentNode;\n }\n}\n\nmodule.exports = closest;\n\n\n/***/ }),\n\n/***/ 438:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar closest = __webpack_require__(828);\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction _delegate(element, selector, type, callback, useCapture) {\n var listenerFn = listener.apply(this, arguments);\n\n element.addEventListener(type, listenerFn, useCapture);\n\n return {\n destroy: function() {\n element.removeEventListener(type, listenerFn, useCapture);\n }\n }\n}\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element|String|Array} [elements]\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction delegate(elements, selector, type, callback, useCapture) {\n // Handle the regular Element usage\n if (typeof elements.addEventListener === 'function') {\n return _delegate.apply(null, arguments);\n }\n\n // Handle Element-less usage, it defaults to global delegation\n if (typeof type === 'function') {\n // Use `document` as the first parameter, then apply arguments\n // This is a short way to .unshift `arguments` without running into deoptimizations\n return _delegate.bind(null, document).apply(null, arguments);\n }\n\n // Handle Selector-based usage\n if (typeof elements === 'string') {\n elements = document.querySelectorAll(elements);\n }\n\n // Handle Array-like based usage\n return Array.prototype.map.call(elements, function (element) {\n return _delegate(element, selector, type, callback, useCapture);\n });\n}\n\n/**\n * Finds closest match and invokes callback.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Function}\n */\nfunction listener(element, selector, type, callback) {\n return function(e) {\n e.delegateTarget = closest(e.target, selector);\n\n if (e.delegateTarget) {\n callback.call(element, e);\n }\n }\n}\n\nmodule.exports = delegate;\n\n\n/***/ }),\n\n/***/ 879:\n/***/ (function(__unused_webpack_module, exports) {\n\n/**\n * Check if argument is a HTML element.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.node = function(value) {\n return value !== undefined\n && value instanceof HTMLElement\n && value.nodeType === 1;\n};\n\n/**\n * Check if argument is a list of HTML elements.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.nodeList = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return value !== undefined\n && (type === '[object NodeList]' || type === '[object HTMLCollection]')\n && ('length' in value)\n && (value.length === 0 || exports.node(value[0]));\n};\n\n/**\n * Check if argument is a string.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.string = function(value) {\n return typeof value === 'string'\n || value instanceof String;\n};\n\n/**\n * Check if argument is a function.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.fn = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return type === '[object Function]';\n};\n\n\n/***/ }),\n\n/***/ 370:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar is = __webpack_require__(879);\nvar delegate = __webpack_require__(438);\n\n/**\n * Validates all params and calls the right\n * listener function based on its target type.\n *\n * @param {String|HTMLElement|HTMLCollection|NodeList} target\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listen(target, type, callback) {\n if (!target && !type && !callback) {\n throw new Error('Missing required arguments');\n }\n\n if (!is.string(type)) {\n throw new TypeError('Second argument must be a String');\n }\n\n if (!is.fn(callback)) {\n throw new TypeError('Third argument must be a Function');\n }\n\n if (is.node(target)) {\n return listenNode(target, type, callback);\n }\n else if (is.nodeList(target)) {\n return listenNodeList(target, type, callback);\n }\n else if (is.string(target)) {\n return listenSelector(target, type, callback);\n }\n else {\n throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');\n }\n}\n\n/**\n * Adds an event listener to a HTML element\n * and returns a remove listener function.\n *\n * @param {HTMLElement} node\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNode(node, type, callback) {\n node.addEventListener(type, callback);\n\n return {\n destroy: function() {\n node.removeEventListener(type, callback);\n }\n }\n}\n\n/**\n * Add an event listener to a list of HTML elements\n * and returns a remove listener function.\n *\n * @param {NodeList|HTMLCollection} nodeList\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNodeList(nodeList, type, callback) {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.addEventListener(type, callback);\n });\n\n return {\n destroy: function() {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.removeEventListener(type, callback);\n });\n }\n }\n}\n\n/**\n * Add an event listener to a selector\n * and returns a remove listener function.\n *\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenSelector(selector, type, callback) {\n return delegate(document.body, selector, type, callback);\n}\n\nmodule.exports = listen;\n\n\n/***/ }),\n\n/***/ 817:\n/***/ (function(module) {\n\nfunction select(element) {\n var selectedText;\n\n if (element.nodeName === 'SELECT') {\n element.focus();\n\n selectedText = element.value;\n }\n else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {\n var isReadOnly = element.hasAttribute('readonly');\n\n if (!isReadOnly) {\n element.setAttribute('readonly', '');\n }\n\n element.select();\n element.setSelectionRange(0, element.value.length);\n\n if (!isReadOnly) {\n element.removeAttribute('readonly');\n }\n\n selectedText = element.value;\n }\n else {\n if (element.hasAttribute('contenteditable')) {\n element.focus();\n }\n\n var selection = window.getSelection();\n var range = document.createRange();\n\n range.selectNodeContents(element);\n selection.removeAllRanges();\n selection.addRange(range);\n\n selectedText = selection.toString();\n }\n\n return selectedText;\n}\n\nmodule.exports = select;\n\n\n/***/ }),\n\n/***/ 279:\n/***/ (function(module) {\n\nfunction E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(__webpack_module_cache__[moduleId]) {\n/******/ \t\t\treturn __webpack_module_cache__[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/compat get default export */\n/******/ \t!function() {\n/******/ \t\t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t\t__webpack_require__.n = function(module) {\n/******/ \t\t\tvar getter = module && module.__esModule ?\n/******/ \t\t\t\tfunction() { return module['default']; } :\n/******/ \t\t\t\tfunction() { return module; };\n/******/ \t\t\t__webpack_require__.d(getter, { a: getter });\n/******/ \t\t\treturn getter;\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t!function() {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = function(exports, definition) {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t!function() {\n/******/ \t\t__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }\n/******/ \t}();\n/******/ \t\n/************************************************************************/\n/******/ \t// module exports must be returned from runtime so entry inlining is disabled\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(686);\n/******/ })()\n.default;\n});", "/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport \"focus-visible\"\n\nimport {\n EMPTY,\n NEVER,\n Observable,\n Subject,\n defer,\n delay,\n filter,\n map,\n merge,\n mergeWith,\n shareReplay,\n switchMap\n} from \"rxjs\"\n\nimport { configuration, feature } from \"./_\"\nimport {\n at,\n getActiveElement,\n getOptionalElement,\n requestJSON,\n setLocation,\n setToggle,\n watchDocument,\n watchKeyboard,\n watchLocation,\n watchLocationTarget,\n watchMedia,\n watchPrint,\n watchScript,\n watchViewport\n} from \"./browser\"\nimport {\n getComponentElement,\n getComponentElements,\n mountAnnounce,\n mountBackToTop,\n mountConsent,\n mountContent,\n mountDialog,\n mountHeader,\n mountHeaderTitle,\n mountPalette,\n mountProgress,\n mountSearch,\n mountSearchHiglight,\n mountSidebar,\n mountSource,\n mountTableOfContents,\n mountTabs,\n watchHeader,\n watchMain\n} from \"./components\"\nimport {\n SearchIndex,\n setupClipboardJS,\n setupInstantNavigation,\n setupVersionSelector\n} from \"./integrations\"\nimport {\n patchEllipsis,\n patchIndeterminate,\n patchScrollfix,\n patchScrolllock\n} from \"./patches\"\nimport \"./polyfills\"\n\n/* ----------------------------------------------------------------------------\n * Functions - @todo refactor\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch search index\n *\n * @returns Search index observable\n */\nfunction fetchSearchIndex(): Observable {\n if (location.protocol === \"file:\") {\n return watchScript(\n `${new URL(\"search/search_index.js\", config.base)}`\n )\n .pipe(\n // @ts-ignore - @todo fix typings\n map(() => __index),\n shareReplay(1)\n )\n } else {\n return requestJSON(\n new URL(\"search/search_index.json\", config.base)\n )\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Application\n * ------------------------------------------------------------------------- */\n\n/* Yay, JavaScript is available */\ndocument.documentElement.classList.remove(\"no-js\")\ndocument.documentElement.classList.add(\"js\")\n\n/* Set up navigation observables and subjects */\nconst document$ = watchDocument()\nconst location$ = watchLocation()\nconst target$ = watchLocationTarget(location$)\nconst keyboard$ = watchKeyboard()\n\n/* Set up media observables */\nconst viewport$ = watchViewport()\nconst tablet$ = watchMedia(\"(min-width: 960px)\")\nconst screen$ = watchMedia(\"(min-width: 1220px)\")\nconst print$ = watchPrint()\n\n/* Retrieve search index, if search is enabled */\nconst config = configuration()\nconst index$ = document.forms.namedItem(\"search\")\n ? fetchSearchIndex()\n : NEVER\n\n/* Set up Clipboard.js integration */\nconst alert$ = new Subject()\nsetupClipboardJS({ alert$ })\n\n/* Set up progress indicator */\nconst progress$ = new Subject()\n\n/* Set up instant navigation, if enabled */\nif (feature(\"navigation.instant\"))\n setupInstantNavigation({ location$, viewport$, progress$ })\n .subscribe(document$)\n\n/* Set up version selector */\nif (config.version?.provider === \"mike\")\n setupVersionSelector({ document$ })\n\n/* Always close drawer and search on navigation */\nmerge(location$, target$)\n .pipe(\n delay(125)\n )\n .subscribe(() => {\n setToggle(\"drawer\", false)\n setToggle(\"search\", false)\n })\n\n/* Set up global keyboard handlers */\nkeyboard$\n .pipe(\n filter(({ mode }) => mode === \"global\")\n )\n .subscribe(key => {\n switch (key.type) {\n\n /* Go to previous page */\n case \"p\":\n case \",\":\n const prev = getOptionalElement(\"link[rel=prev]\")\n if (typeof prev !== \"undefined\")\n setLocation(prev)\n break\n\n /* Go to next page */\n case \"n\":\n case \".\":\n const next = getOptionalElement(\"link[rel=next]\")\n if (typeof next !== \"undefined\")\n setLocation(next)\n break\n\n /* Expand navigation, see https://bit.ly/3ZjG5io */\n case \"Enter\":\n const active = getActiveElement()\n if (active instanceof HTMLLabelElement)\n active.click()\n }\n })\n\n/* Set up patches */\npatchEllipsis({ viewport$, document$ })\npatchIndeterminate({ document$, tablet$ })\npatchScrollfix({ document$ })\npatchScrolllock({ viewport$, tablet$ })\n\n/* Set up header and main area observable */\nconst header$ = watchHeader(getComponentElement(\"header\"), { viewport$ })\nconst main$ = document$\n .pipe(\n map(() => getComponentElement(\"main\")),\n switchMap(el => watchMain(el, { viewport$, header$ })),\n shareReplay(1)\n )\n\n/* Set up control component observables */\nconst control$ = merge(\n\n /* Consent */\n ...getComponentElements(\"consent\")\n .map(el => mountConsent(el, { target$ })),\n\n /* Dialog */\n ...getComponentElements(\"dialog\")\n .map(el => mountDialog(el, { alert$ })),\n\n /* Header */\n ...getComponentElements(\"header\")\n .map(el => mountHeader(el, { viewport$, header$, main$ })),\n\n /* Color palette */\n ...getComponentElements(\"palette\")\n .map(el => mountPalette(el)),\n\n /* Progress bar */\n ...getComponentElements(\"progress\")\n .map(el => mountProgress(el, { progress$ })),\n\n /* Search */\n ...getComponentElements(\"search\")\n .map(el => mountSearch(el, { index$, keyboard$ })),\n\n /* Repository information */\n ...getComponentElements(\"source\")\n .map(el => mountSource(el))\n)\n\n/* Set up content component observables */\nconst content$ = defer(() => merge(\n\n /* Announcement bar */\n ...getComponentElements(\"announce\")\n .map(el => mountAnnounce(el)),\n\n /* Content */\n ...getComponentElements(\"content\")\n .map(el => mountContent(el, { viewport$, target$, print$ })),\n\n /* Search highlighting */\n ...getComponentElements(\"content\")\n .map(el => feature(\"search.highlight\")\n ? mountSearchHiglight(el, { index$, location$ })\n : EMPTY\n ),\n\n /* Header title */\n ...getComponentElements(\"header-title\")\n .map(el => mountHeaderTitle(el, { viewport$, header$ })),\n\n /* Sidebar */\n ...getComponentElements(\"sidebar\")\n .map(el => el.getAttribute(\"data-md-type\") === \"navigation\"\n ? at(screen$, () => mountSidebar(el, { viewport$, header$, main$ }))\n : at(tablet$, () => mountSidebar(el, { viewport$, header$, main$ }))\n ),\n\n /* Navigation tabs */\n ...getComponentElements(\"tabs\")\n .map(el => mountTabs(el, { viewport$, header$ })),\n\n /* Table of contents */\n ...getComponentElements(\"toc\")\n .map(el => mountTableOfContents(el, {\n viewport$, header$, main$, target$\n })),\n\n /* Back-to-top button */\n ...getComponentElements(\"top\")\n .map(el => mountBackToTop(el, { viewport$, header$, main$, target$ }))\n))\n\n/* Set up component observables */\nconst component$ = document$\n .pipe(\n switchMap(() => content$),\n mergeWith(control$),\n shareReplay(1)\n )\n\n/* Subscribe to all components */\ncomponent$.subscribe()\n\n/* ----------------------------------------------------------------------------\n * Exports\n * ------------------------------------------------------------------------- */\n\nwindow.document$ = document$ /* Document observable */\nwindow.location$ = location$ /* Location subject */\nwindow.target$ = target$ /* Location target observable */\nwindow.keyboard$ = keyboard$ /* Keyboard observable */\nwindow.viewport$ = viewport$ /* Viewport observable */\nwindow.tablet$ = tablet$ /* Media tablet observable */\nwindow.screen$ = screen$ /* Media screen observable */\nwindow.print$ = print$ /* Media print observable */\nwindow.alert$ = alert$ /* Alert subject */\nwindow.progress$ = progress$ /* Progress indicator subject */\nwindow.component$ = component$ /* Component observable */\n", "/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n", "/**\n * Returns true if the object is a function.\n * @param value The value to check\n */\nexport function isFunction(value: any): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n", "/**\n * Used to create Error subclasses until the community moves away from ES5.\n *\n * This is because compiling from TypeScript down to ES5 has issues with subclassing Errors\n * as well as other built-in types: https://github.com/Microsoft/TypeScript/issues/12123\n *\n * @param createImpl A factory function to create the actual constructor implementation. The returned\n * function should be a named function that calls `_super` internally.\n */\nexport function createErrorClass(createImpl: (_super: any) => any): T {\n const _super = (instance: any) => {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n\n const ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface UnsubscriptionError extends Error {\n readonly errors: any[];\n}\n\nexport interface UnsubscriptionErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (errors: any[]): UnsubscriptionError;\n}\n\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nexport const UnsubscriptionError: UnsubscriptionErrorCtor = createErrorClass(\n (_super) =>\n function UnsubscriptionErrorImpl(this: any, errors: (Error | string)[]) {\n _super(this);\n this.message = errors\n ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}`\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n }\n);\n", "/**\n * Removes an item from an array, mutating it.\n * @param arr The array to remove the item from\n * @param item The item to remove\n */\nexport function arrRemove(arr: T[] | undefined | null, item: T) {\n if (arr) {\n const index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { SubscriptionLike, TeardownLogic, Unsubscribable } from './types';\nimport { arrRemove } from './util/arrRemove';\n\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n *\n * @class Subscription\n */\nexport class Subscription implements SubscriptionLike {\n /** @nocollapse */\n public static EMPTY = (() => {\n const empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n */\n public closed = false;\n\n private _parentage: Subscription[] | Subscription | null = null;\n\n /**\n * The list of registered finalizers to execute upon unsubscription. Adding and removing from this\n * list occurs in the {@link #add} and {@link #remove} methods.\n */\n private _finalizers: Exclude[] | null = null;\n\n /**\n * @param initialTeardown A function executed first as part of the finalization\n * process that is kicked off when {@link #unsubscribe} is called.\n */\n constructor(private initialTeardown?: () => void) {}\n\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n * @return {void}\n */\n unsubscribe(): void {\n let errors: any[] | undefined;\n\n if (!this.closed) {\n this.closed = true;\n\n // Remove this from it's parents.\n const { _parentage } = this;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n for (const parent of _parentage) {\n parent.remove(this);\n }\n } else {\n _parentage.remove(this);\n }\n }\n\n const { initialTeardown: initialFinalizer } = this;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n\n const { _finalizers } = this;\n if (_finalizers) {\n this._finalizers = null;\n for (const finalizer of _finalizers) {\n try {\n execFinalizer(finalizer);\n } catch (err) {\n errors = errors ?? [];\n if (err instanceof UnsubscriptionError) {\n errors = [...errors, ...err.errors];\n } else {\n errors.push(err);\n }\n }\n }\n }\n\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n }\n\n /**\n * Adds a finalizer to this subscription, so that finalization will be unsubscribed/called\n * when this subscription is unsubscribed. If this subscription is already {@link #closed},\n * because it has already been unsubscribed, then whatever finalizer is passed to it\n * will automatically be executed (unless the finalizer itself is also a closed subscription).\n *\n * Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed\n * subscription to a any subscription will result in no operation. (A noop).\n *\n * Adding a subscription to itself, or adding `null` or `undefined` will not perform any\n * operation at all. (A noop).\n *\n * `Subscription` instances that are added to this instance will automatically remove themselves\n * if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove\n * will need to be removed manually with {@link #remove}\n *\n * @param teardown The finalization logic to add to this subscription.\n */\n add(teardown: TeardownLogic): void {\n // Only add the finalizer if it's not undefined\n // and don't add a subscription to itself.\n if (teardown && teardown !== this) {\n if (this.closed) {\n // If this subscription is already closed,\n // execute whatever finalizer is handed to it automatically.\n execFinalizer(teardown);\n } else {\n if (teardown instanceof Subscription) {\n // We don't add closed subscriptions, and we don't add the same subscription\n // twice. Subscription unsubscribe is idempotent.\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = this._finalizers ?? []).push(teardown);\n }\n }\n }\n\n /**\n * Checks to see if a this subscription already has a particular parent.\n * This will signal that this subscription has already been added to the parent in question.\n * @param parent the parent to check for\n */\n private _hasParent(parent: Subscription) {\n const { _parentage } = this;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n }\n\n /**\n * Adds a parent to this subscription so it can be removed from the parent if it\n * unsubscribes on it's own.\n *\n * NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.\n * @param parent The parent subscription to add\n */\n private _addParent(parent: Subscription) {\n const { _parentage } = this;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n }\n\n /**\n * Called on a child when it is removed via {@link #remove}.\n * @param parent The parent to remove\n */\n private _removeParent(parent: Subscription) {\n const { _parentage } = this;\n if (_parentage === parent) {\n this._parentage = null;\n } else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n }\n\n /**\n * Removes a finalizer from this subscription that was previously added with the {@link #add} method.\n *\n * Note that `Subscription` instances, when unsubscribed, will automatically remove themselves\n * from every other `Subscription` they have been added to. This means that using the `remove` method\n * is not a common thing and should be used thoughtfully.\n *\n * If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance\n * more than once, you will need to call `remove` the same number of times to remove all instances.\n *\n * All finalizer instances are removed to free up memory upon unsubscription.\n *\n * @param teardown The finalizer to remove from this subscription\n */\n remove(teardown: Exclude): void {\n const { _finalizers } = this;\n _finalizers && arrRemove(_finalizers, teardown);\n\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n }\n}\n\nexport const EMPTY_SUBSCRIPTION = Subscription.EMPTY;\n\nexport function isSubscription(value: any): value is Subscription {\n return (\n value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe))\n );\n}\n\nfunction execFinalizer(finalizer: Unsubscribable | (() => void)) {\n if (isFunction(finalizer)) {\n finalizer();\n } else {\n finalizer.unsubscribe();\n }\n}\n", "import { Subscriber } from './Subscriber';\nimport { ObservableNotification } from './types';\n\n/**\n * The {@link GlobalConfig} object for RxJS. It is used to configure things\n * like how to react on unhandled errors.\n */\nexport const config: GlobalConfig = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n\n/**\n * The global configuration object for RxJS, used to configure things\n * like how to react on unhandled errors. Accessible via {@link config}\n * object.\n */\nexport interface GlobalConfig {\n /**\n * A registration point for unhandled errors from RxJS. These are errors that\n * cannot were not handled by consuming code in the usual subscription path. For\n * example, if you have this configured, and you subscribe to an observable without\n * providing an error handler, errors from that subscription will end up here. This\n * will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onUnhandledError: ((err: any) => void) | null;\n\n /**\n * A registration point for notifications that cannot be sent to subscribers because they\n * have completed, errored or have been explicitly unsubscribed. By default, next, complete\n * and error notifications sent to stopped subscribers are noops. However, sometimes callers\n * might want a different behavior. For example, with sources that attempt to report errors\n * to stopped subscribers, a caller can configure RxJS to throw an unhandled error instead.\n * This will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onStoppedNotification: ((notification: ObservableNotification, subscriber: Subscriber) => void) | null;\n\n /**\n * The promise constructor used by default for {@link Observable#toPromise toPromise} and {@link Observable#forEach forEach}\n * methods.\n *\n * @deprecated As of version 8, RxJS will no longer support this sort of injection of a\n * Promise constructor. If you need a Promise implementation other than native promises,\n * please polyfill/patch Promise as you see appropriate. Will be removed in v8.\n */\n Promise?: PromiseConstructorLike;\n\n /**\n * If true, turns on synchronous error rethrowing, which is a deprecated behavior\n * in v6 and higher. This behavior enables bad patterns like wrapping a subscribe\n * call in a try/catch block. It also enables producer interference, a nasty bug\n * where a multicast can be broken for all observers by a downstream consumer with\n * an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BUY TIME\n * FOR MIGRATION REASONS.\n *\n * @deprecated As of version 8, RxJS will no longer support synchronous throwing\n * of unhandled errors. All errors will be thrown on a separate call stack to prevent bad\n * behaviors described above. Will be removed in v8.\n */\n useDeprecatedSynchronousErrorHandling: boolean;\n\n /**\n * If true, enables an as-of-yet undocumented feature from v5: The ability to access\n * `unsubscribe()` via `this` context in `next` functions created in observers passed\n * to `subscribe`.\n *\n * This is being removed because the performance was severely problematic, and it could also cause\n * issues when types other than POJOs are passed to subscribe as subscribers, as they will likely have\n * their `this` context overwritten.\n *\n * @deprecated As of version 8, RxJS will no longer support altering the\n * context of next functions provided as part of an observer to Subscribe. Instead,\n * you will have access to a subscription or a signal or token that will allow you to do things like\n * unsubscribe and test closed status. Will be removed in v8.\n */\n useDeprecatedNextContext: boolean;\n}\n", "import type { TimerHandle } from './timerHandle';\ntype SetTimeoutFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearTimeoutFunction = (handle: TimerHandle) => void;\n\ninterface TimeoutProvider {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n delegate:\n | {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n }\n | undefined;\n}\n\nexport const timeoutProvider: TimeoutProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setTimeout(handler: () => void, timeout?: number, ...args) {\n const { delegate } = timeoutProvider;\n if (delegate?.setTimeout) {\n return delegate.setTimeout(handler, timeout, ...args);\n }\n return setTimeout(handler, timeout, ...args);\n },\n clearTimeout(handle) {\n const { delegate } = timeoutProvider;\n return (delegate?.clearTimeout || clearTimeout)(handle as any);\n },\n delegate: undefined,\n};\n", "import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\n\n/**\n * Handles an error on another job either with the user-configured {@link onUnhandledError},\n * or by throwing it on that new job so it can be picked up by `window.onerror`, `process.on('error')`, etc.\n *\n * This should be called whenever there is an error that is out-of-band with the subscription\n * or when an error hits a terminal boundary of the subscription and no error handler was provided.\n *\n * @param err the error to report\n */\nexport function reportUnhandledError(err: any) {\n timeoutProvider.setTimeout(() => {\n const { onUnhandledError } = config;\n if (onUnhandledError) {\n // Execute the user-configured error handler.\n onUnhandledError(err);\n } else {\n // Throw so it is picked up by the runtime's uncaught error mechanism.\n throw err;\n }\n });\n}\n", "/* tslint:disable:no-empty */\nexport function noop() { }\n", "import { CompleteNotification, NextNotification, ErrorNotification } from './types';\n\n/**\n * A completion object optimized for memory use and created to be the\n * same \"shape\" as other notifications in v8.\n * @internal\n */\nexport const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined) as CompleteNotification)();\n\n/**\n * Internal use only. Creates an optimized error notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function errorNotification(error: any): ErrorNotification {\n return createNotification('E', undefined, error) as any;\n}\n\n/**\n * Internal use only. Creates an optimized next notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function nextNotification(value: T) {\n return createNotification('N', value, undefined) as NextNotification;\n}\n\n/**\n * Ensures that all notifications created internally have the same \"shape\" in v8.\n *\n * TODO: This is only exported to support a crazy legacy test in `groupBy`.\n * @internal\n */\nexport function createNotification(kind: 'N' | 'E' | 'C', value: any, error: any) {\n return {\n kind,\n value,\n error,\n };\n}\n", "import { config } from '../config';\n\nlet context: { errorThrown: boolean; error: any } | null = null;\n\n/**\n * Handles dealing with errors for super-gross mode. Creates a context, in which\n * any synchronously thrown errors will be passed to {@link captureError}. Which\n * will record the error such that it will be rethrown after the call back is complete.\n * TODO: Remove in v8\n * @param cb An immediately executed function.\n */\nexport function errorContext(cb: () => void) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n const isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n const { errorThrown, error } = context!;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n } else {\n // This is the general non-deprecated path for everyone that\n // isn't crazy enough to use super-gross mode (useDeprecatedSynchronousErrorHandling)\n cb();\n }\n}\n\n/**\n * Captures errors only in super-gross mode.\n * @param err the error to capture\n */\nexport function captureError(err: any) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { Observer, ObservableNotification } from './types';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\n\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n *\n * @class Subscriber\n */\nexport class Subscriber extends Subscription implements Observer {\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param next The `next` callback of an Observer.\n * @param error The `error` callback of an\n * Observer.\n * @param complete The `complete` callback of an\n * Observer.\n * @return A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n * @nocollapse\n * @deprecated Do not use. Will be removed in v8. There is no replacement for this\n * method, and there is no reason to be creating instances of `Subscriber` directly.\n * If you have a specific use case, please file an issue.\n */\n static create(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber {\n return new SafeSubscriber(next, error, complete);\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected isStopped: boolean = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected destination: Subscriber | Observer; // this `any` is the escape hatch to erase extra type param (e.g. R)\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.\n */\n constructor(destination?: Subscriber | Observer) {\n super();\n if (destination) {\n this.destination = destination;\n // Automatically chain subscriptions together here.\n // if destination is a Subscription, then it is a Subscriber.\n if (isSubscription(destination)) {\n destination.add(this);\n }\n } else {\n this.destination = EMPTY_OBSERVER;\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param {T} [value] The `next` value.\n * @return {void}\n */\n next(value?: T): void {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n } else {\n this._next(value!);\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached `Error`. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param {any} [err] The `error` exception.\n * @return {void}\n */\n error(err?: any): void {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n } else {\n this.isStopped = true;\n this._error(err);\n }\n }\n\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n * @return {void}\n */\n complete(): void {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n } else {\n this.isStopped = true;\n this._complete();\n }\n }\n\n unsubscribe(): void {\n if (!this.closed) {\n this.isStopped = true;\n super.unsubscribe();\n this.destination = null!;\n }\n }\n\n protected _next(value: T): void {\n this.destination.next(value);\n }\n\n protected _error(err: any): void {\n try {\n this.destination.error(err);\n } finally {\n this.unsubscribe();\n }\n }\n\n protected _complete(): void {\n try {\n this.destination.complete();\n } finally {\n this.unsubscribe();\n }\n }\n}\n\n/**\n * This bind is captured here because we want to be able to have\n * compatibility with monoid libraries that tend to use a method named\n * `bind`. In particular, a library called Monio requires this.\n */\nconst _bind = Function.prototype.bind;\n\nfunction bind any>(fn: Fn, thisArg: any): Fn {\n return _bind.call(fn, thisArg);\n}\n\n/**\n * Internal optimization only, DO NOT EXPOSE.\n * @internal\n */\nclass ConsumerObserver implements Observer {\n constructor(private partialObserver: Partial>) {}\n\n next(value: T): void {\n const { partialObserver } = this;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n\n error(err: any): void {\n const { partialObserver } = this;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n } catch (error) {\n handleUnhandledError(error);\n }\n } else {\n handleUnhandledError(err);\n }\n }\n\n complete(): void {\n const { partialObserver } = this;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n}\n\nexport class SafeSubscriber extends Subscriber {\n constructor(\n observerOrNext?: Partial> | ((value: T) => void) | null,\n error?: ((e?: any) => void) | null,\n complete?: (() => void) | null\n ) {\n super();\n\n let partialObserver: Partial>;\n if (isFunction(observerOrNext) || !observerOrNext) {\n // The first argument is a function, not an observer. The next\n // two arguments *could* be observers, or they could be empty.\n partialObserver = {\n next: (observerOrNext ?? undefined) as (((value: T) => void) | undefined),\n error: error ?? undefined,\n complete: complete ?? undefined,\n };\n } else {\n // The first argument is a partial observer.\n let context: any;\n if (this && config.useDeprecatedNextContext) {\n // This is a deprecated path that made `this.unsubscribe()` available in\n // next handler functions passed to subscribe. This only exists behind a flag\n // now, as it is *very* slow.\n context = Object.create(observerOrNext);\n context.unsubscribe = () => this.unsubscribe();\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context),\n error: observerOrNext.error && bind(observerOrNext.error, context),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context),\n };\n } else {\n // The \"normal\" path. Just use the partial observer directly.\n partialObserver = observerOrNext;\n }\n }\n\n // Wrap the partial observer to ensure it's a full observer, and\n // make sure proper error handling is accounted for.\n this.destination = new ConsumerObserver(partialObserver);\n }\n}\n\nfunction handleUnhandledError(error: any) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n } else {\n // Ideal path, we report this as an unhandled error,\n // which is thrown on a new call stack.\n reportUnhandledError(error);\n }\n}\n\n/**\n * An error handler used when no error handler was supplied\n * to the SafeSubscriber -- meaning no error handler was supplied\n * do the `subscribe` call on our observable.\n * @param err The error to handle\n */\nfunction defaultErrorHandler(err: any) {\n throw err;\n}\n\n/**\n * A handler for notifications that cannot be sent to a stopped subscriber.\n * @param notification The notification being sent\n * @param subscriber The stopped subscriber\n */\nfunction handleStoppedNotification(notification: ObservableNotification, subscriber: Subscriber) {\n const { onStoppedNotification } = config;\n onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));\n}\n\n/**\n * The observer used as a stub for subscriptions where the user did not\n * pass any arguments to `subscribe`. Comes with the default error handling\n * behavior.\n */\nexport const EMPTY_OBSERVER: Readonly> & { closed: true } = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n", "/**\n * Symbol.observable or a string \"@@observable\". Used for interop\n *\n * @deprecated We will no longer be exporting this symbol in upcoming versions of RxJS.\n * Instead polyfill and use Symbol.observable directly *or* use https://www.npmjs.com/package/symbol-observable\n */\nexport const observable: string | symbol = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();\n", "/**\n * This function takes one parameter and just returns it. Simply put,\n * this is like `(x: T): T => x`.\n *\n * ## Examples\n *\n * This is useful in some cases when using things like `mergeMap`\n *\n * ```ts\n * import { interval, take, map, range, mergeMap, identity } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(5));\n *\n * const result$ = source$.pipe(\n * map(i => range(i)),\n * mergeMap(identity) // same as mergeMap(x => x)\n * );\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * Or when you want to selectively apply an operator\n *\n * ```ts\n * import { interval, take, identity } from 'rxjs';\n *\n * const shouldLimit = () => Math.random() < 0.5;\n *\n * const source$ = interval(1000);\n *\n * const result$ = source$.pipe(shouldLimit() ? take(5) : identity);\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * @param x Any value that is returned by this function\n * @returns The value passed as the first parameter to this function\n */\nexport function identity(x: T): T {\n return x;\n}\n", "import { identity } from './identity';\nimport { UnaryFunction } from '../types';\n\nexport function pipe(): typeof identity;\nexport function pipe(fn1: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction, fn3: UnaryFunction): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction,\n fn8: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction,\n fn8: UnaryFunction,\n fn9: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction,\n fn8: UnaryFunction,\n fn9: UnaryFunction,\n ...fns: UnaryFunction[]\n): UnaryFunction;\n\n/**\n * pipe() can be called on one or more functions, each of which can take one argument (\"UnaryFunction\")\n * and uses it to return a value.\n * It returns a function that takes one argument, passes it to the first UnaryFunction, and then\n * passes the result to the next one, passes that result to the next one, and so on. \n */\nexport function pipe(...fns: Array>): UnaryFunction {\n return pipeFromArray(fns);\n}\n\n/** @internal */\nexport function pipeFromArray(fns: Array>): UnaryFunction {\n if (fns.length === 0) {\n return identity as UnaryFunction;\n }\n\n if (fns.length === 1) {\n return fns[0];\n }\n\n return function piped(input: T): R {\n return fns.reduce((prev: any, fn: UnaryFunction) => fn(prev), input as any);\n };\n}\n", "import { Operator } from './Operator';\nimport { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription, Subscription } from './Subscription';\nimport { TeardownLogic, OperatorFunction, Subscribable, Observer } from './types';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n *\n * @class Observable\n */\nexport class Observable implements Subscribable {\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n source: Observable | undefined;\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n operator: Operator | undefined;\n\n /**\n * @constructor\n * @param {Function} subscribe the function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n constructor(subscribe?: (this: Observable, subscriber: Subscriber) => TeardownLogic) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new Observable by calling the Observable constructor\n * @owner Observable\n * @method create\n * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor\n * @return {Observable} a new observable\n * @nocollapse\n * @deprecated Use `new Observable()` instead. Will be removed in v8.\n */\n static create: (...args: any[]) => any = (subscribe?: (subscriber: Subscriber) => TeardownLogic) => {\n return new Observable(subscribe);\n };\n\n /**\n * Creates a new Observable, with this Observable instance as the source, and the passed\n * operator defined as the new observable's operator.\n * @method lift\n * @param operator the operator defining the operation to take on the observable\n * @return a new observable with the Operator applied\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * If you have implemented an operator using `lift`, it is recommended that you create an\n * operator by simply returning `new Observable()` directly. See \"Creating new operators from\n * scratch\" section here: https://rxjs.dev/guide/operators\n */\n lift(operator?: Operator): Observable {\n const observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n\n subscribe(observerOrNext?: Partial> | ((value: T) => void)): Subscription;\n /** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */\n subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription;\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * Use it when you have all these Observables, but still nothing is happening.\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to Observable's constructor, but most of the time it is\n * a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means\n * that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * the thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * of the following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens,\n * it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead,\n * use the {@link onUnhandledError} configuration option or use a runtime handler (like `window.onerror` or\n * `process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide\n * an `error` method to avoid missing thrown errors.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent\n * of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer,\n * if you do not need to listen for something, you can omit a function by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously.\n *\n * You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events\n * and you also handled emissions internally by using operators (e.g. using `tap`).\n *\n * Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a `scheduler`.\n *\n * #### Examples\n *\n * Subscribe with an {@link guide/observer Observer}\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() {\n * // We actually could just remove this method,\n * // since we do not really care about errors right now.\n * },\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Subscribe with functions ({@link deprecations/subscribe-arguments deprecated})\n *\n * ```ts\n * import { of } from 'rxjs'\n *\n * let sum = 0;\n *\n * of(1, 2, 3).subscribe(\n * value => {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * () => console.log('Sum equals: ' + sum)\n * );\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Cancel a subscription\n *\n * ```ts\n * import { interval } from 'rxjs';\n *\n * const subscription = interval(1000).subscribe({\n * next(num) {\n * console.log(num)\n * },\n * complete() {\n * // Will not be called, even when cancelling subscription.\n * console.log('completed!');\n * }\n * });\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 'unsubscribed!' after 2.5s\n * ```\n *\n * @param {Observer|Function} observerOrNext (optional) Either an observer with methods to be called,\n * or the first of three possible handlers, which is the handler for each value emitted from the subscribed\n * Observable.\n * @param {Function} error (optional) A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown asynchronously as unhandled.\n * @param {Function} complete (optional) A handler for a terminal event resulting from successful completion.\n * @return {Subscription} a subscription reference to the registered handlers\n * @method subscribe\n */\n subscribe(\n observerOrNext?: Partial> | ((value: T) => void) | null,\n error?: ((error: any) => void) | null,\n complete?: (() => void) | null\n ): Subscription {\n const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n\n errorContext(() => {\n const { operator, source } = this;\n subscriber.add(\n operator\n ? // We're dealing with a subscription in the\n // operator chain to one of our lifted operators.\n operator.call(subscriber, source)\n : source\n ? // If `source` has a value, but `operator` does not, something that\n // had intimate knowledge of our API, like our `Subject`, must have\n // set it. We're going to just call `_subscribe` directly.\n this._subscribe(subscriber)\n : // In all other cases, we're likely wrapping a user-provided initializer\n // function, so we need to catch errors and handle them appropriately.\n this._trySubscribe(subscriber)\n );\n });\n\n return subscriber;\n }\n\n /** @internal */\n protected _trySubscribe(sink: Subscriber): TeardownLogic {\n try {\n return this._subscribe(sink);\n } catch (err) {\n // We don't need to return anything in this case,\n // because it's just going to try to `add()` to a subscription\n // above.\n sink.error(err);\n }\n }\n\n /**\n * Used as a NON-CANCELLABLE means of subscribing to an observable, for use with\n * APIs that expect promises, like `async/await`. You cannot unsubscribe from this.\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * #### Example\n *\n * ```ts\n * import { interval, take } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(4));\n *\n * async function getTotal() {\n * let total = 0;\n *\n * await source$.forEach(value => {\n * total += value;\n * console.log('observable -> ' + value);\n * });\n *\n * return total;\n * }\n *\n * getTotal().then(\n * total => console.log('Total: ' + total)\n * );\n *\n * // Expected:\n * // 'observable -> 0'\n * // 'observable -> 1'\n * // 'observable -> 2'\n * // 'observable -> 3'\n * // 'Total: 6'\n * ```\n *\n * @param next a handler for each value emitted by the observable\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n */\n forEach(next: (value: T) => void): Promise;\n\n /**\n * @param next a handler for each value emitted by the observable\n * @param promiseCtor a constructor function used to instantiate the Promise\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n * @deprecated Passing a Promise constructor will no longer be available\n * in upcoming versions of RxJS. This is because it adds weight to the library, for very\n * little benefit. If you need this functionality, it is recommended that you either\n * polyfill Promise, or you create an adapter to convert the returned native promise\n * to whatever promise implementation you wanted. Will be removed in v8.\n */\n forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise;\n\n forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n const subscriber = new SafeSubscriber({\n next: (value) => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n this.subscribe(subscriber);\n }) as Promise;\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): TeardownLogic {\n return this.source?.subscribe(subscriber);\n }\n\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @method Symbol.observable\n * @return {Observable} this instance of the observable\n */\n [Symbol_observable]() {\n return this;\n }\n\n /* tslint:disable:max-line-length */\n pipe(): Observable;\n pipe(op1: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction, op3: OperatorFunction): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction,\n op8: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction,\n op8: OperatorFunction,\n op9: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction,\n op8: OperatorFunction,\n op9: OperatorFunction,\n ...operations: OperatorFunction[]\n ): Observable;\n /* tslint:enable:max-line-length */\n\n /**\n * Used to stitch together functional operators into a chain.\n * @method pipe\n * @return {Observable} the Observable result of all of the operators having\n * been called in the order they were passed in.\n *\n * ## Example\n *\n * ```ts\n * import { interval, filter, map, scan } from 'rxjs';\n *\n * interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x));\n * ```\n */\n pipe(...operations: OperatorFunction[]): Observable {\n return pipeFromArray(operations)(this);\n }\n\n /* tslint:disable:max-line-length */\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(): Promise;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: typeof Promise): Promise;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: PromiseConstructorLike): Promise;\n /* tslint:enable:max-line-length */\n\n /**\n * Subscribe to this Observable and get a Promise resolving on\n * `complete` with the last emission (if any).\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * @method toPromise\n * @param [promiseCtor] a constructor function used to instantiate\n * the Promise\n * @return A Promise that resolves with the last value emit, or\n * rejects on an error. If there were no emissions, Promise\n * resolves with undefined.\n * @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise\n */\n toPromise(promiseCtor?: PromiseConstructorLike): Promise {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n let value: T | undefined;\n this.subscribe(\n (x: T) => (value = x),\n (err: any) => reject(err),\n () => resolve(value)\n );\n }) as Promise;\n }\n}\n\n/**\n * Decides between a passed promise constructor from consuming code,\n * A default configured promise constructor, and the native promise\n * constructor and returns it. If nothing can be found, it will throw\n * an error.\n * @param promiseCtor The optional promise constructor to passed by consuming code\n */\nfunction getPromiseCtor(promiseCtor: PromiseConstructorLike | undefined) {\n return promiseCtor ?? config.Promise ?? Promise;\n}\n\nfunction isObserver(value: any): value is Observer {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\n\nfunction isSubscriber(value: any): value is Subscriber {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n", "import { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction } from '../types';\nimport { isFunction } from './isFunction';\n\n/**\n * Used to determine if an object is an Observable with a lift function.\n */\nexport function hasLift(source: any): source is { lift: InstanceType['lift'] } {\n return isFunction(source?.lift);\n}\n\n/**\n * Creates an `OperatorFunction`. Used to define operators throughout the library in a concise way.\n * @param init The logic to connect the liftedSource to the subscriber at the moment of subscription.\n */\nexport function operate(\n init: (liftedSource: Observable, subscriber: Subscriber) => (() => void) | void\n): OperatorFunction {\n return (source: Observable) => {\n if (hasLift(source)) {\n return source.lift(function (this: Subscriber, liftedSource: Observable) {\n try {\n return init(liftedSource, this);\n } catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n", "import { Subscriber } from '../Subscriber';\n\n/**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional teardown logic here. This will only be called on teardown if the\n * subscriber itself is not already closed. This is called after all other teardown logic is executed.\n */\nexport function createOperatorSubscriber(\n destination: Subscriber,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n onFinalize?: () => void\n): Subscriber {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\n\n/**\n * A generic helper for allowing operators to be created with a Subscriber and\n * use closures to capture necessary state from the operator function itself.\n */\nexport class OperatorSubscriber extends Subscriber {\n /**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional finalization logic here. This will only be called on finalization if the\n * subscriber itself is not already closed. This is called after all other finalization logic is executed.\n * @param shouldUnsubscribe An optional check to see if an unsubscribe call should truly unsubscribe.\n * NOTE: This currently **ONLY** exists to support the strange behavior of {@link groupBy}, where unsubscription\n * to the resulting observable does not actually disconnect from the source if there are active subscriptions\n * to any grouped observable. (DO NOT EXPOSE OR USE EXTERNALLY!!!)\n */\n constructor(\n destination: Subscriber,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n private onFinalize?: () => void,\n private shouldUnsubscribe?: () => boolean\n ) {\n // It's important - for performance reasons - that all of this class's\n // members are initialized and that they are always initialized in the same\n // order. This will ensure that all OperatorSubscriber instances have the\n // same hidden class in V8. This, in turn, will help keep the number of\n // hidden classes involved in property accesses within the base class as\n // low as possible. If the number of hidden classes involved exceeds four,\n // the property accesses will become megamorphic and performance penalties\n // will be incurred - i.e. inline caches won't be used.\n //\n // The reasons for ensuring all instances have the same hidden class are\n // further discussed in this blog post from Benedikt Meurer:\n // https://benediktmeurer.de/2018/03/23/impact-of-polymorphism-on-component-based-frameworks-like-react/\n super(destination);\n this._next = onNext\n ? function (this: OperatorSubscriber, value: T) {\n try {\n onNext(value);\n } catch (err) {\n destination.error(err);\n }\n }\n : super._next;\n this._error = onError\n ? function (this: OperatorSubscriber, err: any) {\n try {\n onError(err);\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._error;\n this._complete = onComplete\n ? function (this: OperatorSubscriber) {\n try {\n onComplete();\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._complete;\n }\n\n unsubscribe() {\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n const { closed } = this;\n super.unsubscribe();\n // Execute additional teardown if we have any and we didn't already do so.\n !closed && this.onFinalize?.();\n }\n }\n}\n", "import { Subscription } from '../Subscription';\n\ninterface AnimationFrameProvider {\n schedule(callback: FrameRequestCallback): Subscription;\n requestAnimationFrame: typeof requestAnimationFrame;\n cancelAnimationFrame: typeof cancelAnimationFrame;\n delegate:\n | {\n requestAnimationFrame: typeof requestAnimationFrame;\n cancelAnimationFrame: typeof cancelAnimationFrame;\n }\n | undefined;\n}\n\nexport const animationFrameProvider: AnimationFrameProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n schedule(callback) {\n let request = requestAnimationFrame;\n let cancel: typeof cancelAnimationFrame | undefined = cancelAnimationFrame;\n const { delegate } = animationFrameProvider;\n if (delegate) {\n request = delegate.requestAnimationFrame;\n cancel = delegate.cancelAnimationFrame;\n }\n const handle = request((timestamp) => {\n // Clear the cancel function. The request has been fulfilled, so\n // attempting to cancel the request upon unsubscription would be\n // pointless.\n cancel = undefined;\n callback(timestamp);\n });\n return new Subscription(() => cancel?.(handle));\n },\n requestAnimationFrame(...args) {\n const { delegate } = animationFrameProvider;\n return (delegate?.requestAnimationFrame || requestAnimationFrame)(...args);\n },\n cancelAnimationFrame(...args) {\n const { delegate } = animationFrameProvider;\n return (delegate?.cancelAnimationFrame || cancelAnimationFrame)(...args);\n },\n delegate: undefined,\n};\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface ObjectUnsubscribedError extends Error {}\n\nexport interface ObjectUnsubscribedErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (): ObjectUnsubscribedError;\n}\n\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nexport const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = createErrorClass(\n (_super) =>\n function ObjectUnsubscribedErrorImpl(this: any) {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n }\n);\n", "import { Operator } from './Operator';\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { Observer, SubscriptionLike, TeardownLogic } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A Subject is a special type of Observable that allows values to be\n * multicasted to many Observers. Subjects are like EventEmitters.\n *\n * Every Subject is an Observable and an Observer. You can subscribe to a\n * Subject, and you can call next to feed values as well as error and complete.\n */\nexport class Subject extends Observable implements SubscriptionLike {\n closed = false;\n\n private currentObservers: Observer[] | null = null;\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n observers: Observer[] = [];\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n isStopped = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n hasError = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n thrownError: any = null;\n\n /**\n * Creates a \"subject\" by basically gluing an observer to an observable.\n *\n * @nocollapse\n * @deprecated Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.\n */\n static create: (...args: any[]) => any = (destination: Observer, source: Observable): AnonymousSubject => {\n return new AnonymousSubject(destination, source);\n };\n\n constructor() {\n // NOTE: This must be here to obscure Observable's constructor.\n super();\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n lift(operator: Operator): Observable {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator as any;\n return subject as any;\n }\n\n /** @internal */\n protected _throwIfClosed() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n }\n\n next(value: T) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n if (!this.currentObservers) {\n this.currentObservers = Array.from(this.observers);\n }\n for (const observer of this.currentObservers) {\n observer.next(value);\n }\n }\n });\n }\n\n error(err: any) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.hasError = this.isStopped = true;\n this.thrownError = err;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.error(err);\n }\n }\n });\n }\n\n complete() {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.isStopped = true;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.complete();\n }\n }\n });\n }\n\n unsubscribe() {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null!;\n }\n\n get observed() {\n return this.observers?.length > 0;\n }\n\n /** @internal */\n protected _trySubscribe(subscriber: Subscriber): TeardownLogic {\n this._throwIfClosed();\n return super._trySubscribe(subscriber);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n }\n\n /** @internal */\n protected _innerSubscribe(subscriber: Subscriber) {\n const { hasError, isStopped, observers } = this;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(() => {\n this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n }\n\n /** @internal */\n protected _checkFinalizedStatuses(subscriber: Subscriber) {\n const { hasError, thrownError, isStopped } = this;\n if (hasError) {\n subscriber.error(thrownError);\n } else if (isStopped) {\n subscriber.complete();\n }\n }\n\n /**\n * Creates a new Observable with this Subject as the source. You can do this\n * to create custom Observer-side logic of the Subject and conceal it from\n * code that uses the Observable.\n * @return {Observable} Observable that the Subject casts to\n */\n asObservable(): Observable {\n const observable: any = new Observable();\n observable.source = this;\n return observable;\n }\n}\n\n/**\n * @class AnonymousSubject\n */\nexport class AnonymousSubject extends Subject {\n constructor(\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n public destination?: Observer,\n source?: Observable\n ) {\n super();\n this.source = source;\n }\n\n next(value: T) {\n this.destination?.next?.(value);\n }\n\n error(err: any) {\n this.destination?.error?.(err);\n }\n\n complete() {\n this.destination?.complete?.();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n return this.source?.subscribe(subscriber) ?? EMPTY_SUBSCRIPTION;\n }\n}\n", "import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\n\n/**\n * A variant of Subject that requires an initial value and emits its current\n * value whenever it is subscribed to.\n *\n * @class BehaviorSubject\n */\nexport class BehaviorSubject extends Subject {\n constructor(private _value: T) {\n super();\n }\n\n get value(): T {\n return this.getValue();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n const subscription = super._subscribe(subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n }\n\n getValue(): T {\n const { hasError, thrownError, _value } = this;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n }\n\n next(value: T): void {\n super.next((this._value = value));\n }\n}\n", "import { TimestampProvider } from '../types';\n\ninterface DateTimestampProvider extends TimestampProvider {\n delegate: TimestampProvider | undefined;\n}\n\nexport const dateTimestampProvider: DateTimestampProvider = {\n now() {\n // Use the variable rather than `this` so that the function can be called\n // without being bound to the provider.\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n", "import { Subject } from './Subject';\nimport { TimestampProvider } from './types';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\n\n/**\n * A variant of {@link Subject} that \"replays\" old values to new subscribers by emitting them when they first subscribe.\n *\n * `ReplaySubject` has an internal buffer that will store a specified number of values that it has observed. Like `Subject`,\n * `ReplaySubject` \"observes\" values by having them passed to its `next` method. When it observes a value, it will store that\n * value for a time determined by the configuration of the `ReplaySubject`, as passed to its constructor.\n *\n * When a new subscriber subscribes to the `ReplaySubject` instance, it will synchronously emit all values in its buffer in\n * a First-In-First-Out (FIFO) manner. The `ReplaySubject` will also complete, if it has observed completion; and it will\n * error if it has observed an error.\n *\n * There are two main configuration items to be concerned with:\n *\n * 1. `bufferSize` - This will determine how many items are stored in the buffer, defaults to infinite.\n * 2. `windowTime` - The amount of time to hold a value in the buffer before removing it from the buffer.\n *\n * Both configurations may exist simultaneously. So if you would like to buffer a maximum of 3 values, as long as the values\n * are less than 2 seconds old, you could do so with a `new ReplaySubject(3, 2000)`.\n *\n * ### Differences with BehaviorSubject\n *\n * `BehaviorSubject` is similar to `new ReplaySubject(1)`, with a couple of exceptions:\n *\n * 1. `BehaviorSubject` comes \"primed\" with a single value upon construction.\n * 2. `ReplaySubject` will replay values, even after observing an error, where `BehaviorSubject` will not.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n * @see {@link shareReplay}\n */\nexport class ReplaySubject extends Subject {\n private _buffer: (T | number)[] = [];\n private _infiniteTimeWindow = true;\n\n /**\n * @param bufferSize The size of the buffer to replay on subscription\n * @param windowTime The amount of time the buffered items will stay buffered\n * @param timestampProvider An object with a `now()` method that provides the current timestamp. This is used to\n * calculate the amount of time something has been buffered.\n */\n constructor(\n private _bufferSize = Infinity,\n private _windowTime = Infinity,\n private _timestampProvider: TimestampProvider = dateTimestampProvider\n ) {\n super();\n this._infiniteTimeWindow = _windowTime === Infinity;\n this._bufferSize = Math.max(1, _bufferSize);\n this._windowTime = Math.max(1, _windowTime);\n }\n\n next(value: T): void {\n const { isStopped, _buffer, _infiniteTimeWindow, _timestampProvider, _windowTime } = this;\n if (!isStopped) {\n _buffer.push(value);\n !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);\n }\n this._trimBuffer();\n super.next(value);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n this._throwIfClosed();\n this._trimBuffer();\n\n const subscription = this._innerSubscribe(subscriber);\n\n const { _infiniteTimeWindow, _buffer } = this;\n // We use a copy here, so reentrant code does not mutate our array while we're\n // emitting it to a new subscriber.\n const copy = _buffer.slice();\n for (let i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {\n subscriber.next(copy[i] as T);\n }\n\n this._checkFinalizedStatuses(subscriber);\n\n return subscription;\n }\n\n private _trimBuffer() {\n const { _bufferSize, _timestampProvider, _buffer, _infiniteTimeWindow } = this;\n // If we don't have an infinite buffer size, and we're over the length,\n // use splice to truncate the old buffer values off. Note that we have to\n // double the size for instances where we're not using an infinite time window\n // because we're storing the values and the timestamps in the same array.\n const adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;\n _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);\n\n // Now, if we're not in an infinite time window, remove all values where the time is\n // older than what is allowed.\n if (!_infiniteTimeWindow) {\n const now = _timestampProvider.now();\n let last = 0;\n // Search the array for the first timestamp that isn't expired and\n // truncate the buffer up to that point.\n for (let i = 1; i < _buffer.length && (_buffer[i] as number) <= now; i += 2) {\n last = i;\n }\n last && _buffer.splice(0, last + 1);\n }\n }\n}\n", "import { Scheduler } from '../Scheduler';\nimport { Subscription } from '../Subscription';\nimport { SchedulerAction } from '../types';\n\n/**\n * A unit of work to be executed in a `scheduler`. An action is typically\n * created from within a {@link SchedulerLike} and an RxJS user does not need to concern\n * themselves about creating and manipulating an Action.\n *\n * ```ts\n * class Action extends Subscription {\n * new (scheduler: Scheduler, work: (state?: T) => void);\n * schedule(state?: T, delay: number = 0): Subscription;\n * }\n * ```\n *\n * @class Action\n */\nexport class Action extends Subscription {\n constructor(scheduler: Scheduler, work: (this: SchedulerAction, state?: T) => void) {\n super();\n }\n /**\n * Schedules this action on its parent {@link SchedulerLike} for execution. May be passed\n * some context object, `state`. May happen at some point in the future,\n * according to the `delay` parameter, if specified.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler.\n * @return {void}\n */\n public schedule(state?: T, delay: number = 0): Subscription {\n return this;\n }\n}\n", "import type { TimerHandle } from './timerHandle';\ntype SetIntervalFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearIntervalFunction = (handle: TimerHandle) => void;\n\ninterface IntervalProvider {\n setInterval: SetIntervalFunction;\n clearInterval: ClearIntervalFunction;\n delegate:\n | {\n setInterval: SetIntervalFunction;\n clearInterval: ClearIntervalFunction;\n }\n | undefined;\n}\n\nexport const intervalProvider: IntervalProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setInterval(handler: () => void, timeout?: number, ...args) {\n const { delegate } = intervalProvider;\n if (delegate?.setInterval) {\n return delegate.setInterval(handler, timeout, ...args);\n }\n return setInterval(handler, timeout, ...args);\n },\n clearInterval(handle) {\n const { delegate } = intervalProvider;\n return (delegate?.clearInterval || clearInterval)(handle as any);\n },\n delegate: undefined,\n};\n", "import { Action } from './Action';\nimport { SchedulerAction } from '../types';\nimport { Subscription } from '../Subscription';\nimport { AsyncScheduler } from './AsyncScheduler';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nimport { TimerHandle } from './timerHandle';\n\nexport class AsyncAction extends Action {\n public id: TimerHandle | undefined;\n public state?: T;\n // @ts-ignore: Property has no initializer and is not definitely assigned\n public delay: number;\n protected pending: boolean = false;\n\n constructor(protected scheduler: AsyncScheduler, protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n if (this.closed) {\n return this;\n }\n\n // Always replace the current state with the new state.\n this.state = state;\n\n const id = this.id;\n const scheduler = this.scheduler;\n\n //\n // Important implementation note:\n //\n // Actions only execute once by default, unless rescheduled from within the\n // scheduled callback. This allows us to implement single and repeat\n // actions via the same code path, without adding API surface area, as well\n // as mimic traditional recursion but across asynchronous boundaries.\n //\n // However, JS runtimes and timers distinguish between intervals achieved by\n // serial `setTimeout` calls vs. a single `setInterval` call. An interval of\n // serial `setTimeout` calls can be individually delayed, which delays\n // scheduling the next `setTimeout`, and so on. `setInterval` attempts to\n // guarantee the interval callback will be invoked more precisely to the\n // interval period, regardless of load.\n //\n // Therefore, we use `setInterval` to schedule single and repeat actions.\n // If the action reschedules itself with the same delay, the interval is not\n // canceled. If the action doesn't reschedule, or reschedules with a\n // different delay, the interval will be canceled after scheduled callback\n // execution.\n //\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n\n // Set the pending flag indicating that this action has been scheduled, or\n // has recursively rescheduled itself.\n this.pending = true;\n\n this.delay = delay;\n // If this action has already an async Id, don't request a new one.\n this.id = this.id ?? this.requestAsyncId(scheduler, this.id, delay);\n\n return this;\n }\n\n protected requestAsyncId(scheduler: AsyncScheduler, _id?: TimerHandle, delay: number = 0): TimerHandle {\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n }\n\n protected recycleAsyncId(_scheduler: AsyncScheduler, id?: TimerHandle, delay: number | null = 0): TimerHandle | undefined {\n // If this action is rescheduled with the same delay time, don't clear the interval id.\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n // Otherwise, if the action's delay time is different from the current delay,\n // or the action has been rescheduled before it's executed, clear the interval id\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n\n return undefined;\n }\n\n /**\n * Immediately executes this action and the `work` it contains.\n * @return {any}\n */\n public execute(state: T, delay: number): any {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n\n this.pending = false;\n const error = this._execute(state, delay);\n if (error) {\n return error;\n } else if (this.pending === false && this.id != null) {\n // Dequeue if the action didn't reschedule itself. Don't call\n // unsubscribe(), because the action could reschedule later.\n // For example:\n // ```\n // scheduler.schedule(function doWork(counter) {\n // /* ... I'm a busy worker bee ... */\n // var originalAction = this;\n // /* wait 100ms before rescheduling the action */\n // setTimeout(function () {\n // originalAction.schedule(counter + 1);\n // }, 100);\n // }, 1000);\n // ```\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n }\n\n protected _execute(state: T, _delay: number): any {\n let errored: boolean = false;\n let errorValue: any;\n try {\n this.work(state);\n } catch (e) {\n errored = true;\n // HACK: Since code elsewhere is relying on the \"truthiness\" of the\n // return here, we can't have it return \"\" or 0 or false.\n // TODO: Clean this up when we refactor schedulers mid-version-8 or so.\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n }\n\n unsubscribe() {\n if (!this.closed) {\n const { id, scheduler } = this;\n const { actions } = scheduler;\n\n this.work = this.state = this.scheduler = null!;\n this.pending = false;\n\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n\n this.delay = null!;\n super.unsubscribe();\n }\n }\n}\n", "import { Action } from './scheduler/Action';\nimport { Subscription } from './Subscription';\nimport { SchedulerLike, SchedulerAction } from './types';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\n\n/**\n * An execution context and a data structure to order tasks and schedule their\n * execution. Provides a notion of (potentially virtual) time, through the\n * `now()` getter method.\n *\n * Each unit of work in a Scheduler is called an `Action`.\n *\n * ```ts\n * class Scheduler {\n * now(): number;\n * schedule(work, delay?, state?): Subscription;\n * }\n * ```\n *\n * @class Scheduler\n * @deprecated Scheduler is an internal implementation detail of RxJS, and\n * should not be used directly. Rather, create your own class and implement\n * {@link SchedulerLike}. Will be made internal in v8.\n */\nexport class Scheduler implements SchedulerLike {\n public static now: () => number = dateTimestampProvider.now;\n\n constructor(private schedulerActionCtor: typeof Action, now: () => number = Scheduler.now) {\n this.now = now;\n }\n\n /**\n * A getter method that returns a number representing the current time\n * (at the time this function was called) according to the scheduler's own\n * internal clock.\n * @return {number} A number that represents the current time. May or may not\n * have a relation to wall-clock time. May or may not refer to a time unit\n * (e.g. milliseconds).\n */\n public now: () => number;\n\n /**\n * Schedules a function, `work`, for execution. May happen at some point in\n * the future, according to the `delay` parameter, if specified. May be passed\n * some context object, `state`, which will be passed to the `work` function.\n *\n * The given arguments will be processed an stored as an Action object in a\n * queue of actions.\n *\n * @param {function(state: ?T): ?Subscription} work A function representing a\n * task, or some unit of work to be executed by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler itself.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @return {Subscription} A subscription in order to be able to unsubscribe\n * the scheduled work.\n */\n public schedule(work: (this: SchedulerAction, state?: T) => void, delay: number = 0, state?: T): Subscription {\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n }\n}\n", "import { Scheduler } from '../Scheduler';\nimport { Action } from './Action';\nimport { AsyncAction } from './AsyncAction';\nimport { TimerHandle } from './timerHandle';\n\nexport class AsyncScheduler extends Scheduler {\n public actions: Array> = [];\n /**\n * A flag to indicate whether the Scheduler is currently executing a batch of\n * queued actions.\n * @type {boolean}\n * @internal\n */\n public _active: boolean = false;\n /**\n * An internal ID used to track the latest asynchronous task such as those\n * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and\n * others.\n * @type {any}\n * @internal\n */\n public _scheduled: TimerHandle | undefined;\n\n constructor(SchedulerAction: typeof Action, now: () => number = Scheduler.now) {\n super(SchedulerAction, now);\n }\n\n public flush(action: AsyncAction): void {\n const { actions } = this;\n\n if (this._active) {\n actions.push(action);\n return;\n }\n\n let error: any;\n this._active = true;\n\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions.shift()!)); // exhaust the scheduler queue\n\n this._active = false;\n\n if (error) {\n while ((action = actions.shift()!)) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n", "import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\n/**\n *\n * Async Scheduler\n *\n * Schedule task as if you used setTimeout(task, duration)\n *\n * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript\n * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating\n * in intervals.\n *\n * If you just want to \"defer\" task, that is to perform it right after currently\n * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),\n * better choice will be the {@link asapScheduler} scheduler.\n *\n * ## Examples\n * Use async scheduler to delay task\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * const task = () => console.log('it works!');\n *\n * asyncScheduler.schedule(task, 2000);\n *\n * // After 2 seconds logs:\n * // \"it works!\"\n * ```\n *\n * Use async scheduler to repeat task in intervals\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * function task(state) {\n * console.log(state);\n * this.schedule(state + 1, 1000); // `this` references currently executing Action,\n * // which we reschedule with new state and delay\n * }\n *\n * asyncScheduler.schedule(task, 3000, 0);\n *\n * // Logs:\n * // 0 after 3s\n * // 1 after 4s\n * // 2 after 5s\n * // 3 after 6s\n * ```\n */\n\nexport const asyncScheduler = new AsyncScheduler(AsyncAction);\n\n/**\n * @deprecated Renamed to {@link asyncScheduler}. Will be removed in v8.\n */\nexport const async = asyncScheduler;\n", "import { AsyncAction } from './AsyncAction';\nimport { Subscription } from '../Subscription';\nimport { QueueScheduler } from './QueueScheduler';\nimport { SchedulerAction } from '../types';\nimport { TimerHandle } from './timerHandle';\n\nexport class QueueAction extends AsyncAction {\n constructor(protected scheduler: QueueScheduler, protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n if (delay > 0) {\n return super.schedule(state, delay);\n }\n this.delay = delay;\n this.state = state;\n this.scheduler.flush(this);\n return this;\n }\n\n public execute(state: T, delay: number): any {\n return delay > 0 || this.closed ? super.execute(state, delay) : this._execute(state, delay);\n }\n\n protected requestAsyncId(scheduler: QueueScheduler, id?: TimerHandle, delay: number = 0): TimerHandle {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n\n if ((delay != null && delay > 0) || (delay == null && this.delay > 0)) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n\n // Otherwise flush the scheduler starting with this action.\n scheduler.flush(this);\n\n // HACK: In the past, this was returning `void`. However, `void` isn't a valid\n // `TimerHandle`, and generally the return value here isn't really used. So the\n // compromise is to return `0` which is both \"falsy\" and a valid `TimerHandle`,\n // as opposed to refactoring every other instanceo of `requestAsyncId`.\n return 0;\n }\n}\n", "import { AsyncScheduler } from './AsyncScheduler';\n\nexport class QueueScheduler extends AsyncScheduler {\n}\n", "import { QueueAction } from './QueueAction';\nimport { QueueScheduler } from './QueueScheduler';\n\n/**\n *\n * Queue Scheduler\n *\n * Put every next task on a queue, instead of executing it immediately\n *\n * `queue` scheduler, when used with delay, behaves the same as {@link asyncScheduler} scheduler.\n *\n * When used without delay, it schedules given task synchronously - executes it right when\n * it is scheduled. However when called recursively, that is when inside the scheduled task,\n * another task is scheduled with queue scheduler, instead of executing immediately as well,\n * that task will be put on a queue and wait for current one to finish.\n *\n * This means that when you execute task with `queue` scheduler, you are sure it will end\n * before any other task scheduled with that scheduler will start.\n *\n * ## Examples\n * Schedule recursively first, then do something\n * ```ts\n * import { queueScheduler } from 'rxjs';\n *\n * queueScheduler.schedule(() => {\n * queueScheduler.schedule(() => console.log('second')); // will not happen now, but will be put on a queue\n *\n * console.log('first');\n * });\n *\n * // Logs:\n * // \"first\"\n * // \"second\"\n * ```\n *\n * Reschedule itself recursively\n * ```ts\n * import { queueScheduler } from 'rxjs';\n *\n * queueScheduler.schedule(function(state) {\n * if (state !== 0) {\n * console.log('before', state);\n * this.schedule(state - 1); // `this` references currently executing Action,\n * // which we reschedule with new state\n * console.log('after', state);\n * }\n * }, 0, 3);\n *\n * // In scheduler that runs recursively, you would expect:\n * // \"before\", 3\n * // \"before\", 2\n * // \"before\", 1\n * // \"after\", 1\n * // \"after\", 2\n * // \"after\", 3\n *\n * // But with queue it logs:\n * // \"before\", 3\n * // \"after\", 3\n * // \"before\", 2\n * // \"after\", 2\n * // \"before\", 1\n * // \"after\", 1\n * ```\n */\n\nexport const queueScheduler = new QueueScheduler(QueueAction);\n\n/**\n * @deprecated Renamed to {@link queueScheduler}. Will be removed in v8.\n */\nexport const queue = queueScheduler;\n", "import { AsyncAction } from './AsyncAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\nimport { SchedulerAction } from '../types';\nimport { animationFrameProvider } from './animationFrameProvider';\nimport { TimerHandle } from './timerHandle';\n\nexport class AnimationFrameAction extends AsyncAction {\n constructor(protected scheduler: AnimationFrameScheduler, protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n protected requestAsyncId(scheduler: AnimationFrameScheduler, id?: TimerHandle, delay: number = 0): TimerHandle {\n // If delay is greater than 0, request as an async action.\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n // Push the action to the end of the scheduler queue.\n scheduler.actions.push(this);\n // If an animation frame has already been requested, don't request another\n // one. If an animation frame hasn't been requested yet, request one. Return\n // the current animation frame request id.\n return scheduler._scheduled || (scheduler._scheduled = animationFrameProvider.requestAnimationFrame(() => scheduler.flush(undefined)));\n }\n\n protected recycleAsyncId(scheduler: AnimationFrameScheduler, id?: TimerHandle, delay: number = 0): TimerHandle | undefined {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n if (delay != null ? delay > 0 : this.delay > 0) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n // If the scheduler queue has no remaining actions with the same async id,\n // cancel the requested animation frame and set the scheduled flag to\n // undefined so the next AnimationFrameAction will request its own.\n const { actions } = scheduler;\n if (id != null && actions[actions.length - 1]?.id !== id) {\n animationFrameProvider.cancelAnimationFrame(id as number);\n scheduler._scheduled = undefined;\n }\n // Return undefined so the action knows to request a new async id if it's rescheduled.\n return undefined;\n }\n}\n", "import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\nexport class AnimationFrameScheduler extends AsyncScheduler {\n public flush(action?: AsyncAction): void {\n this._active = true;\n // The async id that effects a call to flush is stored in _scheduled.\n // Before executing an action, it's necessary to check the action's async\n // id to determine whether it's supposed to be executed in the current\n // flush.\n // Previous implementations of this method used a count to determine this,\n // but that was unsound, as actions that are unsubscribed - i.e. cancelled -\n // are removed from the actions array and that can shift actions that are\n // scheduled to be executed in a subsequent flush into positions at which\n // they are executed within the current flush.\n const flushId = this._scheduled;\n this._scheduled = undefined;\n\n const { actions } = this;\n let error: any;\n action = action || actions.shift()!;\n\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions[0]) && action.id === flushId && actions.shift());\n\n this._active = false;\n\n if (error) {\n while ((action = actions[0]) && action.id === flushId && actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n", "import { AnimationFrameAction } from './AnimationFrameAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\n\n/**\n *\n * Animation Frame Scheduler\n *\n * Perform task when `window.requestAnimationFrame` would fire\n *\n * When `animationFrame` scheduler is used with delay, it will fall back to {@link asyncScheduler} scheduler\n * behaviour.\n *\n * Without delay, `animationFrame` scheduler can be used to create smooth browser animations.\n * It makes sure scheduled task will happen just before next browser content repaint,\n * thus performing animations as efficiently as possible.\n *\n * ## Example\n * Schedule div height animation\n * ```ts\n * // html:
\n * import { animationFrameScheduler } from 'rxjs';\n *\n * const div = document.querySelector('div');\n *\n * animationFrameScheduler.schedule(function(height) {\n * div.style.height = height + \"px\";\n *\n * this.schedule(height + 1); // `this` references currently executing Action,\n * // which we reschedule with new state\n * }, 0, 0);\n *\n * // You will see a div element growing in height\n * ```\n */\n\nexport const animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);\n\n/**\n * @deprecated Renamed to {@link animationFrameScheduler}. Will be removed in v8.\n */\nexport const animationFrame = animationFrameScheduler;\n", "import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\n\n/**\n * A simple Observable that emits no items to the Observer and immediately\n * emits a complete notification.\n *\n * Just emits 'complete', and nothing else.\n *\n * ![](empty.png)\n *\n * A simple Observable that only emits the complete notification. It can be used\n * for composing with other Observables, such as in a {@link mergeMap}.\n *\n * ## Examples\n *\n * Log complete notification\n *\n * ```ts\n * import { EMPTY } from 'rxjs';\n *\n * EMPTY.subscribe({\n * next: () => console.log('Next'),\n * complete: () => console.log('Complete!')\n * });\n *\n * // Outputs\n * // Complete!\n * ```\n *\n * Emit the number 7, then complete\n *\n * ```ts\n * import { EMPTY, startWith } from 'rxjs';\n *\n * const result = EMPTY.pipe(startWith(7));\n * result.subscribe(x => console.log(x));\n *\n * // Outputs\n * // 7\n * ```\n *\n * Map and flatten only odd numbers to the sequence `'a'`, `'b'`, `'c'`\n *\n * ```ts\n * import { interval, mergeMap, of, EMPTY } from 'rxjs';\n *\n * const interval$ = interval(1000);\n * const result = interval$.pipe(\n * mergeMap(x => x % 2 === 1 ? of('a', 'b', 'c') : EMPTY),\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following to the console:\n * // x is equal to the count on the interval, e.g. (0, 1, 2, 3, ...)\n * // x will occur every 1000ms\n * // if x % 2 is equal to 1, print a, b, c (each on its own)\n * // if x % 2 is not equal to 1, nothing will be output\n * ```\n *\n * @see {@link Observable}\n * @see {@link NEVER}\n * @see {@link of}\n * @see {@link throwError}\n */\nexport const EMPTY = new Observable((subscriber) => subscriber.complete());\n\n/**\n * @param scheduler A {@link SchedulerLike} to use for scheduling\n * the emission of the complete notification.\n * @deprecated Replaced with the {@link EMPTY} constant or {@link scheduled} (e.g. `scheduled([], scheduler)`). Will be removed in v8.\n */\nexport function empty(scheduler?: SchedulerLike) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\n\nfunction emptyScheduled(scheduler: SchedulerLike) {\n return new Observable((subscriber) => scheduler.schedule(() => subscriber.complete()));\n}\n", "import { SchedulerLike } from '../types';\nimport { isFunction } from './isFunction';\n\nexport function isScheduler(value: any): value is SchedulerLike {\n return value && isFunction(value.schedule);\n}\n", "import { SchedulerLike } from '../types';\nimport { isFunction } from './isFunction';\nimport { isScheduler } from './isScheduler';\n\nfunction last(arr: T[]): T | undefined {\n return arr[arr.length - 1];\n}\n\nexport function popResultSelector(args: any[]): ((...args: unknown[]) => unknown) | undefined {\n return isFunction(last(args)) ? args.pop() : undefined;\n}\n\nexport function popScheduler(args: any[]): SchedulerLike | undefined {\n return isScheduler(last(args)) ? args.pop() : undefined;\n}\n\nexport function popNumber(args: any[], defaultValue: number): number {\n return typeof last(args) === 'number' ? args.pop()! : defaultValue;\n}\n", "export const isArrayLike = ((x: any): x is ArrayLike => x && typeof x.length === 'number' && typeof x !== 'function');", "import { isFunction } from \"./isFunction\";\n\n/**\n * Tests to see if the object is \"thennable\".\n * @param value the object to test\n */\nexport function isPromise(value: any): value is PromiseLike {\n return isFunction(value?.then);\n}\n", "import { InteropObservable } from '../types';\nimport { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\n\n/** Identifies an input as being Observable (but not necessary an Rx Observable) */\nexport function isInteropObservable(input: any): input is InteropObservable {\n return isFunction(input[Symbol_observable]);\n}\n", "import { isFunction } from './isFunction';\n\nexport function isAsyncIterable(obj: any): obj is AsyncIterable {\n return Symbol.asyncIterator && isFunction(obj?.[Symbol.asyncIterator]);\n}\n", "/**\n * Creates the TypeError to throw if an invalid object is passed to `from` or `scheduled`.\n * @param input The object that was passed.\n */\nexport function createInvalidObservableTypeError(input: any) {\n // TODO: We should create error codes that can be looked up, so this can be less verbose.\n return new TypeError(\n `You provided ${\n input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'`\n } where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`\n );\n}\n", "export function getSymbolIterator(): symbol {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator' as any;\n }\n\n return Symbol.iterator;\n}\n\nexport const iterator = getSymbolIterator();\n", "import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\n\n/** Identifies an input as being an Iterable */\nexport function isIterable(input: any): input is Iterable {\n return isFunction(input?.[Symbol_iterator]);\n}\n", "import { ReadableStreamLike } from '../types';\nimport { isFunction } from './isFunction';\n\nexport async function* readableStreamLikeToAsyncGenerator(readableStream: ReadableStreamLike): AsyncGenerator {\n const reader = readableStream.getReader();\n try {\n while (true) {\n const { value, done } = await reader.read();\n if (done) {\n return;\n }\n yield value!;\n }\n } finally {\n reader.releaseLock();\n }\n}\n\nexport function isReadableStreamLike(obj: any): obj is ReadableStreamLike {\n // We don't want to use instanceof checks because they would return\n // false for instances from another Realm, like an