Run it under windows 10 with carla 0.0.13 and unreal 4.26
This version is still under construction!
Problems:
- Some time the truck gets stuck, (it looks like it is stuck in the floor)
- Spawning the combination in the world could give problems because I did not take the length into account. So the trailer could be placed on an other vehicle
- Cornering with the tractor,does not take into account that there is a trailer behind the truck, so corner me be cut off.
The whole directory structure and files nee to be copied in to the root folder of Carla.
You also need to add the vehicle to the Blueprint Library.
As described in the carla docs in the section : 9. Add the vehicle to the Blueprint Library.
9. Add the vehicle to the Blueprint Library.
Point 4. (below) is important!
- In
Content/Carla/Blueprint/Vehicle
, open theVehicleFactory
file.- In the Generate Definitions tab, double click Vehicles.
- In the Details panel, expand the Default Value section and add a new element to the vehicles array.
- Fill in the Make and Model of your vehicle. For the truck name de Make "DAFxf". And for the trailer name the Make: "trailer".
- Fill in the Class value with your
BP_<vehicle_name>
file.- Optionally, provide a set of recommended colors for the vehicle. Name the "model" an "make" as below in the picture
- Compile and save.
Launch CARLA, open a terminal in PythonAPI/examples
and run the following command:
python manual_controlSemiTrailer.py
Note
Even if you used upper case characters in your make and model, they need to be converted to lower case when passed to the filter.
Not sure if the below line is correct. Pease try it.
python generate_trafficsemiTrailer.py -n5
If you want to couple the tractor to the trailer manually you should place a trailer in the world and then run the standard manual_control.py with the option --filter dafxf
python manual_control.py --filter dafxf
Then drive backwards with the tractor to the front of the trailer and it will couple. It needs a lot of improvement, but it works.