carla-simulator / carla

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

Vehicle Drives in Circles When I Apply a PID Controller #7169

Open knowaiser opened 4 months ago

knowaiser commented 4 months ago

CARLA version: 0.9.15 Platform/OS: Windows 10 Pro

Hello,

I am currently experiencing an issue with my project using the CARLA simulator. Despite my best efforts to implement a PID controller for vehicle navigation, the vehicle behaves unexpectedly by continuously driving in circles. The vehicle's steering and throttle seem to always hit their maximum signals, which seems to be a key factor in the circular driving pattern. I have experimented with adjusting the PID coefficients (Kp, Ki, Kd) but have seen little to no improvement in the vehicle's behavior.

PID Implementation: Utilized both a custom PID code and the VehiclePIDController class provided by CARLA. My implementation mainly differs in the logic used for waypoint generation.

I am including a video of the vehicle's performance to provide a clearer understanding of the issue at hand.

I would greatly appreciate any insights, suggestions, or guidance on how to resolve this issue. Any feedback on the PID settings, waypoint generation, or other aspects of my implementation would be invaluable.

Thank you in advance for your help and support.

P.S. The blue dots are the waypoints from previous episodes.

https://github.com/carla-simulator/carla/assets/5973546/b3a84740-b24c-48d4-80a6-956705b2134d

SExpert12 commented 4 months ago

Can you please share your code? This happens to me multiple times.

PabloVD commented 1 month ago

Without seeing the code we cannot know which could be wrong with the implementation. Here you can see how the local planner can be employed to call the vehicle PID controller and apply the control commands, and here you can see an application on a simple example.