Idle iteration with fixes
This commit is contained in:
parent
c8843d8d5a
commit
a4efcd36fd
|
@ -52,7 +52,7 @@ __2. Collision Stage:__ checks possible collisions for every vehicle. For each p
|
|||
|
||||
* __Related .cpp files:__ `CollisionStage.cpp`.
|
||||
|
||||
__3. Traffic Light Stage:__ manages some general traffic regulations, mainly priority at junctions. A _traffic hazard__ is set to true whenever a yellow or red traffic light is detected. Non-signalized junctions are managed with a priority system. When approaching to these, a __geodesic boundary__ is extended through the intersection along the intended trajectory. The vehicle will wait for the junction to be free if another vehicle is detected inside of the geodesic boundary.
|
||||
__3. Traffic Light Stage:__ manages some general traffic regulations, mainly priority at junctions. A __traffic hazard__ is set to true whenever a yellow or red traffic light is detected. Non-signalized junctions are managed with a priority system. When approaching to these, a __geodesic boundary__ is extended through the intersection along the intended trajectory. The vehicle will wait for the junction to be free if another vehicle is detected inside of the geodesic boundary.
|
||||
|
||||
* __Related .cpp files:__ `TrafficLightStage.cpp`.
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ This tutorial covers step by step the process to add a new vehicle model. From t
|
|||
* [__Add a 4 wheeled vehicle__](#add-a-4-wheeled-vehicle)
|
||||
* [Bind the skeleton](#bind-the-skeleton)
|
||||
* [Import and prepare the vehicle](#import-and-prepare-the-vehicle)
|
||||
* [__Add a 2 wheeled vehicle__](#add-a-2-wheeled-vehicle)
|
||||
|
||||
!!! Important
|
||||
This tutorial only applies to users that work with a build from source, and have access to the Unreal Editor.
|
||||
|
@ -14,12 +15,12 @@ This tutorial covers step by step the process to add a new vehicle model. From t
|
|||
|
||||
### Bind the skeleton
|
||||
|
||||
CARLA provides a general skeleton for 4-wheeled vehicles that must be used by all of them. The position and orientation of the bones can be changed, but adding new bones or changing he hierarchy will lead to errors.
|
||||
CARLA provides a general skeleton for 4-wheeled vehicles that must be used by all of them. The position of the bones can be changed, but adding new bones or changing the hierarchy will lead to errors.
|
||||
|
||||
__1. Download the skeleton__ `General4WheeledVehicleSkeleton` from [LINK].
|
||||
<br>
|
||||
|
||||
__2. Import the skeleton__ into the 3D project of the new vehicle. This could be in Maya, Blender or whichever software used for modelling.
|
||||
<br>
|
||||
|
||||
__3. Bind the bones__ to the corresponding bone.
|
||||
|
||||
* Bind each wheel to the bone named as `???`. Make sure to center the bone inside the wheel.
|
||||
|
@ -34,8 +35,7 @@ __4. Export the result__. Select all the meshes and the base of the skeleton a
|
|||
### Import and prepare the vehicle
|
||||
|
||||
* __1. Create a new folder__ named `<vehicle_name>` in `Content/Carla/Static/Vehicle`.
|
||||
<br>
|
||||
|
||||
<br>
|
||||
* __2. Import the `.fbx`__ in its folder. The Skelletal Mesh will appear along with two new files, `<vehicle_name>_PhysicsAssets` and `<vehicle_name>_Skeleton`.
|
||||
* __2.1 - *Import Content Type*__ — `Geometry and Skinning Weights`.
|
||||
* __2.2 - *Normal Import Method*__ — `Import Normals`.
|
||||
|
@ -50,7 +50,6 @@ __4. Export the result__. Select all the meshes and the base of the skeleton a
|
|||
* __3.3 - *Physics Type*__ — `Kinematic`.
|
||||
* __3.4 - *Simulation Generates Hit Event*__ — Enabled.
|
||||
<br>
|
||||
|
||||
* __4. Create the Animation Blueprint__. In the new vehicle folder, click right and go to `Create advanced asset/Animation/Animation blueprint`.
|
||||
* __4.1 - *Parent Class*__ — `VehicleAnimInstance`.
|
||||
* __4.2 - *Skeleton*__ — `<vehicle_name>_Skeleton`.
|
||||
|
@ -58,43 +57,36 @@ __4. Export the result__. Select all the meshes and the base of the skeleton a
|
|||
* __4.4 - Copy an existing Animation Blueprint__ — Go to `Content/Carla/Static/Vehicle` and choose any vehicle folder. Open its Animation Blueprint and copy the content.
|
||||
* __4.5 - Compile the Animation Blueprint__ — Connect the content in the blueprint and click the button `Compile` on the top left corner.
|
||||
<br>
|
||||
|
||||
* __5. Create folder for the vehicle blueprints__. Go to `Content/Carla/Blueprints/Vehicles` and create a new folder `<vehicle_name>`.
|
||||
* __5. Create a folder for the vehicle blueprints__. Go to `Content/Carla/Blueprints/Vehicles` and create a new folder `<vehicle_name>`.
|
||||
<br>
|
||||
|
||||
* __6. Create blueprints for the wheels__. Inside the folder, right-click and go to `Created advanced assets/Blueprints class`. Create two blueprints derived from `VehicleWheel`, one named `<vehicle_name>_FrontWheel` and the other `<vehicle_name>_RearWheel`.
|
||||
* __6.1 - *Shape radius*__ — Exactly the radius, not diameter, of the wheel mesh.
|
||||
* __6.2 - *Rig Config*__ — `CommonTireConfig`.
|
||||
* __6.3 - On the front wheel__ — Uncheck `Affected by Handbrake`.
|
||||
* __6.4 - On the rear wheel__ — Set `Steer Angle` to `0`.
|
||||
* __6.3 - On the front wheel__ — Set `Steer Angle`, default is `70`. Uncheck `Affected by Handbrake`.
|
||||
* __6.4 - On the rear wheel__ — Set `Steer Angle` to `0`. Check `Affected by Handbrake`.
|
||||
<br>
|
||||
|
||||
* __7. Create a blueprint for the vehicle__. Inside the folder, create another blueprint derived from `BaseVehiclePawn` and named `BP_<vehicle_name>`.
|
||||
* __7.1 - *Mesh*__ — Choose the skelletal mesh of the vehicle.
|
||||
* __7.2 - *Anim class*__ — ???.
|
||||
* __7.2 - *Anim class*__ — Choose the Animation blueprint created in *step 4*.
|
||||
* __7.3 - *Vehicle bound*__ — Adjust it to include the whole volume of the vehicle.
|
||||
<br>
|
||||
|
||||
* __8. Pair the wheels with their blueprint__. In `Vehicle Movement/Wheel Setups` expand the menu and prepare each wheel.
|
||||
* __8.1 - *Wheel_Front_Left*__ — `<vehicle_model>_FrontWheel`
|
||||
* __8.2 - *Wheel_Front_Right*__ — `<vehicle_model>_FrontWheel`
|
||||
* __8.3 - *Wheel_Rear_Left*__ — `<vehicle_model>_RearWheel`
|
||||
* __8.4 - *Wheel_Rear_Right*__ — `<vehicle_model>_RearWheel`
|
||||
<br>
|
||||
|
||||
* __9 - Compile the blueprint__ — Click the button `Compile` on the top left corner.
|
||||
<br>
|
||||
|
||||
* __10 - Add the vehicle__. In `Content/Carla/Blueprint/Vehicle`, open the `VehicleFactory` and add a new element to the array of vehicles.
|
||||
* __10.1 - *Make*__ — Choose a name to be used in Unreal.
|
||||
* __10.2 - *Model*__ — Choose the name to be used in the blueprint library in CARLA.
|
||||
* __10.3 - *Class*__ — `BP_<vehicle_name>`.
|
||||
* __10.4 - *Recommended colours*__ — Optionally, provide a set of recommended colours for the vehicle.
|
||||
<br>
|
||||
|
||||
* __11. Test the vehicle__. Launch CARLA, open a terminal in `PythonAPI/examples` and run the following command.
|
||||
```sh
|
||||
python manual_control.py --filter <model_name>
|
||||
python manual_control.py --filter <model_name> # The name used in step 10.2
|
||||
```
|
||||
|
||||
---
|
||||
|
|
|
@ -39,7 +39,6 @@ The blueprint __BP_RepSpline__ adds __individual__ elements along the path defin
|
|||
* __Max Number of Meshes__ — Set the maximum amount of elements that will be place between nodes of the curve.
|
||||
* __World aligned ZY__ — If selected, the elements will be vertically aligned regarding the world axis.
|
||||
* __Place Mesheson Points__ — If selected, an element will be added in the ending node of the curve.
|
||||
* __Consecutive__ — If selected, ???.
|
||||
* __Collision enabled__ — Set the type of collisions enabled for the meshes.
|
||||
|
||||
![bp_repspline_pic](img/map_customization/bp_repspline.jpg)
|
||||
|
@ -92,7 +91,7 @@ The blueprint __BP_Procedural_Building__ in `Content/Carla/Blueprints/LevelDesig
|
|||
|
||||
### Building structure
|
||||
|
||||
The key meshes will be updated everytime a change is made, and the building will disappear. Enable __Create automatically__ or click on __Create Building__ to see the new result.
|
||||
The key meshes will be updated everytime a change is made, and the building will disappear. Enable `Create automatically` or click on `Create Building` to see the new result.
|
||||
|
||||
These key meshes can be percieved as pieces of the building's structure. They can be grouped in four categories.
|
||||
|
||||
|
@ -100,7 +99,7 @@ These key meshes can be percieved as pieces of the building's structure. They ca
|
|||
* __Body__ — The middle floors of the building.
|
||||
* __Roof__ — The highest floor of the building.
|
||||
|
||||
For each of them, there is a __Corner__ mesh that will be placed on the sides of the floor, and a __???__ mesh to fill center. Additionally, the __Roof__ mesh will be the center piece on top of the building.
|
||||
For each of them, there is a mesh to fill the center of the floor, and a __Corner__ mesh that will be placed on the sides of the floor. Additionally, the __Roof__ mesh will be the center piece on top of the building.
|
||||
|
||||
The following picture represents the global structure.
|
||||
|
||||
|
@ -120,9 +119,11 @@ The __Base parameters__ set the dimensions of the building.
|
|||
There are some additional options to modify the general structure of the building.
|
||||
|
||||
* __Disable corners__ — If selected, no corner meshes will be used.
|
||||
* __Use full blocks__ — If selected, n
|
||||
* __Doors__ — Meshes that appear in the ground floor, right in front of the central meshes. The amount of dloors and their location can be set. `0` is the initial position, `1` the next base repetition, and so on.
|
||||
* __Walls__ — Meshes that substitute one or more sides of the building. For example, a plane mesh can be used to paint one side of the building.
|
||||
|
||||
|
||||
> *Picture for the three of them side to side?*
|
||||
|
||||
---
|
||||
|
|
|
@ -208,9 +208,9 @@ python spawn_npc.py -n 50 -w 50 --safe
|
|||
|
||||
### SUMO co-simulation traffic
|
||||
|
||||
CARLA can run a co-simulation with SUMO. This allows for creating traffic in SUMO that will be propagated to CARLA. This co-simulation is bidirectional. Spawning vehicles in CARLA will do so in SUMO.
|
||||
CARLA can run a co-simulation with SUMO. This allows for creating traffic in SUMO that will be propagated to CARLA. This co-simulation is bidirectional. Spawning vehicles in CARLA will do so in SUMO. Specific docs on this feature can be found [here](adv_sumo.md).
|
||||
|
||||
Right now this feature is available for CARLA 0.9.8 and later, in __Town01__, __Town04__, and __Town05__. The first one is the most stable.
|
||||
This feature is available for CARLA 0.9.8 and later, in __Town01__, __Town04__, and __Town05__. The first one is the most stable.
|
||||
|
||||
!!! Note
|
||||
The co-simulation will enable synchronous mode in CARLA. Read the [documentation](adv_synchrony_timestep.md) to find out more about this.
|
||||
|
@ -228,7 +228,7 @@ echo "export SUMO_HOME=/usr/share/sumo" >> ~/.bashrc && source ~/.bashrc
|
|||
* With the CARLA server on, run the [SUMO-CARLA synchrony script](https://github.com/carla-simulator/carla/blob/master/Co-Simulation/Sumo/run_synchronization.py).
|
||||
```sh
|
||||
cd ~/carla/Co-Simulation/Sumo
|
||||
python run_synchronization.py -c examples/Town01.sumocfg
|
||||
python run_synchronization.py examples/Town01.sumocfg --sumo-gui
|
||||
```
|
||||
* A SUMO window should have opened. __Press Play__ in order to start traffic in both simulations.
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue