▲ 16 r/ROS
[ROS 2 Humble / Gazebo] Vehicle Struggles to Accelerate After Traffic Light Turns Green & Oversteers Out of Lane
Hi everyone,
I am developing an autonomous car simulation using ROS 2 Humble, Gazebo, and OpenCV / YOLO for line tracking and traffic light detection.
I'm facing two specific issues as shown in the video:
- Traffic Light Resume Issue: The vehicle successfully detects the red traffic light and stops. However, when the light turns green, it resumes movement extremely slowly (stuck around
0.2 - 0.5 km/h) and takes too long to recover its normal cruising speed (~3 km/h). - Lane Departure / Oversteering: The OpenCV lane detection algorithm loses lane continuity during slight curves/turns, causing the car to cross line boundaries and hit curbs.
- # Currently handling traffic light state like this:
- if self.traffic_light_state == 'RED':
- target_linear_velocity = 0.0
- elif self.traffic_light_state == 'GREEN':
- target_linear_velocity = self.normal_speed # But acceleration in Gazebo feels lagging / throttled
- How can I smoothly transition speed state in ROS 2 after a stop condition without getting stuck in low linear velocity?
- What ROI / Look-ahead adjustments or PID gain tuning (Kp/Kd) do you recommend for OpenCV lane tracking to prevent boundary overflow on curves?
u/Solid_Internet_3503 — 11 days ago