Carla: Applying VehicleControl(throttle=1.0) for the first time has a delay

Created on 14 May 2019  路  9Comments  路  Source: carla-simulator/carla

Hello!

What I noticed is that using vehicle.apply_control(VehicleControl(throttle=1.0)) for the first time has quite a delay. Afterwards, the delay is not noticeable and the commands are immediate. This is causing me issues as I'm processing the sensor data and then sending back the necessary vehicle control signals. The delay could even be observed when running manual_control.py and trying to accelerate for the first time. As you can see, the vehicle is not reacting for a few seconds and then it runs as it should. The interesting part is that when I'm applying steering command alongside the throttle command (vehicle.apply_control(VehicleControl(throttle=1.0, steer=1.0))), it can be observed that the wheels turn immediately, but the throttle is applied with a delay.

What could be causing this delay?

Also, if there is no workaround for this delay, maybe there is some way that I can get feedback as to when the throttle is going to be applied as the commands are received and vehicle.get_control() returns that the throttle is applied, but in the server physically the vehicle is not yet moving. I know that an alternative could be to use synchronous mode, but I'm just wondering if there are other options.

If it is of any concern, I am using Carla 0.9.5 on Ubuntu 16.10.

stale

Most helpful comment

hi, if i use throttle to control vehicle's velocity, what's the function relationship between throttle and velocity? Where is the code? And what's the difference between throttle and acceleration? Acctually, i want to use acceleration to control the velocity in carla. Thanks.

All 9 comments

I am seeing this as well with 0.9.5 on Ubuntu 18.04. I plotted output through the ROS bridge with rqt_plot and the delay is obvious. The delay happens once with every vehicle after spawning.

0.9.4 seems to have this behavior as well

FirstThrottle
SecondThrottle

This delay is caused by Unreal car's system, where they somehow simulate the time that the driver will spend starting the car engine or changing a new gear. I think one solution is to spawn a car, change the gear system to manual, put the first gear, and then set the gear system to automatic again.

Marc is this documented somewhere in UE4 ? I am getting zero Google hits ...

I created the simple vehicle project directly in UE4. I sense no delay in vehicle movement using the UE4 player directly with the sample project

Hello, @oldtopos and @marcgpuig and thank you both for your input!
@marcgpuig, I played around in Carla and your workaround seems to work.

@DanielsJusts, can you explain how to avoid the delay in details?

Hello @Derekabc!
I think @marcgpuig stated this pretty well in his comment:

I think one solution is to spawn a car, change the gear system to manual, put the first gear, and then set the gear system to automatic again.

Basically, after spawning a car you need to switch from automatic transmission to manual transmission and put the car in the first gear (vehicle.apply_control(VehicleControl(manual_gear_shift=True, gear=1))) and then you switch back to automatic transmission (vehicle.apply_control(VehicleControl(manual_gear_shift=False))). Then, as much as tested, there is no delay when applying throttle for the first time.

hi, if i use throttle to control vehicle's velocity, what's the function relationship between throttle and velocity? Where is the code? And what's the difference between throttle and acceleration? Acctually, i want to use acceleration to control the velocity in carla. Thanks.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mallela picture mallela  路  3Comments

qixiaoshuai0120 picture qixiaoshuai0120  路  3Comments

phzeller picture phzeller  路  3Comments

syinari0123 picture syinari0123  路  4Comments

metaluga145 picture metaluga145  路  4Comments