carla-simulator / carla

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

Directly use the acceleration as the control command in Behavior_agent.py and Basic_agent.py. #8065

Open AOOOOOA opened 3 weeks ago

AOOOOOA commented 3 weeks ago

I noticed in controller.py that the PID controller directly uses the calculated acceleration as the throttle command for the vehicle. This made me wonder: Is this really okay?

I've seen the Baidu Apollo autonomous driving system before, and they do things differently. Apollo first calculates the required acceleration, then uses a pre-prepared lookup table to convert that acceleration into specific throttle control commands.

These two methods are quite different, which makes me curious. Why is there such a difference?

https://github.com/carla-simulator/carla/blob/1ef3f55c9555de401681cb26ce87f81718943624/PythonAPI/carla/agents/navigation/controller.py#L54-L92

AOOOOOA commented 2 weeks ago

I have discovered a discrepancy between the acceleration calculated by the controller.py in the /carla/navigation/ directory and the actual acceleration derived from the recorded speed data. Intriguingly, when the vehicle's speed remains constant, the recorded acceleration—which also corresponds to the control throttle value—is 0.4. This observation seems counterintuitive and raises an important question: In the CARLA simulation environment, is the acceleration value actually representing the throttle input rather than the true physical acceleration?

This finding warrants further investigation, as it could have significant implications for how we interpret and utilize acceleration data within the CARLA system. If the acceleration values are indeed synonymous with throttle inputs, it would necessitate a recalibration of our understanding and potentially require adjustments in how we process and analyze vehicle dynamics data in our simulations.

image

image

Could you please help me with this? Thanks!