updated Index page, rearranged nav bar, corrected links to broken images, corrected default settings for wheel physics, added anysys rtr information
This commit is contained in:
parent
374b1dd3e6
commit
dca7cc3f8d
|
@ -127,7 +127,7 @@ Every object on a CARLA map has a set of associated variables which can be found
|
||||||
|
|
||||||
See an example of distinct objects being toggled:
|
See an example of distinct objects being toggled:
|
||||||
|
|
||||||
![toggle_objects_gif](/img/objects_small.gif)
|
![toggle_objects_gif](img/objects_small.gif)
|
||||||
|
|
||||||
[env_obj]: https://carla.readthedocs.io/en/latest/python_api/#carla.EnvironmentObject
|
[env_obj]: https://carla.readthedocs.io/en/latest/python_api/#carla.EnvironmentObject
|
||||||
[env_obj_id]: https://carla.readthedocs.io/en/latest/python_api/#carla.EnvironmentObject.id
|
[env_obj_id]: https://carla.readthedocs.io/en/latest/python_api/#carla.EnvironmentObject.id
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Ansys Real Time Radar Model: Training a Vehicle Longitudinal Controller Using Reinforcement Learning
|
||||||
|
|
||||||
|
In a webinair series in April 2021, [Ansys](https://www.ansys.com/) presented the details of their integration of the Ansys Real Time Radar (RTR) with the CARLA simulator. Here you can download and view the presentation slides and videos that accompanied the webinair.
|
||||||
|
|
||||||
|
The presentation details how the RTR was integrated with CARLA to train a vehicle longitudinal controller using reinforcement learning and includes the model, action space and reward policy used. The videos show the results of the training in the CARLA simulator.
|
||||||
|
|
||||||
|
View the presentation [here](https://drive.google.com/file/d/1xtGaI8Ls6C8Jh-PQvKRrLKs6c3ri3WQ2/view) and the videos [here](https://drive.google.com/file/d/1whHE1MKhzQtW3jj4dJCW6A3mCjUnNaJI/view).
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
After Width: | Height: | Size: 114 KiB |
|
@ -24,7 +24,7 @@ CARLA forum</a>
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
[__Introduction__](start_introduction.md) — What to expect from CARLA.
|
[__Introduction__](start_introduction.md) — What to expect from CARLA.
|
||||||
[__Quick start__](start_quickstart.md) — Get the CARLA releases.
|
[__Quick start package installation__](start_quickstart.md) — Get the CARLA releases.
|
||||||
|
|
||||||
|
|
||||||
## Building CARLA
|
## Building CARLA
|
||||||
|
@ -33,7 +33,7 @@ CARLA forum</a>
|
||||||
[__Windows build__](build_windows.md) — Make the build on Windows.
|
[__Windows build__](build_windows.md) — Make the build on Windows.
|
||||||
[__Update CARLA__](build_update.md) — Get up to date with the latest content.
|
[__Update CARLA__](build_update.md) — Get up to date with the latest content.
|
||||||
[__Build system__](build_system.md) — Learn about the build and how it is made.
|
[__Build system__](build_system.md) — Learn about the build and how it is made.
|
||||||
[__Running in a Docker__](build_docker.md) — Run CARLA using a container solution.
|
[__CARLA in Docker__](build_docker.md) — Run CARLA using a container solution.
|
||||||
[__F.A.Q.__](build_faq.md) — Some of the most frequent installation issues.
|
[__F.A.Q.__](build_faq.md) — Some of the most frequent installation issues.
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,17 +44,23 @@ CARLA forum</a>
|
||||||
[__3rd. Maps and navigation__](core_map.md) — Discover the different maps and how do vehicles move around.
|
[__3rd. Maps and navigation__](core_map.md) — Discover the different maps and how do vehicles move around.
|
||||||
[__4th. Sensors and data__](core_sensors.md) — Retrieve simulation data using sensors.
|
[__4th. Sensors and data__](core_sensors.md) — Retrieve simulation data using sensors.
|
||||||
|
|
||||||
## Advanced steps
|
## Advanced concepts
|
||||||
[__OpenDRIVE standalone mode__](adv_opendrive.md) — Use any OpenDRIVE file as a CARLA map.
|
[__OpenDRIVE standalone mode__](adv_opendrive.md) — Use any OpenDRIVE file as a CARLA map.
|
||||||
[__PTV-Vissim co-simulation__](adv_ptv.md) — Run a synchronous simulation between CARLA and PTV-Vissim.
|
[__PTV-Vissim co-simulation__](adv_ptv.md) — Run a synchronous simulation between CARLA and PTV-Vissim.
|
||||||
[__Recorder__](adv_recorder.md) — Register the events in a simulation and play it again.
|
[__Recorder__](adv_recorder.md) — Register the events in a simulation and play it again.
|
||||||
[__Rendering options__](adv_rendering_options.md) — From quality settings to no-render or off-screen modes.
|
[__Rendering options__](adv_rendering_options.md) — From quality settings to no-render or off-screen modes.
|
||||||
[__RSS__](adv_rss.md) — An implementation of RSS in the CARLA client library.
|
[__RSS__](adv_rss.md) — An implementation of RSS in the CARLA client library.
|
||||||
[__SUMO co-simulation__](adv_sumo.md) — Run a synchronous simulation between CARLA and SUMO.
|
|
||||||
[__Synchrony and time-step__](adv_synchrony_timestep.md) — Client-server communication and simulation time.
|
[__Synchrony and time-step__](adv_synchrony_timestep.md) — Client-server communication and simulation time.
|
||||||
[__Traffic Manager__](adv_traffic_manager.md) — Simulate urban traffic by setting vehicles to autopilot mode.
|
[__Benchmarking Performance__](adv_benchmarking.md) — Perform benchmarking using our prepared script.
|
||||||
[__CARLA Agents__](adv_agents.md) — Agents scripts allow single vehicles to roam the map or drive to a set destination.
|
[__CARLA Agents__](adv_agents.md) — Agents scripts allow single vehicles to roam the map or drive to a set destination.
|
||||||
|
|
||||||
|
## Traffic Simulation
|
||||||
|
|
||||||
|
[__ Traffic Simulation Overview__](ts_traffic_simulation_overview.md) — An overview of the different options available to populate your scenes with traffic
|
||||||
|
[__Traffic Manager__](adv_traffic_manager.md) — Simulate urban traffic by setting vehicles to autopilot mode.
|
||||||
|
[__SUMO co-simulation__](adv_sumo.md) — Run a synchronous simulation between CARLA and SUMO.
|
||||||
|
[__Scenic__](tuto_G_scenic.md) — Follow an example of defining different scenarios using the Scenic library.
|
||||||
|
|
||||||
## References
|
## References
|
||||||
[__Python API reference__](python_api.md) — Classes and methods in the Python API.
|
[__Python API reference__](python_api.md) — Classes and methods in the Python API.
|
||||||
[__Blueprint library__](bp_library.md) — Blueprints provided to spawn actors.
|
[__Blueprint library__](bp_library.md) — Blueprints provided to spawn actors.
|
||||||
|
@ -67,6 +73,27 @@ CARLA forum</a>
|
||||||
|
|
||||||
## ROS bridge
|
## ROS bridge
|
||||||
[__ROS bridge documentation__](ros_documentation.md) — Brief overview of the ROS bridge and a link to the full documentation
|
[__ROS bridge documentation__](ros_documentation.md) — Brief overview of the ROS bridge and a link to the full documentation
|
||||||
|
|
||||||
|
## Custom Maps
|
||||||
|
|
||||||
|
[__Overview of custom maps in CARLA__](tuto_M_custom_map_overview.md) — An overview of the process and options involved in adding a custom, standard sized map
|
||||||
|
[__Create a map in RoadRunner__](tuto_M_generate_map.md) — How to generate a customs, standard sized map in RoadRunner
|
||||||
|
[__ Import map in CARLA package__](tuto_M_add_map_package.md) How to import a map in a CARLA package
|
||||||
|
[__Import map in CARLA source build__](tuto_M_add_map_source.md) — How to import a map in CARLA built from source
|
||||||
|
[__Alternative ways to import maps__](tuto_M_add_map_alternative.md) — Alternative methods to import maps
|
||||||
|
[__ Manually prepare map package__](tuto_M_manual_map_package.md) — How to prepare a map for manual import
|
||||||
|
[__Customizing maps: Layered maps__](tuto_M_custom_layers.md) — How to create sub-layers in your custom map
|
||||||
|
[__ Customizing maps: Traffic lights and signs__](tuto_M_custom_add_tl.md) — How to add traffic lights and signs to your custom map
|
||||||
|
[__ Customizing maps: Road painter__](tuto_M_custom_road_painter.md) — How to use the road painter tool to change the apearance of the road
|
||||||
|
[__Customizing Maps: Procedural Buildings__](tuto_M_custom_buildings.md) — Populate your custom map with buildings
|
||||||
|
[__ Customizing maps: Weather and landscape__](tuto_M_custom_weather_landscape.md) — Create the weather profile for your custom map and populate the landscape
|
||||||
|
[__Generate pedestrian navigation__](tuto_M_generate_pedestrian_navigation.md) — Obtain the information needed for walkers to move around.
|
||||||
|
|
||||||
|
## Large Maps
|
||||||
|
|
||||||
|
[__Large maps overview__](large_map_overview.md) — An explanation of how large maps work in CARLA
|
||||||
|
[__Create a Large Map in RoadRunner__](large_map_roadrunner.md) — How to create a large map in RoadRunner
|
||||||
|
[__Import/Package a Large Map__](large_map_import.md) — How to import a large map
|
||||||
## Tutorials — General
|
## Tutorials — General
|
||||||
[__Add friction triggers__](tuto_G_add_friction_triggers.md) — Define dynamic box triggers for wheels.
|
[__Add friction triggers__](tuto_G_add_friction_triggers.md) — Define dynamic box triggers for wheels.
|
||||||
[__Control vehicle physics__](tuto_G_control_vehicle_physics.md) — Set runtime changes on a vehicle physics.
|
[__Control vehicle physics__](tuto_G_control_vehicle_physics.md) — Set runtime changes on a vehicle physics.
|
||||||
|
@ -75,31 +102,26 @@ CARLA forum</a>
|
||||||
[__Retrieve simulation data__](tuto_G_retrieve_data.md) — A step by step guide to properly gather data using the recorder.
|
[__Retrieve simulation data__](tuto_G_retrieve_data.md) — A step by step guide to properly gather data using the recorder.
|
||||||
[__CarSim Integration (Beta)__](tuto_G_carsim_integration.md) — Tutorial on how to run a simulation using the CarSim vehicle dynamics engine.
|
[__CarSim Integration (Beta)__](tuto_G_carsim_integration.md) — Tutorial on how to run a simulation using the CarSim vehicle dynamics engine.
|
||||||
[__RLlib Integration__](tuto_G_rllib_integration.md) — Find out how to run your own experiment using the RLlib library.
|
[__RLlib Integration__](tuto_G_rllib_integration.md) — Find out how to run your own experiment using the RLlib library.
|
||||||
[__Scenic__](tuto_G_scenic.md) — Follow an example of defining different scenarios using the Scenic library.
|
[__Chrono Integration__](tuto_G_chrono.md) — Use the Chrono integration to simulation physics
|
||||||
|
[__Build Unreal Engine and CARLA in Docker__](build_docker_unreal.md) — Build Unreal Engine and CARLA in Docker
|
||||||
## Tutorials — Maps
|
|
||||||
[__Overview of custom maps__](tuto_M_custom_map_overview.md)
|
|
||||||
[__Create a map in RoadRunner__](tuto_M_generate_map.md)
|
|
||||||
[__Import map in CARLA package__](tuto_M_add_map_package.md)
|
|
||||||
[__Import map in CARLA source build__](tuto_M_add_map_source.md)
|
|
||||||
[__Manually prepare map package__](tuto_M_manual_map_package.md)
|
|
||||||
[__Alternative map section__](tuto_M_add_map_alternative.md)
|
|
||||||
[__Generate pedestrian navigation__](tuto_M_generate_pedestrian_navigation.md) — Obtain the information needed for walkers to move around.
|
|
||||||
|
|
||||||
## Tutorials — Assets
|
## Tutorials — Assets
|
||||||
[__Add a new vehicle__](tuto_A_add_vehicle.md) — Prepare a vehicle to be used in CARLA.
|
[__Add a new vehicle__](tuto_A_add_vehicle.md) — Prepare a vehicle to be used in CARLA.
|
||||||
[__Add new props__](tuto_A_add_props.md) — Import additional props into CARLA.
|
[__Add new props__](tuto_A_add_props.md) — Import additional props into CARLA.
|
||||||
[__Create standalone packages__](tuto_A_create_standalone.md) — Generate and handle standalone packages for assets.
|
[__Create standalone packages__](tuto_A_create_standalone.md) — Generate and handle standalone packages for assets.
|
||||||
[__Map customization__](tuto_A_map_customization.md) — Edit an existing map.
|
|
||||||
[__Material customization__](tuto_A_material_customization.md) — Edit vehicle and building materials.
|
[__Material customization__](tuto_A_material_customization.md) — Edit vehicle and building materials.
|
||||||
|
|
||||||
## Tutorials — Developers
|
## Tutorials — Developers
|
||||||
[__Contribute with new assets__](tuto_D_contribute_assets.md) — Add new content to CARLA.
|
[__How to upgrade content__](tuto_D_contribute_assets.md) — Add new content to CARLA.
|
||||||
[__Create a sensor__](tuto_D_create_sensor.md) — Develop a new sensor to be used in CARLA.
|
[__Create a sensor__](tuto_D_create_sensor.md) — Develop a new sensor to be used in CARLA.
|
||||||
[__Create semantic tags__](tuto_D_create_semantic_tags.md) — Define customized tags for semantic segmentation.
|
[__Create semantic tags__](tuto_D_create_semantic_tags.md) — Define customized tags for semantic segmentation.
|
||||||
[__Customize vehicle suspension__](tuto_D_customize_vehicle_suspension.md) — Modify the suspension system of a vehicle.
|
[__Customize vehicle suspension__](tuto_D_customize_vehicle_suspension.md) — Modify the suspension system of a vehicle.
|
||||||
[__Generate detailed colliders__](tuto_D_generate_colliders.md) — Create detailed colliders for vehicles.
|
[__Generate detailed colliders__](tuto_D_generate_colliders.md) — Create detailed colliders for vehicles.
|
||||||
|
[__Make a release__](tuto_D_make_release.md) — How to make a release of CARLA
|
||||||
|
|
||||||
|
## CARLA Ecosystem
|
||||||
|
|
||||||
|
[__Ansys Real Time Radar Model__](ecosys_ansys.md) — Details about the Ansys RTR Webinair
|
||||||
## Contributing
|
## Contributing
|
||||||
[__Contribution guidelines__](cont_contribution_guidelines.md) — The different ways to contribute to CARLA.
|
[__Contribution guidelines__](cont_contribution_guidelines.md) — The different ways to contribute to CARLA.
|
||||||
[__Code of conduct__](cont_code_of_conduct.md) — Standard rights and duties for contributors.
|
[__Code of conduct__](cont_code_of_conduct.md) — Standard rights and duties for contributors.
|
||||||
|
|
|
@ -37,6 +37,7 @@ The specifics of how to build a large map in RoadRunner go beyond the scope of t
|
||||||
If you are building a large map with elevation, the recommended largest size of the map is 20km by 20km. Maps larger than this may cause RoadRunner to crash on export.
|
If you are building a large map with elevation, the recommended largest size of the map is 20km by 20km. Maps larger than this may cause RoadRunner to crash on export.
|
||||||
|
|
||||||
[rr_tutorials]: https://www.mathworks.com/support/search.html?fq=asset_type_name:video%20category:roadrunner/index&page=1&s_tid=CRUX_topnav
|
[rr_tutorials]: https://www.mathworks.com/support/search.html?fq=asset_type_name:video%20category:roadrunner/index&page=1&s_tid=CRUX_topnav
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Export a large map in RoadRunner
|
## Export a large map in RoadRunner
|
||||||
|
|
|
@ -2942,11 +2942,11 @@ Maximum handbrake torque.
|
||||||
- <a name="carla.WheelPhysicsControl.position"></a>**<font color="#f8805a">position</font>** (_[carla.Vector3D](#carla.Vector3D)_)
|
- <a name="carla.WheelPhysicsControl.position"></a>**<font color="#f8805a">position</font>** (_[carla.Vector3D](#carla.Vector3D)_)
|
||||||
World position of the wheel. This is a read-only parameter.
|
World position of the wheel. This is a read-only parameter.
|
||||||
- <a name="carla.WheelPhysicsControl.long_stiff_value"></a>**<font color="#f8805a">long_stiff_value</font>** (_float<small> – kg per radian</small>_)
|
- <a name="carla.WheelPhysicsControl.long_stiff_value"></a>**<font color="#f8805a">long_stiff_value</font>** (_float<small> – kg per radian</small>_)
|
||||||
Tire longitudinal stiffness per unit gravitational acceleration. __Default__ is `1000.0`.
|
Tire longitudinal stiffness per unit gravitational acceleration. Each vehicle has a custom value.
|
||||||
- <a name="carla.WheelPhysicsControl.lat_stiff_max_load"></a>**<font color="#f8805a">lat_stiff_max_load</font>** (_float_)
|
- <a name="carla.WheelPhysicsControl.lat_stiff_max_load"></a>**<font color="#f8805a">lat_stiff_max_load</font>** (_float_)
|
||||||
Maximum normalized tire load at which the tire can deliver no more lateral stiffness no matter how much extra load is applied to the tire. __Default__ is `2.0`.
|
Maximum normalized tire load at which the tire can deliver no more lateral stiffness no matter how much extra load is applied to the tire. Each vehicle has a custom value.
|
||||||
- <a name="carla.WheelPhysicsControl.lat_stiff_value"></a>**<font color="#f8805a">lat_stiff_value</font>** (_float_)
|
- <a name="carla.WheelPhysicsControl.lat_stiff_value"></a>**<font color="#f8805a">lat_stiff_value</font>** (_float_)
|
||||||
Maximum stiffness per unit of lateral slip. __Default__ is `17.0`.
|
Maximum stiffness per unit of lateral slip. Each vehicle has a custom value.
|
||||||
|
|
||||||
### Methods
|
### Methods
|
||||||
- <a name="carla.WheelPhysicsControl.__init__"></a>**<font color="#7fb800">\__init__</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**tire_friction**=2.0</font>, <font color="#00a6ed">**damping_rate**=0.25</font>, <font color="#00a6ed">**max_steer_angle**=70.0</font>, <font color="#00a6ed">**radius**=30.0</font>, <font color="#00a6ed">**max_brake_torque**=1500.0</font>, <font color="#00a6ed">**max_handbrake_torque**=3000.0</font>, <font color="#00a6ed">**position**=(0.0,0.0,0.0)</font>)
|
- <a name="carla.WheelPhysicsControl.__init__"></a>**<font color="#7fb800">\__init__</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**tire_friction**=2.0</font>, <font color="#00a6ed">**damping_rate**=0.25</font>, <font color="#00a6ed">**max_steer_angle**=70.0</font>, <font color="#00a6ed">**radius**=30.0</font>, <font color="#00a6ed">**max_brake_torque**=1500.0</font>, <font color="#00a6ed">**max_handbrake_torque**=3000.0</font>, <font color="#00a6ed">**position**=(0.0,0.0,0.0)</font>)
|
||||||
|
@ -3600,37 +3600,174 @@ document.getElementById("snipets-container").innerHTML = null;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id ="carla.ActorBlueprint.set_attribute-snipet" style="display: none;">
|
<div id ="carla.World.load_map_layer-snipet" style="display: none;">
|
||||||
<p class="SnipetFont">
|
<p class="SnipetFont">
|
||||||
Snippet for carla.ActorBlueprint.set_attribute
|
Snippet for carla.World.load_map_layer
|
||||||
</p>
|
</p>
|
||||||
<div id="carla.ActorBlueprint.set_attribute-code" class="SnipetContent">
|
<div id="carla.World.load_map_layer-code" class="SnipetContent">
|
||||||
|
|
||||||
|
```py
|
||||||
|
|
||||||
|
# This recipe toggles on several layers in our "_Opt" maps
|
||||||
|
|
||||||
|
# Load town one with only minimum layout (roads, sidewalks, traffic lights and traffic signs)
|
||||||
|
world = client.load_world('Town01_Opt', carla.MapLayer.None)
|
||||||
|
|
||||||
|
# Toggle all buildings on
|
||||||
|
world.load_map_layer(carla.MapLayer.Buildings)
|
||||||
|
|
||||||
|
# Toggle all foliage on
|
||||||
|
world.load_map_layer(carla.MapLayer.Foliage)
|
||||||
|
|
||||||
|
# Toggle all parked vehicles on
|
||||||
|
world.load_map_layer(carla.MapLayer.ParkedVehicles)
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.load_map_layer-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id ="carla.World.unload_map_layer-snipet" style="display: none;">
|
||||||
|
<p class="SnipetFont">
|
||||||
|
Snippet for carla.World.unload_map_layer
|
||||||
|
</p>
|
||||||
|
<div id="carla.World.unload_map_layer-code" class="SnipetContent">
|
||||||
|
|
||||||
|
```py
|
||||||
|
|
||||||
|
# This recipe toggles off several layers in our "_Opt" maps
|
||||||
|
|
||||||
|
# Load town one with minimum layout (roads, sidewalks, traffic lights and traffic signs)
|
||||||
|
# as well as buildings and parked vehicles
|
||||||
|
world = client.load_world('Town01_Opt', carla.MapLayer.Buildings | carla.MapLayer.ParkedVehicles)
|
||||||
|
|
||||||
|
# Toggle all buildings off
|
||||||
|
world.unload_map_layer(carla.MapLayer.Buildings)
|
||||||
|
|
||||||
|
# Toggle all parked vehicles off
|
||||||
|
world.unload_map_layer(carla.MapLayer.ParkedVehicles)
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.unload_map_layer-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id ="carla.Map.get_waypoint-snipet" style="display: none;">
|
||||||
|
<p class="SnipetFont">
|
||||||
|
Snippet for carla.Map.get_waypoint
|
||||||
|
</p>
|
||||||
|
<div id="carla.Map.get_waypoint-code" class="SnipetContent">
|
||||||
|
|
||||||
```py
|
```py
|
||||||
|
|
||||||
|
|
||||||
# This recipe changes attributes of different type of blueprint actors.
|
# This recipe shows the current traffic rules affecting the vehicle.
|
||||||
|
# Shows the current lane type and if a lane change can be done in the actual lane or the surrounding ones.
|
||||||
|
|
||||||
# ...
|
# ...
|
||||||
walker_bp = world.get_blueprint_library().filter('walker.pedestrian.0002')
|
waypoint = world.get_map().get_waypoint(vehicle.get_location(),project_to_road=True, lane_type=(carla.LaneType.Driving | carla.LaneType.Shoulder | carla.LaneType.Sidewalk))
|
||||||
walker_bp.set_attribute('is_invincible', True)
|
print("Current lane type: " + str(waypoint.lane_type))
|
||||||
|
# Check current lane change allowed
|
||||||
# ...
|
print("Current Lane change: " + str(waypoint.lane_change))
|
||||||
# Changes attribute randomly by the recommended value
|
# Left and Right lane markings
|
||||||
vehicle_bp = wolrd.get_blueprint_library().filter('vehicle.bmw.*')
|
print("L lane marking type: " + str(waypoint.left_lane_marking.type))
|
||||||
color = random.choice(vehicle_bp.get_attribute('color').recommended_values)
|
print("L lane marking change: " + str(waypoint.left_lane_marking.lane_change))
|
||||||
vehicle_bp.set_attribute('color', color)
|
print("R lane marking type: " + str(waypoint.right_lane_marking.type))
|
||||||
|
print("R lane marking change: " + str(waypoint.right_lane_marking.lane_change))
|
||||||
# ...
|
|
||||||
|
|
||||||
camera_bp = world.get_blueprint_library().filter('sensor.camera.rgb')
|
|
||||||
camera_bp.set_attribute('image_size_x', 600)
|
|
||||||
camera_bp.set_attribute('image_size_y', 600)
|
|
||||||
# ...
|
# ...
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.ActorBlueprint.set_attribute-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Map.get_waypoint-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
||||||
|
|
||||||
|
|
||||||
|
<img src="/img/snipets_images/carla.Map.get_waypoint.jpg">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id ="carla.World.get_spectator-snipet" style="display: none;">
|
||||||
|
<p class="SnipetFont">
|
||||||
|
Snippet for carla.World.get_spectator
|
||||||
|
</p>
|
||||||
|
<div id="carla.World.get_spectator-code" class="SnipetContent">
|
||||||
|
|
||||||
|
```py
|
||||||
|
|
||||||
|
|
||||||
|
# This recipe spawns an actor and the spectator camera at the actor's location.
|
||||||
|
|
||||||
|
# ...
|
||||||
|
world = client.get_world()
|
||||||
|
spectator = world.get_spectator()
|
||||||
|
|
||||||
|
vehicle_bp = random.choice(world.get_blueprint_library().filter('vehicle.bmw.*'))
|
||||||
|
transform = random.choice(world.get_map().get_spawn_points())
|
||||||
|
vehicle = world.try_spawn_actor(vehicle_bp, transform)
|
||||||
|
|
||||||
|
# Wait for world to get the vehicle actor
|
||||||
|
world.tick()
|
||||||
|
|
||||||
|
world_snapshot = world.wait_for_tick()
|
||||||
|
actor_snapshot = world_snapshot.find(vehicle.id)
|
||||||
|
|
||||||
|
# Set spectator at given transform (vehicle transform)
|
||||||
|
spectator.set_transform(actor_snapshot.get_transform())
|
||||||
|
# ...
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.get_spectator-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id ="carla.WalkerAIController.stop-snipet" style="display: none;">
|
||||||
|
<p class="SnipetFont">
|
||||||
|
Snippet for carla.WalkerAIController.stop
|
||||||
|
</p>
|
||||||
|
<div id="carla.WalkerAIController.stop-code" class="SnipetContent">
|
||||||
|
|
||||||
|
```py
|
||||||
|
|
||||||
|
|
||||||
|
#To destroy the pedestrians, stop them from the navigation, and then destroy the objects (actor and controller).
|
||||||
|
|
||||||
|
# stop pedestrians (list is [controller, actor, controller, actor ...])
|
||||||
|
for i in range(0, len(all_id), 2):
|
||||||
|
all_actors[i].stop()
|
||||||
|
|
||||||
|
# destroy pedestrian (actor and controller)
|
||||||
|
client.apply_batch([carla.command.DestroyActor(x) for x in all_id])
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.WalkerAIController.stop-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id ="carla.World.spawn_actor-snipet" style="display: none;">
|
||||||
|
<p class="SnipetFont">
|
||||||
|
Snippet for carla.World.spawn_actor
|
||||||
|
</p>
|
||||||
|
<div id="carla.World.spawn_actor-code" class="SnipetContent">
|
||||||
|
|
||||||
|
```py
|
||||||
|
|
||||||
|
|
||||||
|
# This recipe attaches different camera / sensors to a vehicle with different attachments.
|
||||||
|
|
||||||
|
# ...
|
||||||
|
camera = world.spawn_actor(rgb_camera_bp, transform, attach_to=vehicle, attachment_type=Attachment.Rigid)
|
||||||
|
# Default attachment: Attachment.Rigid
|
||||||
|
gnss_sensor = world.spawn_actor(sensor_gnss_bp, transform, attach_to=vehicle)
|
||||||
|
collision_sensor = world.spawn_actor(sensor_collision_bp, transform, attach_to=vehicle)
|
||||||
|
lane_invasion_sensor = world.spawn_actor(sensor_lane_invasion_bp, transform, attach_to=vehicle)
|
||||||
|
# ...
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.spawn_actor-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -3707,48 +3844,37 @@ for i in range(0, len(all_actors), 2):
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id ="carla.Client.__init__-snipet" style="display: none;">
|
<div id ="carla.ActorBlueprint.set_attribute-snipet" style="display: none;">
|
||||||
<p class="SnipetFont">
|
<p class="SnipetFont">
|
||||||
Snippet for carla.Client.__init__
|
Snippet for carla.ActorBlueprint.set_attribute
|
||||||
</p>
|
</p>
|
||||||
<div id="carla.Client.__init__-code" class="SnipetContent">
|
<div id="carla.ActorBlueprint.set_attribute-code" class="SnipetContent">
|
||||||
|
|
||||||
```py
|
```py
|
||||||
|
|
||||||
|
|
||||||
# This recipe shows in every script provided in PythonAPI/Examples
|
# This recipe changes attributes of different type of blueprint actors.
|
||||||
# and it is used to parse the client creation arguments when running the script.
|
|
||||||
|
|
||||||
argparser = argparse.ArgumentParser(
|
# ...
|
||||||
description=__doc__)
|
walker_bp = world.get_blueprint_library().filter('walker.pedestrian.0002')
|
||||||
argparser.add_argument(
|
walker_bp.set_attribute('is_invincible', True)
|
||||||
'--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(
|
|
||||||
'-s', '--speed',
|
|
||||||
metavar='FACTOR',
|
|
||||||
default=1.0,
|
|
||||||
type=float,
|
|
||||||
help='rate at which the weather changes (default: 1.0)')
|
|
||||||
args = argparser.parse_args()
|
|
||||||
|
|
||||||
speed_factor = args.speed
|
# ...
|
||||||
update_freq = 0.1 / speed_factor
|
# Changes attribute randomly by the recommended value
|
||||||
|
vehicle_bp = wolrd.get_blueprint_library().filter('vehicle.bmw.*')
|
||||||
|
color = random.choice(vehicle_bp.get_attribute('color').recommended_values)
|
||||||
|
vehicle_bp.set_attribute('color', color)
|
||||||
|
|
||||||
client = carla.Client(args.host, args.port)
|
# ...
|
||||||
|
|
||||||
|
camera_bp = world.get_blueprint_library().filter('sensor.camera.rgb')
|
||||||
|
camera_bp.set_attribute('image_size_x', 600)
|
||||||
|
camera_bp.set_attribute('image_size_y', 600)
|
||||||
|
# ...
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Client.__init__-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.ActorBlueprint.set_attribute-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -3783,6 +3909,50 @@ for actor_snapshot in world_snapshot:
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id ="carla.Sensor.listen-snipet" style="display: none;">
|
||||||
|
<p class="SnipetFont">
|
||||||
|
Snippet for carla.Sensor.listen
|
||||||
|
</p>
|
||||||
|
<div id="carla.Sensor.listen-code" class="SnipetContent">
|
||||||
|
|
||||||
|
```py
|
||||||
|
|
||||||
|
|
||||||
|
# This recipe applies a color conversion to the image taken by a camera sensor,
|
||||||
|
# so it is converted to a semantic segmentation image.
|
||||||
|
|
||||||
|
# ...
|
||||||
|
camera_bp = world.get_blueprint_library().filter('sensor.camera.semantic_segmentation')
|
||||||
|
# ...
|
||||||
|
cc = carla.ColorConverter.CityScapesPalette
|
||||||
|
camera.listen(lambda image: image.save_to_disk('output/%06d.png' % image.frame, cc))
|
||||||
|
# ...
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Sensor.listen-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id ="carla.Vehicle.set_wheel_steer_direction-snipet" style="display: none;">
|
||||||
|
<p class="SnipetFont">
|
||||||
|
Snippet for carla.Vehicle.set_wheel_steer_direction
|
||||||
|
</p>
|
||||||
|
<div id="carla.Vehicle.set_wheel_steer_direction-code" class="SnipetContent">
|
||||||
|
|
||||||
|
```py
|
||||||
|
|
||||||
|
# Sets the appearance of the vehicles front wheels to 40°. Vehicle physics will not be affected.
|
||||||
|
|
||||||
|
vehicle.set_wheel_steer_direction(carla.VehicleWheelLocation.FR_Wheel, 40.0)
|
||||||
|
vehicle.set_wheel_steer_direction(carla.VehicleWheelLocation.FL_Wheel, 40.0)
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Vehicle.set_wheel_steer_direction-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id ="carla.DebugHelper.draw_string-snipet" style="display: none;">
|
<div id ="carla.DebugHelper.draw_string-snipet" style="display: none;">
|
||||||
<p class="SnipetFont">
|
<p class="SnipetFont">
|
||||||
Snippet for carla.DebugHelper.draw_string
|
Snippet for carla.DebugHelper.draw_string
|
||||||
|
@ -3822,61 +3992,78 @@ while True:
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id ="carla.Map.get_waypoint-snipet" style="display: none;">
|
<div id ="carla.World.enable_environment_objects-snipet" style="display: none;">
|
||||||
<p class="SnipetFont">
|
<p class="SnipetFont">
|
||||||
Snippet for carla.Map.get_waypoint
|
Snippet for carla.World.enable_environment_objects
|
||||||
</p>
|
</p>
|
||||||
<div id="carla.Map.get_waypoint-code" class="SnipetContent">
|
<div id="carla.World.enable_environment_objects-code" class="SnipetContent">
|
||||||
|
|
||||||
```py
|
```py
|
||||||
|
|
||||||
|
# This recipe turn visibility off and on for two specifc buildings on the map
|
||||||
|
|
||||||
# This recipe shows the current traffic rules affecting the vehicle.
|
# Get the buildings in the world
|
||||||
# Shows the current lane type and if a lane change can be done in the actual lane or the surrounding ones.
|
world = client.get_world()
|
||||||
|
env_objs = world.get_environment_objects(carla.CityObjectLabel.Buildings)
|
||||||
|
|
||||||
# ...
|
# Access individual building IDs and save in a set
|
||||||
waypoint = world.get_map().get_waypoint(vehicle.get_location(),project_to_road=True, lane_type=(carla.LaneType.Driving | carla.LaneType.Shoulder | carla.LaneType.Sidewalk))
|
building_01 = env_objs[0]
|
||||||
print("Current lane type: " + str(waypoint.lane_type))
|
building_02 = env_objs[1]
|
||||||
# Check current lane change allowed
|
objects_to_toggle = {building_01.id, building_02.id}
|
||||||
print("Current Lane change: " + str(waypoint.lane_change))
|
|
||||||
# Left and Right lane markings
|
# Toggle buildings off
|
||||||
print("L lane marking type: " + str(waypoint.left_lane_marking.type))
|
world.enable_environment_objects(objects_to_toggle, False)
|
||||||
print("L lane marking change: " + str(waypoint.left_lane_marking.lane_change))
|
# Toggle buildings on
|
||||||
print("R lane marking type: " + str(waypoint.right_lane_marking.type))
|
world.enable_environment_objects(objects_to_toggle, True)
|
||||||
print("R lane marking change: " + str(waypoint.right_lane_marking.lane_change))
|
|
||||||
# ...
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Map.get_waypoint-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.enable_environment_objects-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
||||||
|
|
||||||
|
|
||||||
<img src="/img/snipets_images/carla.Map.get_waypoint.jpg">
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id ="carla.Sensor.listen-snipet" style="display: none;">
|
<div id ="carla.Client.__init__-snipet" style="display: none;">
|
||||||
<p class="SnipetFont">
|
<p class="SnipetFont">
|
||||||
Snippet for carla.Sensor.listen
|
Snippet for carla.Client.__init__
|
||||||
</p>
|
</p>
|
||||||
<div id="carla.Sensor.listen-code" class="SnipetContent">
|
<div id="carla.Client.__init__-code" class="SnipetContent">
|
||||||
|
|
||||||
```py
|
```py
|
||||||
|
|
||||||
|
|
||||||
# This recipe applies a color conversion to the image taken by a camera sensor,
|
# This recipe shows in every script provided in PythonAPI/Examples
|
||||||
# so it is converted to a semantic segmentation image.
|
# and it is used to parse the client creation arguments when running the script.
|
||||||
|
|
||||||
|
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(
|
||||||
|
'-s', '--speed',
|
||||||
|
metavar='FACTOR',
|
||||||
|
default=1.0,
|
||||||
|
type=float,
|
||||||
|
help='rate at which the weather changes (default: 1.0)')
|
||||||
|
args = argparser.parse_args()
|
||||||
|
|
||||||
|
speed_factor = args.speed
|
||||||
|
update_freq = 0.1 / speed_factor
|
||||||
|
|
||||||
|
client = carla.Client(args.host, args.port)
|
||||||
|
|
||||||
# ...
|
|
||||||
camera_bp = world.get_blueprint_library().filter('sensor.camera.semantic_segmentation')
|
|
||||||
# ...
|
|
||||||
cc = carla.ColorConverter.CityScapesPalette
|
|
||||||
camera.listen(lambda image: image.save_to_disk('output/%06d.png' % image.frame, cc))
|
|
||||||
# ...
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Sensor.listen-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Client.__init__-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -3926,193 +4113,6 @@ if vehicle_actor.is_at_traffic_light():
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id ="carla.Vehicle.set_wheel_steer_direction-snipet" style="display: none;">
|
|
||||||
<p class="SnipetFont">
|
|
||||||
Snippet for carla.Vehicle.set_wheel_steer_direction
|
|
||||||
</p>
|
|
||||||
<div id="carla.Vehicle.set_wheel_steer_direction-code" class="SnipetContent">
|
|
||||||
|
|
||||||
```py
|
|
||||||
|
|
||||||
# Sets the appearance of the vehicles front wheels to 40°. Vehicle physics will not be affected.
|
|
||||||
|
|
||||||
vehicle.set_wheel_steer_direction(carla.VehicleWheelLocation.FR_Wheel, 40.0)
|
|
||||||
vehicle.set_wheel_steer_direction(carla.VehicleWheelLocation.FL_Wheel, 40.0)
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Vehicle.set_wheel_steer_direction-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id ="carla.WalkerAIController.stop-snipet" style="display: none;">
|
|
||||||
<p class="SnipetFont">
|
|
||||||
Snippet for carla.WalkerAIController.stop
|
|
||||||
</p>
|
|
||||||
<div id="carla.WalkerAIController.stop-code" class="SnipetContent">
|
|
||||||
|
|
||||||
```py
|
|
||||||
|
|
||||||
|
|
||||||
#To destroy the pedestrians, stop them from the navigation, and then destroy the objects (actor and controller).
|
|
||||||
|
|
||||||
# stop pedestrians (list is [controller, actor, controller, actor ...])
|
|
||||||
for i in range(0, len(all_id), 2):
|
|
||||||
all_actors[i].stop()
|
|
||||||
|
|
||||||
# destroy pedestrian (actor and controller)
|
|
||||||
client.apply_batch([carla.command.DestroyActor(x) for x in all_id])
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.WalkerAIController.stop-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id ="carla.World.enable_environment_objects-snipet" style="display: none;">
|
|
||||||
<p class="SnipetFont">
|
|
||||||
Snippet for carla.World.enable_environment_objects
|
|
||||||
</p>
|
|
||||||
<div id="carla.World.enable_environment_objects-code" class="SnipetContent">
|
|
||||||
|
|
||||||
```py
|
|
||||||
|
|
||||||
# This recipe turn visibility off and on for two specifc buildings on the map
|
|
||||||
|
|
||||||
# Get the buildings in the world
|
|
||||||
world = client.get_world()
|
|
||||||
env_objs = world.get_environment_objects(carla.CityObjectLabel.Buildings)
|
|
||||||
|
|
||||||
# Access individual building IDs and save in a set
|
|
||||||
building_01 = env_objs[0]
|
|
||||||
building_02 = env_objs[1]
|
|
||||||
objects_to_toggle = {building_01.id, building_02.id}
|
|
||||||
|
|
||||||
# Toggle buildings off
|
|
||||||
world.enable_environment_objects(objects_to_toggle, False)
|
|
||||||
# Toggle buildings on
|
|
||||||
world.enable_environment_objects(objects_to_toggle, True)
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.enable_environment_objects-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id ="carla.World.get_spectator-snipet" style="display: none;">
|
|
||||||
<p class="SnipetFont">
|
|
||||||
Snippet for carla.World.get_spectator
|
|
||||||
</p>
|
|
||||||
<div id="carla.World.get_spectator-code" class="SnipetContent">
|
|
||||||
|
|
||||||
```py
|
|
||||||
|
|
||||||
|
|
||||||
# This recipe spawns an actor and the spectator camera at the actor's location.
|
|
||||||
|
|
||||||
# ...
|
|
||||||
world = client.get_world()
|
|
||||||
spectator = world.get_spectator()
|
|
||||||
|
|
||||||
vehicle_bp = random.choice(world.get_blueprint_library().filter('vehicle.bmw.*'))
|
|
||||||
transform = random.choice(world.get_map().get_spawn_points())
|
|
||||||
vehicle = world.try_spawn_actor(vehicle_bp, transform)
|
|
||||||
|
|
||||||
# Wait for world to get the vehicle actor
|
|
||||||
world.tick()
|
|
||||||
|
|
||||||
world_snapshot = world.wait_for_tick()
|
|
||||||
actor_snapshot = world_snapshot.find(vehicle.id)
|
|
||||||
|
|
||||||
# Set spectator at given transform (vehicle transform)
|
|
||||||
spectator.set_transform(actor_snapshot.get_transform())
|
|
||||||
# ...
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.get_spectator-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id ="carla.World.load_map_layer-snipet" style="display: none;">
|
|
||||||
<p class="SnipetFont">
|
|
||||||
Snippet for carla.World.load_map_layer
|
|
||||||
</p>
|
|
||||||
<div id="carla.World.load_map_layer-code" class="SnipetContent">
|
|
||||||
|
|
||||||
```py
|
|
||||||
|
|
||||||
# This recipe toggles on several layers in our "_Opt" maps
|
|
||||||
|
|
||||||
# Load town one with only minimum layout (roads, sidewalks, traffic lights and traffic signs)
|
|
||||||
world = client.load_world('Town01_Opt', carla.MapLayer.None)
|
|
||||||
|
|
||||||
# Toggle all buildings on
|
|
||||||
world.load_map_layer(carla.MapLayer.Buildings)
|
|
||||||
|
|
||||||
# Toggle all foliage on
|
|
||||||
world.load_map_layer(carla.MapLayer.Foliage)
|
|
||||||
|
|
||||||
# Toggle all parked vehicles on
|
|
||||||
world.load_map_layer(carla.MapLayer.ParkedVehicles)
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.load_map_layer-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id ="carla.World.spawn_actor-snipet" style="display: none;">
|
|
||||||
<p class="SnipetFont">
|
|
||||||
Snippet for carla.World.spawn_actor
|
|
||||||
</p>
|
|
||||||
<div id="carla.World.spawn_actor-code" class="SnipetContent">
|
|
||||||
|
|
||||||
```py
|
|
||||||
|
|
||||||
|
|
||||||
# This recipe attaches different camera / sensors to a vehicle with different attachments.
|
|
||||||
|
|
||||||
# ...
|
|
||||||
camera = world.spawn_actor(rgb_camera_bp, transform, attach_to=vehicle, attachment_type=Attachment.Rigid)
|
|
||||||
# Default attachment: Attachment.Rigid
|
|
||||||
gnss_sensor = world.spawn_actor(sensor_gnss_bp, transform, attach_to=vehicle)
|
|
||||||
collision_sensor = world.spawn_actor(sensor_collision_bp, transform, attach_to=vehicle)
|
|
||||||
lane_invasion_sensor = world.spawn_actor(sensor_lane_invasion_bp, transform, attach_to=vehicle)
|
|
||||||
# ...
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.spawn_actor-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id ="carla.World.unload_map_layer-snipet" style="display: none;">
|
|
||||||
<p class="SnipetFont">
|
|
||||||
Snippet for carla.World.unload_map_layer
|
|
||||||
</p>
|
|
||||||
<div id="carla.World.unload_map_layer-code" class="SnipetContent">
|
|
||||||
|
|
||||||
```py
|
|
||||||
|
|
||||||
# This recipe toggles off several layers in our "_Opt" maps
|
|
||||||
|
|
||||||
# Load town one with minimum layout (roads, sidewalks, traffic lights and traffic signs)
|
|
||||||
# as well as buildings and parked vehicles
|
|
||||||
world = client.load_world('Town01_Opt', carla.MapLayer.Buildings | carla.MapLayer.ParkedVehicles)
|
|
||||||
|
|
||||||
# Toggle all buildings off
|
|
||||||
world.unload_map_layer(carla.MapLayer.Buildings)
|
|
||||||
|
|
||||||
# Toggle all parked vehicles off
|
|
||||||
world.unload_map_layer(carla.MapLayer.ParkedVehicles)
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.unload_map_layer-code')">Copy snippet</button> <button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -73,9 +73,4 @@ __7.__ To run a simulation with the new map, run CARLA and then change the map u
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
<<<<<<< HEAD:Docs/tuto_M_add_map_package.md
|
|
||||||
Your map is now ready to run simulations in CARLA. If you have any questions about the process then you can ask in the [forum](https://github.com/carla-simulator/carla/discussions) or you can try running some of our [example scripts](https://github.com/carla-simulator/carla/tree/master/PythonAPI/examples) on your new map to test it out.
|
Your map is now ready to run simulations in CARLA. If you have any questions about the process then you can ask in the [forum](https://github.com/carla-simulator/carla/discussions) or you can try running some of our [example scripts](https://github.com/carla-simulator/carla/tree/master/PythonAPI/examples) on your new map to test it out.
|
||||||
=======
|
|
||||||
Your map is now ready to run simulations in CARLA. If you have any questions about the process then you can ask in the [forum](https://github.com/carla-simulator/carla/discussions/) or you can try running some of our [example scripts](https://github.com/carla-simulator/carla/tree/master/PythonAPI/examples) on your new map to test it out.
|
|
||||||
>>>>>>> ae0ba81b9fb32ac8a09adf1a1ad77564f3174a15:Docs/tuto_A_add_map/add_map_package.md
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ __2. Create a new level.__
|
||||||
2. Choose _Empty Level_.
|
2. Choose _Empty Level_.
|
||||||
3. Save the level in `Content/Carla/Maps/Sublevels/<map_name>/`. To integrate the level with the CARLA Python API, use the naming convention `<map_name>_<layer_name>`, e.g., `TutorialMap_Buildings`. For a list of available layers, check [here](core_map.md#carla-maps).
|
3. Save the level in `Content/Carla/Maps/Sublevels/<map_name>/`. To integrate the level with the CARLA Python API, use the naming convention `<map_name>_<layer_name>`, e.g., `TutorialMap_Buildings`. For a list of available layers, check [here](core_map.md#carla-maps).
|
||||||
|
|
||||||
>>>>>>![create new level](/img/new_level.png)
|
>>>>>>![create new level](../img/new_level.png)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ __3. Save the level.__
|
||||||
|
|
||||||
If a level has pending changes to save, you will see a pencil icon next to it in the _Levels_ panel. Click this to save the changes.
|
If a level has pending changes to save, you will see a pencil icon next to it in the _Levels_ panel. Click this to save the changes.
|
||||||
|
|
||||||
![moving assets](/img/move_assets.png)
|
![moving assets](../img/move_assets.png)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ Levels can be configured to be able to be toggled or to be always loaded. To con
|
||||||
|
|
||||||
Regardless of the setting, you will still be able to toggle the level in the editor by pressing the eye icon.
|
Regardless of the setting, you will still be able to toggle the level in the editor by pressing the eye icon.
|
||||||
|
|
||||||
>>>>>>![levels](/img/levels.png)
|
>>>>>>![levels](../img/levels.png)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ __4. Re-calibrate the _Map Size (Cm)_ so that it is equal to the actual size of
|
||||||
1. Select the `RoadPainter` actor in the scene.
|
1. Select the `RoadPainter` actor in the scene.
|
||||||
2. Go to the _Details_ panel and press the _Z-Size_ button. You will see the value in _Map Size (Cm)_ change.
|
2. Go to the _Details_ panel and press the _Z-Size_ button. You will see the value in _Map Size (Cm)_ change.
|
||||||
|
|
||||||
>>>>>![map size](/img/map_size.png)
|
>>>>>![map size](../img/map_size.png)
|
||||||
|
|
||||||
__5. Synchronize the map size between the `RoadPainter` and `Tutorial_RoadMaster`.__
|
__5. Synchronize the map size between the `RoadPainter` and `Tutorial_RoadMaster`.__
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ __5. Synchronize the map size between the `RoadPainter` and `Tutorial_RoadMaster
|
||||||
2. Copy the value _Map Size (Cm)_ from the previous step and paste it to _Global Scalar Parameter Values -> Map units (CM)_ in the `Tutorial_RoadMaster` window.
|
2. Copy the value _Map Size (Cm)_ from the previous step and paste it to _Global Scalar Parameter Values -> Map units (CM)_ in the `Tutorial_RoadMaster` window.
|
||||||
3. Press save.
|
3. Press save.
|
||||||
|
|
||||||
>>>>>>![img](/img/map_size_sync.png)
|
>>>>>>![img](../img/map_size_sync.png)
|
||||||
|
|
||||||
__6. Create the communication link between the road painter and the master material.__
|
__6. Create the communication link between the road painter and the master material.__
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ The `Tutorial_RenderTarget` will be the communication link between the road pain
|
||||||
|
|
||||||
The `Tutorial_RoadMaster` material you created holds the base material, extra material information, and parameters that will be applied via your `Tutorial_RenderTarget`. You can configure one base material and up to three additional materials.
|
The `Tutorial_RoadMaster` material you created holds the base material, extra material information, and parameters that will be applied via your `Tutorial_RenderTarget`. You can configure one base material and up to three additional materials.
|
||||||
|
|
||||||
>>![master materials](/img/master_material.png)
|
>>![master materials](../img/master_material.png)
|
||||||
|
|
||||||
To configure the materials, double-click the `Tutorial_RoadMaster` file. In the window that appears, you can select and adjust the following values for each material according to your needs:
|
To configure the materials, double-click the `Tutorial_RoadMaster` file. In the window that appears, you can select and adjust the following values for each material according to your needs:
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ Each of the materials we added to `Tutorial_RoadMaster` are applied to the roads
|
||||||
1. Select the road painter actor
|
1. Select the road painter actor
|
||||||
2. In the _Details_ panel, select the material to work with in the _Mask Color_ dropdown menu.
|
2. In the _Details_ panel, select the material to work with in the _Mask Color_ dropdown menu.
|
||||||
|
|
||||||
>>>>>>![choose material](/img/choose_material.png)
|
>>>>>>![choose material](../img/choose_material.png)
|
||||||
|
|
||||||
__3. Set the brush and stencil parameters.__
|
__3. Set the brush and stencil parameters.__
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ __2.__ In the window that pops up:
|
||||||
>- Leave unchecked:
|
>- Leave unchecked:
|
||||||
- _Export Individual Tiles_: Generates one `.fbx` file with all map pieces.
|
- _Export Individual Tiles_: Generates one `.fbx` file with all map pieces.
|
||||||
|
|
||||||
>>>>![roadrunner_export](/img/roadrunner_export.png)
|
>>>>![roadrunner_export](../img/roadrunner_export.png)
|
||||||
|
|
||||||
__3.__ Choose the directory where you want to export your files and click `Export`. This will generate `<mapName>.fbx` and `<mapName>.xodr` files among others.
|
__3.__ Choose the directory where you want to export your files and click `Export`. This will generate `<mapName>.fbx` and `<mapName>.xodr` files among others.
|
||||||
|
|
||||||
|
|
|
@ -432,17 +432,17 @@
|
||||||
type: float
|
type: float
|
||||||
var_units: kg per radian
|
var_units: kg per radian
|
||||||
doc: >
|
doc: >
|
||||||
Tire longitudinal stiffness per unit gravitational acceleration. __Default__ is `1000.0`.
|
Tire longitudinal stiffness per unit gravitational acceleration. Each vehicle has a custom value.
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
- var_name: lat_stiff_max_load
|
- var_name: lat_stiff_max_load
|
||||||
type: float
|
type: float
|
||||||
doc: >
|
doc: >
|
||||||
Maximum normalized tire load at which the tire can deliver no more lateral stiffness no matter how much extra load is applied to the tire. __Default__ is `2.0`.
|
Maximum normalized tire load at which the tire can deliver no more lateral stiffness no matter how much extra load is applied to the tire. Each vehicle has a custom value.
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
- var_name: lat_stiff_value
|
- var_name: lat_stiff_value
|
||||||
type: float
|
type: float
|
||||||
doc: >
|
doc: >
|
||||||
Maximum stiffness per unit of lateral slip. __Default__ is `17.0`.
|
Maximum stiffness per unit of lateral slip. Each vehicle has a custom value.
|
||||||
# - METHODS ----------------------------
|
# - METHODS ----------------------------
|
||||||
methods:
|
methods:
|
||||||
- def_name: __init__
|
- def_name: __init__
|
||||||
|
|
12
mkdocs.yml
12
mkdocs.yml
|
@ -24,19 +24,20 @@ nav:
|
||||||
- '2nd- Actors and blueprints': 'core_actors.md'
|
- '2nd- Actors and blueprints': 'core_actors.md'
|
||||||
- '3rd- Maps and navigation': 'core_map.md'
|
- '3rd- Maps and navigation': 'core_map.md'
|
||||||
- '4th- Sensors and data': 'core_sensors.md'
|
- '4th- Sensors and data': 'core_sensors.md'
|
||||||
- Advanced steps:
|
- Advanced concepts:
|
||||||
- 'OpenDRIVE standalone mode': 'adv_opendrive.md'
|
- 'OpenDRIVE standalone mode': 'adv_opendrive.md'
|
||||||
- 'PTV-Vissim co-simulation': 'adv_ptv.md'
|
- 'PTV-Vissim co-simulation': 'adv_ptv.md'
|
||||||
- 'Recorder': 'adv_recorder.md'
|
- 'Recorder': 'adv_recorder.md'
|
||||||
- 'Rendering options': 'adv_rendering_options.md'
|
- 'Rendering options': 'adv_rendering_options.md'
|
||||||
- 'RSS': 'adv_rss.md'
|
- 'RSS': 'adv_rss.md'
|
||||||
- 'SUMO co-simulation': 'adv_sumo.md'
|
|
||||||
- 'Synchrony and time-step': 'adv_synchrony_timestep.md'
|
- 'Synchrony and time-step': 'adv_synchrony_timestep.md'
|
||||||
- 'Traffic Manager': 'adv_traffic_manager.md'
|
|
||||||
- 'Benchmarking Performance': 'adv_benchmarking.md'
|
- 'Benchmarking Performance': 'adv_benchmarking.md'
|
||||||
- 'CARLA Agents': 'adv_agents.md'
|
- 'CARLA Agents': 'adv_agents.md'
|
||||||
- Traffic Simulation:
|
- Traffic Simulation:
|
||||||
- 'Traffic Simulation Overview': 'ts_traffic_simulation_overview.md'
|
- 'Traffic Simulation Overview': 'ts_traffic_simulation_overview.md'
|
||||||
|
- 'Traffic Manager': 'adv_traffic_manager.md'
|
||||||
|
- 'SUMO co-simulation': 'adv_sumo.md'
|
||||||
|
- 'Scenic': 'tuto_G_scenic.md'
|
||||||
- References:
|
- References:
|
||||||
- 'Python API reference': 'python_api.md'
|
- 'Python API reference': 'python_api.md'
|
||||||
- 'Blueprint Library': 'bp_library.md'
|
- 'Blueprint Library': 'bp_library.md'
|
||||||
|
@ -72,7 +73,6 @@ nav:
|
||||||
- 'Retrieve simulation data': "tuto_G_retrieve_data.md"
|
- 'Retrieve simulation data': "tuto_G_retrieve_data.md"
|
||||||
- 'CarSim Integration (Beta)': "tuto_G_carsim_integration.md"
|
- 'CarSim Integration (Beta)': "tuto_G_carsim_integration.md"
|
||||||
- 'RLlib Integration': "tuto_G_rllib_integration.md"
|
- 'RLlib Integration': "tuto_G_rllib_integration.md"
|
||||||
- 'Scenic': 'tuto_G_scenic.md'
|
|
||||||
- 'Chrono Integration': 'tuto_G_chrono.md'
|
- 'Chrono Integration': 'tuto_G_chrono.md'
|
||||||
- 'Build Unreal and CARLA in Docker': 'build_docker_unreal.md'
|
- 'Build Unreal and CARLA in Docker': 'build_docker_unreal.md'
|
||||||
- Tutorials (assets):
|
- Tutorials (assets):
|
||||||
|
@ -81,12 +81,14 @@ nav:
|
||||||
- 'Create standalone packages': 'tuto_A_create_standalone.md'
|
- 'Create standalone packages': 'tuto_A_create_standalone.md'
|
||||||
- "Material customization": 'tuto_A_material_customization.md'
|
- "Material customization": 'tuto_A_material_customization.md'
|
||||||
- Tutorials (developers):
|
- Tutorials (developers):
|
||||||
- 'Contribute assets': 'tuto_D_contribute_assets.md'
|
- 'How to upgrade content': 'tuto_D_contribute_assets.md'
|
||||||
- 'Create a sensor': 'tuto_D_create_sensor.md'
|
- 'Create a sensor': 'tuto_D_create_sensor.md'
|
||||||
- 'Create semantic tags': 'tuto_D_create_semantic_tags.md'
|
- 'Create semantic tags': 'tuto_D_create_semantic_tags.md'
|
||||||
- 'Customize vehicle suspension': 'tuto_D_customize_vehicle_suspension.md'
|
- 'Customize vehicle suspension': 'tuto_D_customize_vehicle_suspension.md'
|
||||||
- 'Generate detailed colliders': 'tuto_D_generate_colliders.md'
|
- 'Generate detailed colliders': 'tuto_D_generate_colliders.md'
|
||||||
- 'Make a release': 'tuto_D_make_release.md'
|
- 'Make a release': 'tuto_D_make_release.md'
|
||||||
|
- CARLA Ecosystem:
|
||||||
|
- 'Ansys Real Time Radar Model': 'ecosys_ansys.md'
|
||||||
- Contributing:
|
- Contributing:
|
||||||
- 'Contribution guidelines': 'cont_contribution_guidelines.md'
|
- 'Contribution guidelines': 'cont_contribution_guidelines.md'
|
||||||
- 'Code of conduct': 'cont_code_of_conduct.md'
|
- 'Code of conduct': 'cont_code_of_conduct.md'
|
||||||
|
|
Loading…
Reference in New Issue