carla/PythonAPI/examples/generate_traffic.py

339 lines
13 KiB
Python
Raw Normal View History

2018-10-29 00:46:37 +08:00
#!/usr/bin/env python
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
# Copyright (c) 2021 Computer Vision Center (CVC) at the Universitat Autonoma de
2018-10-29 00:46:37 +08:00
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
"""Example script to generate traffic in the simulation"""
2018-10-29 00:46:37 +08:00
import glob
import os
import sys
import time
2018-10-29 00:46:37 +08:00
try:
2019-03-29 02:15:13 +08:00
sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % (
2018-10-29 00:46:37 +08:00
sys.version_info.major,
sys.version_info.minor,
'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0])
except IndexError:
pass
import carla
from carla import VehicleLightState as vls
2018-10-29 00:46:37 +08:00
import argparse
import logging
Determinism for Traffic Manager (#3333) * Check for determinism * Per-vehicle random device * Parameterised random device seed. * Changing next waypoint selection logic to use bucketing random device sample. Arranging next waypoint selections right to left. * Change to numpy's random lib * Sorting blueprints to ensure determinism * New method for determinism * ResetAllTrafficLight now works in sync mode. * Moving recorder stuff to engine module * Fixed recorder for traffic lights in standalone mode. * Added check to prevent traffic light from updating during replay. * Updating old traffic lights to use the traffic light component. * Moved recorder to posttick. * Small fix to elapse time function. * Added reset group function to API. * Merge with traffic_manager/determinism_check * Changes in TL reset Option to save to file for recorder script * Added automatic signal match with OpenDRIVE. * Fixed error that caused traffic light actors to be missing in client side. * Added new frozen behavior. * Updated documentation and changelog * Updated ContentVersions.txt * Review changes. * fixes merge error * fixes merge * Update build_windows.md Added info about command execution that toke me many time to find out * Update build_windows.md Updated as requested in pull request review * Running Carla when choosing a) deb Carla install This fixes a minor error in the documentation regarding running carla, if the deb installation was choosen. * Fix for traffic manager freezing upon map change * attempt to change sys clock to sim clock * Remove manual unlock of mutex * fixing merge error * Changelog and review fixes Co-authored-by: Praveen Kumar <pravinblaze@hotmail.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Axel1092 <axellopez92@outlook.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com> Co-authored-by: Néstor Sabater <web.nsabater@gmail.com> Co-authored-by: ll7 <32880741+ll7@users.noreply.github.com>
2020-09-22 21:20:52 +08:00
from numpy import random
2018-10-29 00:46:37 +08:00
def main():
argparser = argparse.ArgumentParser(
description=__doc__)
argparser.add_argument(
'--host',
metavar='H',
default='127.0.0.1',
help='IP of the host server (default: 127.0.0.1)')
argparser.add_argument(
'-p', '--port',
metavar='P',
default=2000,
type=int,
help='TCP port to listen to (default: 2000)')
argparser.add_argument(
2018-10-30 19:00:00 +08:00
'-n', '--number-of-vehicles',
2018-10-29 00:46:37 +08:00
metavar='N',
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
default=30,
2018-10-29 00:46:37 +08:00
type=int,
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
help='Number of vehicles (default: 30)')
2019-06-14 18:40:30 +08:00
argparser.add_argument(
'-w', '--number-of-walkers',
metavar='W',
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
default=10,
2019-06-14 18:40:30 +08:00
type=int,
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
help='Number of walkers (default: 10)')
2018-11-03 19:28:14 +08:00
argparser.add_argument(
'--safe',
action='store_true',
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
help='Avoid spawning vehicles prone to accidents')
argparser.add_argument(
2019-07-01 22:23:47 +08:00
'--filterv',
metavar='PATTERN',
default='vehicle.*',
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
help='Filter vehicle model (default: "vehicle.*")')
2019-07-01 22:23:47 +08:00
argparser.add_argument(
'--filterw',
metavar='PATTERN',
default='walker.pedestrian.*',
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
help='Filter pedestrian type (default: "walker.pedestrian.*")')
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
argparser.add_argument(
'--tm-port',
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
metavar='P',
default=8000,
type=int,
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
help='Port to communicate with TM (default: 8000)')
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
argparser.add_argument(
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
'--asynch',
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
action='store_true',
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
help='Activate asynchronous mode execution')
Hybrid mode for Traffic Manager (#2674) * Improved braking, collision negotiation. * Improved braking algorithm for smoother approach to lead vehicle. * Implemented smoother path boundary modification to aid smoother braking. * Re-worked collision negotiation algorithm. * Improved collision candidate filtering. * Added safe-guard in case of vehicle removal in collision stage. * Used local variable for heavily referenced object in localization stage. * Implemented vector relative velocities for motion planner's collision consideration. * Moved collision candidate sorting logic from collision stage to localization stage. * Sorting collision candidates using their ids instead of shared pointers to avoid memory corruption. * Improved conditions for collision consideration for greater efficiency. * Removed fps limit in async mode. * Hybrid physics mode * Introduced hybrid physics mode parameter * Implemented physics independent velocity computation * Modified localization stage to be physics agnostic * Fixing velocity compute interval in sync and async mode. Made motion planner stage work with internally computed velocities. * Made collision stage agnostic to actor physics * Sampling waypoint buffer for teleportation window * WIP: Teleportation changes * WIP2: Teleportation changes * Fixes waypoint window and vehicle spawning * hotfix to performance benchmark * comment out debugs * changelog * fixes collision bug * fixes package error and out_of_range bug * changes after review * Left & Right Transit of a lane: Waypoint mapping Co-authored-by: Praveen Kumar <pravinblaze@hotmail.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com>
2020-03-31 04:53:29 +08:00
argparser.add_argument(
'--hybrid',
action='store_true',
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
help='Activate hybrid mode for Traffic Manager')
Determinism for Traffic Manager (#3333) * Check for determinism * Per-vehicle random device * Parameterised random device seed. * Changing next waypoint selection logic to use bucketing random device sample. Arranging next waypoint selections right to left. * Change to numpy's random lib * Sorting blueprints to ensure determinism * New method for determinism * ResetAllTrafficLight now works in sync mode. * Moving recorder stuff to engine module * Fixed recorder for traffic lights in standalone mode. * Added check to prevent traffic light from updating during replay. * Updating old traffic lights to use the traffic light component. * Moved recorder to posttick. * Small fix to elapse time function. * Added reset group function to API. * Merge with traffic_manager/determinism_check * Changes in TL reset Option to save to file for recorder script * Added automatic signal match with OpenDRIVE. * Fixed error that caused traffic light actors to be missing in client side. * Added new frozen behavior. * Updated documentation and changelog * Updated ContentVersions.txt * Review changes. * fixes merge error * fixes merge * Update build_windows.md Added info about command execution that toke me many time to find out * Update build_windows.md Updated as requested in pull request review * Running Carla when choosing a) deb Carla install This fixes a minor error in the documentation regarding running carla, if the deb installation was choosen. * Fix for traffic manager freezing upon map change * attempt to change sys clock to sim clock * Remove manual unlock of mutex * fixing merge error * Changelog and review fixes Co-authored-by: Praveen Kumar <pravinblaze@hotmail.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Axel1092 <axellopez92@outlook.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com> Co-authored-by: Néstor Sabater <web.nsabater@gmail.com> Co-authored-by: ll7 <32880741+ll7@users.noreply.github.com>
2020-09-22 21:20:52 +08:00
argparser.add_argument(
'-s', '--seed',
metavar='S',
type=int,
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
help='Set random device seed and deterministic mode for Traffic Manager')
argparser.add_argument(
'--car-lights-on',
action='store_true',
default=False,
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
help='Enable car lights')
argparser.add_argument(
'--hero',
action='store_true',
default=False,
help='Set one of the vehicles as hero')
argparser.add_argument(
'--respawn',
action='store_true',
default=False,
help='Automatically respawn dormant vehicles (only in large maps)')
argparser.add_argument(
'--no-rendering',
action='store_true',
default=False,
help='Activate no rendering mode')
2018-10-29 00:46:37 +08:00
args = argparser.parse_args()
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
vehicles_list = []
2019-07-01 22:23:47 +08:00
walkers_list = []
all_id = []
client = carla.Client(args.host, args.port)
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
client.set_timeout(10.0)
synchronous_master = False
Determinism for Traffic Manager (#3333) * Check for determinism * Per-vehicle random device * Parameterised random device seed. * Changing next waypoint selection logic to use bucketing random device sample. Arranging next waypoint selections right to left. * Change to numpy's random lib * Sorting blueprints to ensure determinism * New method for determinism * ResetAllTrafficLight now works in sync mode. * Moving recorder stuff to engine module * Fixed recorder for traffic lights in standalone mode. * Added check to prevent traffic light from updating during replay. * Updating old traffic lights to use the traffic light component. * Moved recorder to posttick. * Small fix to elapse time function. * Added reset group function to API. * Merge with traffic_manager/determinism_check * Changes in TL reset Option to save to file for recorder script * Added automatic signal match with OpenDRIVE. * Fixed error that caused traffic light actors to be missing in client side. * Added new frozen behavior. * Updated documentation and changelog * Updated ContentVersions.txt * Review changes. * fixes merge error * fixes merge * Update build_windows.md Added info about command execution that toke me many time to find out * Update build_windows.md Updated as requested in pull request review * Running Carla when choosing a) deb Carla install This fixes a minor error in the documentation regarding running carla, if the deb installation was choosen. * Fix for traffic manager freezing upon map change * attempt to change sys clock to sim clock * Remove manual unlock of mutex * fixing merge error * Changelog and review fixes Co-authored-by: Praveen Kumar <pravinblaze@hotmail.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Axel1092 <axellopez92@outlook.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com> Co-authored-by: Néstor Sabater <web.nsabater@gmail.com> Co-authored-by: ll7 <32880741+ll7@users.noreply.github.com>
2020-09-22 21:20:52 +08:00
random.seed(args.seed if args.seed is not None else int(time.time()))
2018-10-29 00:46:37 +08:00
try:
Hybrid mode for Traffic Manager (#2674) * Improved braking, collision negotiation. * Improved braking algorithm for smoother approach to lead vehicle. * Implemented smoother path boundary modification to aid smoother braking. * Re-worked collision negotiation algorithm. * Improved collision candidate filtering. * Added safe-guard in case of vehicle removal in collision stage. * Used local variable for heavily referenced object in localization stage. * Implemented vector relative velocities for motion planner's collision consideration. * Moved collision candidate sorting logic from collision stage to localization stage. * Sorting collision candidates using their ids instead of shared pointers to avoid memory corruption. * Improved conditions for collision consideration for greater efficiency. * Removed fps limit in async mode. * Hybrid physics mode * Introduced hybrid physics mode parameter * Implemented physics independent velocity computation * Modified localization stage to be physics agnostic * Fixing velocity compute interval in sync and async mode. Made motion planner stage work with internally computed velocities. * Made collision stage agnostic to actor physics * Sampling waypoint buffer for teleportation window * WIP: Teleportation changes * WIP2: Teleportation changes * Fixes waypoint window and vehicle spawning * hotfix to performance benchmark * comment out debugs * changelog * fixes collision bug * fixes package error and out_of_range bug * changes after review * Left & Right Transit of a lane: Waypoint mapping Co-authored-by: Praveen Kumar <pravinblaze@hotmail.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com>
2020-03-31 04:53:29 +08:00
world = client.get_world()
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
traffic_manager = client.get_trafficmanager(args.tm_port)
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
traffic_manager.set_global_distance_to_leading_vehicle(2.5)
if args.respawn:
traffic_manager.set_respawn_dormant_vehicles(True)
Hybrid mode for Traffic Manager (#2674) * Improved braking, collision negotiation. * Improved braking algorithm for smoother approach to lead vehicle. * Implemented smoother path boundary modification to aid smoother braking. * Re-worked collision negotiation algorithm. * Improved collision candidate filtering. * Added safe-guard in case of vehicle removal in collision stage. * Used local variable for heavily referenced object in localization stage. * Implemented vector relative velocities for motion planner's collision consideration. * Moved collision candidate sorting logic from collision stage to localization stage. * Sorting collision candidates using their ids instead of shared pointers to avoid memory corruption. * Improved conditions for collision consideration for greater efficiency. * Removed fps limit in async mode. * Hybrid physics mode * Introduced hybrid physics mode parameter * Implemented physics independent velocity computation * Modified localization stage to be physics agnostic * Fixing velocity compute interval in sync and async mode. Made motion planner stage work with internally computed velocities. * Made collision stage agnostic to actor physics * Sampling waypoint buffer for teleportation window * WIP: Teleportation changes * WIP2: Teleportation changes * Fixes waypoint window and vehicle spawning * hotfix to performance benchmark * comment out debugs * changelog * fixes collision bug * fixes package error and out_of_range bug * changes after review * Left & Right Transit of a lane: Waypoint mapping Co-authored-by: Praveen Kumar <pravinblaze@hotmail.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com>
2020-03-31 04:53:29 +08:00
if args.hybrid:
traffic_manager.set_hybrid_physics_mode(True)
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
traffic_manager.set_hybrid_physics_radius(70.0)
Determinism for Traffic Manager (#3333) * Check for determinism * Per-vehicle random device * Parameterised random device seed. * Changing next waypoint selection logic to use bucketing random device sample. Arranging next waypoint selections right to left. * Change to numpy's random lib * Sorting blueprints to ensure determinism * New method for determinism * ResetAllTrafficLight now works in sync mode. * Moving recorder stuff to engine module * Fixed recorder for traffic lights in standalone mode. * Added check to prevent traffic light from updating during replay. * Updating old traffic lights to use the traffic light component. * Moved recorder to posttick. * Small fix to elapse time function. * Added reset group function to API. * Merge with traffic_manager/determinism_check * Changes in TL reset Option to save to file for recorder script * Added automatic signal match with OpenDRIVE. * Fixed error that caused traffic light actors to be missing in client side. * Added new frozen behavior. * Updated documentation and changelog * Updated ContentVersions.txt * Review changes. * fixes merge error * fixes merge * Update build_windows.md Added info about command execution that toke me many time to find out * Update build_windows.md Updated as requested in pull request review * Running Carla when choosing a) deb Carla install This fixes a minor error in the documentation regarding running carla, if the deb installation was choosen. * Fix for traffic manager freezing upon map change * attempt to change sys clock to sim clock * Remove manual unlock of mutex * fixing merge error * Changelog and review fixes Co-authored-by: Praveen Kumar <pravinblaze@hotmail.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Axel1092 <axellopez92@outlook.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com> Co-authored-by: Néstor Sabater <web.nsabater@gmail.com> Co-authored-by: ll7 <32880741+ll7@users.noreply.github.com>
2020-09-22 21:20:52 +08:00
if args.seed is not None:
traffic_manager.set_random_device_seed(args.seed)
Hybrid mode for Traffic Manager (#2674) * Improved braking, collision negotiation. * Improved braking algorithm for smoother approach to lead vehicle. * Implemented smoother path boundary modification to aid smoother braking. * Re-worked collision negotiation algorithm. * Improved collision candidate filtering. * Added safe-guard in case of vehicle removal in collision stage. * Used local variable for heavily referenced object in localization stage. * Implemented vector relative velocities for motion planner's collision consideration. * Moved collision candidate sorting logic from collision stage to localization stage. * Sorting collision candidates using their ids instead of shared pointers to avoid memory corruption. * Improved conditions for collision consideration for greater efficiency. * Removed fps limit in async mode. * Hybrid physics mode * Introduced hybrid physics mode parameter * Implemented physics independent velocity computation * Modified localization stage to be physics agnostic * Fixing velocity compute interval in sync and async mode. Made motion planner stage work with internally computed velocities. * Made collision stage agnostic to actor physics * Sampling waypoint buffer for teleportation window * WIP: Teleportation changes * WIP2: Teleportation changes * Fixes waypoint window and vehicle spawning * hotfix to performance benchmark * comment out debugs * changelog * fixes collision bug * fixes package error and out_of_range bug * changes after review * Left & Right Transit of a lane: Waypoint mapping Co-authored-by: Praveen Kumar <pravinblaze@hotmail.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com>
2020-03-31 04:53:29 +08:00
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
settings = world.get_settings()
if not args.asynch:
2020-03-09 21:04:35 +08:00
traffic_manager.set_synchronous_mode(True)
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
if not settings.synchronous_mode:
synchronous_master = True
settings.synchronous_mode = True
settings.fixed_delta_seconds = 0.05
else:
synchronous_master = False
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
else:
print("You are currently in asynchronous mode. If this is a traffic simulation, \
you could experience some issues. If it's not working correctly, switch to synchronous \
mode by using traffic_manager.set_synchronous_mode(True)")
if args.no_rendering:
settings.no_rendering_mode = True
world.apply_settings(settings)
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
2019-07-01 22:23:47 +08:00
blueprints = world.get_blueprint_library().filter(args.filterv)
blueprintsWalkers = world.get_blueprint_library().filter(args.filterw)
2018-10-29 00:46:37 +08:00
2018-11-03 19:28:14 +08:00
if args.safe:
blueprints = [x for x in blueprints if int(x.get_attribute('number_of_wheels')) == 4]
blueprints = [x for x in blueprints if not x.id.endswith('isetta')]
blueprints = [x for x in blueprints if not x.id.endswith('carlacola')]
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
blueprints = [x for x in blueprints if not x.id.endswith('cybertruck')]
blueprints = [x for x in blueprints if not x.id.endswith('t2')]
blueprints = [x for x in blueprints if not x.id.endswith('firetruck')]
blueprints = [x for x in blueprints if not x.id.endswith('ambulance')]
2018-11-03 19:28:14 +08:00
Determinism for Traffic Manager (#3333) * Check for determinism * Per-vehicle random device * Parameterised random device seed. * Changing next waypoint selection logic to use bucketing random device sample. Arranging next waypoint selections right to left. * Change to numpy's random lib * Sorting blueprints to ensure determinism * New method for determinism * ResetAllTrafficLight now works in sync mode. * Moving recorder stuff to engine module * Fixed recorder for traffic lights in standalone mode. * Added check to prevent traffic light from updating during replay. * Updating old traffic lights to use the traffic light component. * Moved recorder to posttick. * Small fix to elapse time function. * Added reset group function to API. * Merge with traffic_manager/determinism_check * Changes in TL reset Option to save to file for recorder script * Added automatic signal match with OpenDRIVE. * Fixed error that caused traffic light actors to be missing in client side. * Added new frozen behavior. * Updated documentation and changelog * Updated ContentVersions.txt * Review changes. * fixes merge error * fixes merge * Update build_windows.md Added info about command execution that toke me many time to find out * Update build_windows.md Updated as requested in pull request review * Running Carla when choosing a) deb Carla install This fixes a minor error in the documentation regarding running carla, if the deb installation was choosen. * Fix for traffic manager freezing upon map change * attempt to change sys clock to sim clock * Remove manual unlock of mutex * fixing merge error * Changelog and review fixes Co-authored-by: Praveen Kumar <pravinblaze@hotmail.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Axel1092 <axellopez92@outlook.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com> Co-authored-by: Néstor Sabater <web.nsabater@gmail.com> Co-authored-by: ll7 <32880741+ll7@users.noreply.github.com>
2020-09-22 21:20:52 +08:00
blueprints = sorted(blueprints, key=lambda bp: bp.id)
spawn_points = world.get_map().get_spawn_points()
number_of_spawn_points = len(spawn_points)
if args.number_of_vehicles < number_of_spawn_points:
random.shuffle(spawn_points)
elif args.number_of_vehicles > number_of_spawn_points:
msg = 'requested %d vehicles, but could only find %d spawn points'
logging.warning(msg, args.number_of_vehicles, number_of_spawn_points)
args.number_of_vehicles = number_of_spawn_points
# @todo cannot import these directly.
SpawnActor = carla.command.SpawnActor
SetAutopilot = carla.command.SetAutopilot
SetVehicleLightState = carla.command.SetVehicleLightState
FutureActor = carla.command.FutureActor
# --------------
# Spawn vehicles
# --------------
batch = []
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
hero = args.hero
for n, transform in enumerate(spawn_points):
if n >= args.number_of_vehicles:
break
2018-10-29 00:46:37 +08:00
blueprint = random.choice(blueprints)
if blueprint.has_attribute('color'):
color = random.choice(blueprint.get_attribute('color').recommended_values)
blueprint.set_attribute('color', color)
if blueprint.has_attribute('driver_id'):
driver_id = random.choice(blueprint.get_attribute('driver_id').recommended_values)
blueprint.set_attribute('driver_id', driver_id)
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
if hero:
blueprint.set_attribute('role_name', 'hero')
hero = False
else:
blueprint.set_attribute('role_name', 'autopilot')
# prepare the light state of the cars to spawn
light_state = vls.NONE
if args.car_lights_on:
light_state = vls.Position | vls.LowBeam | vls.LowBeam
# spawn the cars and set their autopilot and light state all together
batch.append(SpawnActor(blueprint, transform)
.then(SetAutopilot(FutureActor, True, traffic_manager.get_port()))
.then(SetVehicleLightState(FutureActor, light_state)))
2018-10-29 22:00:46 +08:00
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
for response in client.apply_batch_sync(batch, synchronous_master):
if response.error:
logging.error(response.error)
else:
vehicles_list.append(response.actor_id)
2018-10-30 19:00:00 +08:00
# -------------
2019-06-14 18:40:30 +08:00
# Spawn Walkers
# -------------
2019-11-20 17:59:00 +08:00
# some settings
percentagePedestriansRunning = 0.0 # how many pedestrians will run
percentagePedestriansCrossing = 0.0 # how many pedestrians will walk through the road
# 1. take all the random locations to spawn
2019-06-14 18:40:30 +08:00
spawn_points = []
for i in range(args.number_of_walkers):
spawn_point = carla.Transform()
loc = world.get_random_location_from_navigation()
if (loc != None):
spawn_point.location = loc
spawn_points.append(spawn_point)
# 2. we spawn the walker object
2019-07-02 22:06:35 +08:00
batch = []
walker_speed = []
2019-06-14 18:40:30 +08:00
for spawn_point in spawn_points:
2019-07-01 22:23:47 +08:00
walker_bp = random.choice(blueprintsWalkers)
# set as not invincible
if walker_bp.has_attribute('is_invincible'):
walker_bp.set_attribute('is_invincible', 'false')
# set the max speed
if walker_bp.has_attribute('speed'):
2019-11-20 17:59:00 +08:00
if (random.random() > percentagePedestriansRunning):
# walking
walker_speed.append(walker_bp.get_attribute('speed').recommended_values[1])
else:
# running
walker_speed.append(walker_bp.get_attribute('speed').recommended_values[2])
else:
print("Walker has no speed")
walker_speed.append(0.0)
2019-06-14 18:40:30 +08:00
batch.append(SpawnActor(walker_bp, spawn_point))
results = client.apply_batch_sync(batch, True)
walker_speed2 = []
2019-06-14 18:40:30 +08:00
for i in range(len(results)):
if results[i].error:
logging.error(results[i].error)
else:
2019-07-02 22:06:35 +08:00
walkers_list.append({"id": results[i].actor_id})
walker_speed2.append(walker_speed[i])
walker_speed = walker_speed2
# 3. we spawn the walker controller
2019-06-14 18:40:30 +08:00
batch = []
walker_controller_bp = world.get_blueprint_library().find('controller.ai.walker')
for i in range(len(walkers_list)):
batch.append(SpawnActor(walker_controller_bp, carla.Transform(), walkers_list[i]["id"]))
2019-06-14 18:40:30 +08:00
results = client.apply_batch_sync(batch, True)
for i in range(len(results)):
if results[i].error:
logging.error(results[i].error)
else:
walkers_list[i]["con"] = results[i].actor_id
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
# 4. we put together the walkers and controllers id to get the objects from their id
for i in range(len(walkers_list)):
all_id.append(walkers_list[i]["con"])
all_id.append(walkers_list[i]["id"])
2019-06-14 18:40:30 +08:00
all_actors = world.get_actors(all_id)
2019-07-03 21:51:26 +08:00
# wait for a tick to ensure client receives the last transform of the walkers we have just created
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
if args.asynch or not synchronous_master:
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
world.wait_for_tick()
else:
world.tick()
2019-07-03 21:51:26 +08:00
# 5. initialize each controller and set target to walk to (list is [controler, actor, controller, actor ...])
# set how many pedestrians can cross the road
2019-11-20 17:59:00 +08:00
world.set_pedestrians_cross_factor(percentagePedestriansCrossing)
2019-06-19 16:22:27 +08:00
for i in range(0, len(all_id), 2):
# start walker
all_actors[i].start()
# set walk to random point
all_actors[i].go_to_location(world.get_random_location_from_navigation())
# max speed
all_actors[i].set_max_speed(float(walker_speed[int(i/2)]))
2019-06-14 18:40:30 +08:00
print('spawned %d vehicles and %d walkers, press Ctrl+C to exit.' % (len(vehicles_list), len(walkers_list)))
2019-06-14 18:40:30 +08:00
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
# Example of how to use Traffic Manager parameters
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
traffic_manager.global_percentage_speed_difference(30.0)
2018-10-30 19:00:00 +08:00
while True:
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
if not args.asynch and synchronous_master:
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
world.tick()
else:
world.wait_for_tick()
2018-10-29 00:46:37 +08:00
finally:
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
if not args.asynch and synchronous_master:
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
settings = world.get_settings()
settings.synchronous_mode = False
Traffic Manager for Large Maps (#4324) * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Added LargeMapManager * Added DVector Vector of doubles * Declaration of interface * Added AUncenteredPivotPointMesh * Added map generation from assets folder * Updates on FDVector * Added tile load on demand * Fixed load tile issues after rebasing origin * Updated FDVector * Added some auxiliary functions * Added conversion and operator * Added methods to check and configure the state * Removed const and updated printed info * Added macro to avoid logs * Added info dump functions * The asset spawn check was added to the tick * LargeMapManager added to CarlaGM * Moving to level load autocontrol * Updated with new function name, AddNewClientToConsider * Fixing forced tile load * Added operator*(float) * Disabled Localplayer * Now the streaming is handled by us * Fixed remove of considered actors * Fixed typo * Added MapOrigin to the Episode * Added Vector3DInt to LibCarla * Removed floats in Vector3DInt * Added offset to client actor's location * Fixed old cast warning * Removed float * Added explicit cast to avoid warning * Fixed client actor transform * Removed unnecessary code * Added origin offset to spawn_actor * Adding spawn points generation * Added spawn points folder in editor * Changed Spawnpoint for only Transforms * World rebase is triggered directly * Added offset when attaching actors * Detecting hero vehicle * Only hero vehicles are considered to stream tiles * Little update on log macro * Adding support for ghost actors * Refactored LargeMap classes * Refactored LargeMap classes * Revert refactor * Remove files * Added dormant state to actors * Fixed spawn+rebase on new OnActorSpawn * Removed circular dependency warning * Converted FActorView into an USTRUCT * Added actor state conversion to dormant * Removed ConvertActorDormant * Added spawn and transition of dormants * Ghost to Dormant working * Replicated dormant actors * Add substraction operators * Added dormant to ghost conversion * Fixed some issues in dormant to ghost conversion * WIP! Attached actors not working properly * WIP! Attached actors not working properly * Changing several constant variables Removing sorting in LocalizationStage.cpp * Fixing variable name * Fixing variable name * WIP: Fixing hybrid mode * Added tiles loaded from umaps. * Fixed Missing includes * Debug settings are still on. Added extra points in tight curves for PID improvement. Fixed Hybrid Mode, now moves in the direction of the next waypoint. Reduced calculations in MotionPlanningStage.cpp * Removed all debug helper functions * Added FActorData classes to save and restore actor state for dormant actors. Edited all client - server calls to recognize the dormant state. FActorView now can hold null AActor* when is dormant. Large Maps now load tiled umaps instead of assets. * Fixed dormant check for attached actors * Expanded FActorData classes. Added world observer aware of dormant actors. * Extended FActorData classes with walker data. * Fixed missing includes * Removed some with editor macros. * Added virtual destructor to FActorData. * Adding includes * Fixed warnings. Added UNoWorldOffsetSceneComponent to have unreal actors unnafected by rebase. * Fixed tile alingment. * Added sensor data to restore the comunication. * Added parent hierarchy consideration to sleep/wakeup of ghost/dormant actors. * Fixed crash for sensor destruction. * Changed InMemoryMap to generate more points if two waypoints are even further than a multiple of the limit. Removed SetSimulatePhysics call when not needed. Changed PID functions to inline. * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: Relocating TM-controlled vehicles near the hero vehicle * WIP: Vehicle teleportation near hero vehicle. Missing a way to place them in a better order around the map. Fixes non-deterministic seed setup. * Fixes bug where the hero vehicle was also set to not have physics. * Introduces parameter SetRespawnDormantVehicles WIP Respawning dormant vehicles * Fixed child-parent when waking up dormant actors. Added profiling traces. Fixed transformation of debug shapes in large maps. * WIP: renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Renaming FActorView to FCarlaActor. Changing calls related to FCarlaActor to acomodate new typing. * Now traffic lights can be spawned without controllers inside junctions. * Added functions to interface the FCarlaActor object with recorder. Started adapting recorder to new FCarlaActor object. * Fixed missing includes. * Updated CarlaRecorder and CarlaReplayer to use new FCarlaActor interface for vehicles, walkers and sensors. * Fixed missing includes. * Streaming level list now is persistant and can be saved for unreal to detect the dependencies. * Enabled packages for large maps. * Added Tiles to the MapPath.txt file. Removed debug warnings. * WIP: Fix seed when setting deterministic mode. WIP: Respawn actors when dormant Added --hero and --respawn to spawn_npc.py * Fixed traffic light trigger box placement in large maps. * Fixed traffic light warning. Set speed limit for dormant actors to 30. Fixed semantic segmentation on streaming levels. * added server bind for set_respawn_dormant_vehicles parameter * TM doesn't destroy hero vehicle if idle. ALSM stage will now update hero vehicles first. MP stage will treat dormant vehicles like physics-less in hybrid mode. Added fixed seed increment in deterministic mode. * Fixed Traffic Light issue with recorder and dormant state. Removed old ActorView files. * handles scenario where the hero vehicle does not exist * Fixing line markings semantics * Fixed recorder issues with traffic lights. * Filter out the base large map as available map * Added tile_stream_distance and actor_stream_distance to world settings. * removed unused comments. * Added IsActive functions. Dormant actors that cannot be respawned now remain dormant. * Fixed missing includes. * Fixed missing includes * Review fixes. Missing includes. * Fixed link errors. * Fixes issue with Hybrid mode in async mode. Introduces new set_boundaries_respawn_dormant_vehicles parameter. Fixes issue when reloading map. * WIP: New algorithm to move vehicles from dormant to active * Finished new policy for teleporting vehicles. Created new generate_traffic.py script, which works in sync mode. Removed spawn_npc.py script. General cleanup in Traffic Manager. * Cleanup. * Set FXAA antialiasing method * Added automatic generation of speed limit signals. * Adding some includes * Fixed speed limit component crash when waking up. * Fixed speed limit component wrong check. * Fixed speed limit not reset when waking up actors. * Fixed generating waypoints when angle is tight * Added warning when using asynchronous mode in generate traffic. Lane changes now require more space. Vehicle switching from no physics to physics in hybrid mode will have an initial speed. Changed lower bound to 20 meters for respawn in Large Maps. * Calculating TLStage even when dormant Co-authored-by: doterop <daniel.oterop@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Joel Moriana <joel.moriana@gmail.com> Co-authored-by: Axel1092 <lopez1092@hotmail.com> Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com>
2021-07-15 21:58:28 +08:00
settings.no_rendering_mode = False
Doterop/traffic manager (#2468) * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * adding section id to map setup * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Print removal * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Server side changes ... * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Initial implementation of t.m. performance script * Remove redundant getLocation() calls * Demo for inter-client communication via Carla server * WIP: To do: For client usage needed to be changed. * Instead or client instance episodeProxy is passed to TM * Instead or client instance episodeProxy is passed to TM * parmeter improvements (walkers,cars,signs,lights) * fix manual_control to reload car with autopilot on * Instead of client instance episodeProxy is passed to TM. * WIP: Only added vehicle register via RPC server / client call in TM to local instance from remote instance. Similarly other APIs we need to added. * Added all TM APIs * carla client now can provide TM instance if required. * While getting TM instance if server given data is not valid new TM instace is created. Need to decide what to do with earlier registed vehicle with previous TM. * Updated with HealthCheckRemoteTM() function to check TM server status instead of ResetAllTrafficLights() for any new user client. * Dynamic port selection added to TM server instace (in case of multiple TM serve run, it required). * Fixed change map error * If registered TM at carla server is not present then remote TM should be freed and new local TM instance is created. * Created Process for Local TM. It cheaks with total registered vehicles in it, if no register vehicles for 5 sec, it closes it self. In python spawn_npc.py Client Timeout set to 10 sec. as creating Process is system dependent call and takes time. User has to unregister vehicle before destroying it (if activated with TM). Also neet to check TM unregister function to remove vehicles from register list. * Fix for collision ignore bug * Update TM exit function check to compare registered vehicles with world actors that if any valid vehicle present cointinue to run the TM else stop. * Splited work of main for loop in ApplyBatchCommandsSync * WIP! Trying to get client directly * WIP! Trying to access episode properly without getting it from TM ctr * Changes to BatchControlStage for Sync Mode Changes to Parameters for Synch Mode * Added port support for TM. Multiclient MultiTM * Added additions for RPC Synchronous Tick to TM. Error handeling and code organization. * Exposed API for Sync Mode * TMServer notifies Server that it is gonna be destroyed * Exposed Python API for Sync Mode * Add TM as separate process and synchronous tick calls * SetSynchronousModeTimeOutInMiliSecond method added * TM shutsdown and informs to the connected clients * WIP! Map change issues again * Updated Traffic Manager for: 1) Multi-client, Multi-TM (as required) can be reistered to server. 2) TM is not a PROCESS separated from the user-client. 3) TM will exit if user-client exit. 4) If server closed, TM also get closed by catching runtime err. * Fixed possible stall on TM destruction * fixing collision stage + cybertruck not safe * Merge branch 'master' into 'soumyadeep/traffic_manager' * WIP! Disconnection of server has to be properly handled by clients * format update * Fix bug unsignalized junctions * # WARNING: head commit changed in the meantime Merge branch 'doterop/traffic_manager' into soumyadeep/traffic_manager Updates for Syncronized Tick. * Updated runtime exception in Episode for smooth exit if TN server closed for any other user client. * Better Exception handeling * Merged with jackbart94/tm_reduce_getloc_calls * Merged soumyadeep/traffic_manager. Removed World getter and recovered Episode as a parameter of TM ctr. Fixed syntax errors. * Rebased with master * Changes after rebase * Solving tab errors * Updated Changelog * Removing Destroyed vehicle's from TM Server * Fixed uint compatibility with Windows * Merged soumyadeep/traffic_manager. Discarded destroyed actors * -Removed unnecessary files * restoring docs from rebase * Fix windows compilation * refactoring stage-related code * more code refactoring * When map change the simulation doesn't throw exception anymore * Fixed incorrect episode * Fixed map change and TM remote detached thread destruction * Syntax and comments fixes * Missed change on previous commit * Fixed compile minor compile issue * Cleaned and fixed some issues after merge * fix to sync localization bugs modified PID parameters revamping spawn_npc * deleted tm_spawn_npc * fixes spawn error in sync mode * Redoing TM sync logic * finished performance benchmark for tm * deprecated wrapped methods: register_vehicle unregister_vehicle * New TM management * Fixed sync mode on TM * Cleaned TM of prints and unussed functions * collision stage checks for (0,0,0) to ignore. in memory map has an # between keys to avoid possible mixup. fixed spawn_npc with new sync mode * changelog * added more connection retries * fixed changelog + comments (see reviewable) * Moved socket include's to single header * Added missing line at the end of the file * Fixed syntax errors * final commit * Minor correction in comment * update copyright year to 2020 + removed break * restoring unwanted changes * patch for smoke test error * Removed "todo" for pylint Co-authored-by: Jacopo Bartiromo <32928804+jackbart94@users.noreply.github.com> Co-authored-by: Praveen Kumar <35625166+pravinblaze@users.noreply.github.com> Co-authored-by: Soumyadeep <soumyadeep.dhar@kpit.com> Co-authored-by: joel-mb <joel.moriana@gmail.com> Co-authored-by: Sekhar Barua <58979936+sekhar2912@users.noreply.github.com> Co-authored-by: bernat <bernatx@gmail.com> Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
2020-02-29 02:58:13 +08:00
settings.fixed_delta_seconds = None
world.apply_settings(settings)
print('\ndestroying %d vehicles' % len(vehicles_list))
client.apply_batch([carla.command.DestroyActor(x) for x in vehicles_list])
2018-10-29 00:46:37 +08:00
# stop walker controllers (list is [controller, actor, controller, actor ...])
2019-06-19 16:22:27 +08:00
for i in range(0, len(all_id), 2):
all_actors[i].stop()
print('\ndestroying %d walkers' % len(walkers_list))
2019-06-14 18:40:30 +08:00
client.apply_batch([carla.command.DestroyActor(x) for x in all_id])
2019-11-20 17:59:00 +08:00
time.sleep(0.5)
2019-06-21 18:26:00 +08:00
2018-10-29 00:46:37 +08:00
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
pass
finally:
print('\ndone.')