carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.11k stars 3.58k forks source link

Changing Motorcycle/Bicycle Rider #8077

Open GoodarzMehr opened 2 weeks ago

GoodarzMehr commented 2 weeks ago

Hi,

I know that in #7612 you've mentioned that you haven't implemented rider change for the packaged version. I was wondering how should I go about doing that in UE? Specifically, changing the rider of the blueprint using driver_id and not directly from the blueprint editor.

My thinking (based on how vehicle colors are changed) has been to add pedestrian meshes to the Pedestrian Models array in the Set Skeletal Mesh from Array function of BP_Base2wheeledNew and let the construction script start there. This randomizes the rider, which is the effect I'm after, but wouldn't set the rider based on driver_id. What else do I need to do?

DnDare commented 2 weeks ago

Hi GoodarzMehr, we've made a test similar to yours, with SetSkeletalmeshAsset, image

So it will randomize the riders you add to the array, is this what you want? or you want to use one specific rider from the array?

Hope this helps,

DnDare commented 2 weeks ago

About the driver _id, pedestrians ( thorugh blueprints) have id at the BP_walker_factory. Riders don't have an id, Riders are skeletal meshes assigned as riders, maybe you can use the riders_array's index,

GoodarzMehr commented 2 weeks ago

Thanks for the info. I'm creating a driving dataset and for the time being my approach (which, shown below, is similar to yours) randomizes the rider skeletal meshes when creating the actors, which satisfies my needs. However, no matter which rider is selected the actor's "driver_id" is 0. I was thinking of, in the future, being able to select the rider's skeletal mesh through the PythonAPI by specifying the index of the skeletal mesh array, instead of that index being selected randomly as it currently is.

Screenshot from 2024-08-30 20-05-24 Screenshot from 2024-08-30 20-04-57