PJLab-ADG / LimSim

LimSim & LimSim++: Integrated traffic and autonomous driving simulators with (M)LLM support
https://pjlab-adg.github.io/LimSim/
GNU General Public License v3.0
344 stars 27 forks source link

Vehicles in the AOI area always accelerate and decelerate repeatedly #12

Closed AntaiXie closed 6 months ago

AntaiXie commented 7 months ago

Hello, I have recently encountered a problem.I don't know if it's the problem I set, but I set the road speed limit for sumo and the vehicle speed in config.yaml to 30m/s. However, every time the vehicle speed in the AOI area reaches 13m/s, it slows down. What is the reason for this? How to solve this problem. image image

Fdarco commented 6 months ago

Hi, we checked our code and the possible problem should be with SUMO. the SUMO lanes have a default speed limit of 13.89m/s and the SUMO default max speed for the vehicle type is also 13.89m/s. Our planner reads this configuration information either from TraCI or from the SUMO configuration file. So if you want more speed, you may need to change the SUMO settings.

Fdarco commented 6 months ago

These two links may help:

AntaiXie commented 6 months ago

Hi,I have already set the net road speed limit before. When running alone in SUMO, the speed can reach 27.89, but it cannot exceed 15 in the AOI area.I would like to know where "planner reads this configuration information either from TracI or from the SUMO configuration file" is in your code?Thank you again for resolving my confusion.

安泰 @.***

 

------------------ 原始邮件 ------------------ 发件人: "PJLab-ADG/LimSim" @.>; 发送时间: 2023年12月11日(星期一) 下午2:58 @.>; @.**@.>; 主题: Re: [PJLab-ADG/LimSim] Vehicles in the AOI area always accelerate and decelerate repeatedly (Issue #12)

Hi, we checked our code and the possible problem should be with SUMO. the SUMO lanes have a default speed limit of 13.89m/s and the SUMO default max speed for the vehicle type is also 13.89m/s. Our planner reads this configuration information either from TraCI or from the SUMO configuration file. So if you want more speed, you may need to change the SUMO settings.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

zijinoier commented 6 months ago

Hi,I have already set the net road speed limit before. When running alone in SUMO, the speed can reach 27.89, but it cannot exceed 15 in the AOI area.I would like to know where "planner reads this configuration information either from TracI or from the SUMO configuration file" is in your code?Thank you again for resolving my confusion.

Hi, this part is in trajectory_generator.py, the related codes are :

line 366-379 for lane_keeping behaviour

    if current_state.vel * sample_t[0] > lanes[0].course_spline.s[
            -1] - current_state.s:
        speed_limit = 25 / 3.6
        if len(lanes) > 1:
            speed_limit = min(speed_limit, lanes[1].speed_limit)
        sample_vel = np.linspace(min(current_state.vel, 10 / 3.6), speed_limit, 4)
    else:
        sample_vel = np.linspace(
            max(1e-9, current_state.vel - d_t_sample * n_s_d_sample),
            min(
                max(current_state.vel, target_vel) +
                d_t_sample * n_s_d_sample * 1.01, lanes[0].speed_limit),
            5,
        )