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
415 stars 35 forks source link

AttributeError: 'NoneType' object has no attribute 'id' #38

Open Ludadiesel opened 2 weeks ago

Ludadiesel commented 2 weeks ago

I also tried "python ModelExample.py" with ['roundabout'] then got a AttributeError.

AttributeError: 'NoneType' object has no attribute 'id'

After a few seconds next_lane is NONE

self.lane_id E9_0 next_lane.id :J13_3_0 self.lane_id E11_0 next_lane.id :J14_0_0 self.lane_id E9_0 next_lane.id :J13_6_0 next_lane is NONE self.lane_id E9_1

LimSim/trafficManager/common/vehicle.py", line 252, in update_behaviour print(f"next_lane.id {next_lane.id}") AttributeError: 'NoneType' object has no attribute 'id' Error: tcpip::Socket::recvAndCheck @ recv: peer shutdown36 ACT 24 BUF 0)
Quitting (on error).

in junction behaviour

    if self.current_state.s > current_lane.course_spline.s[-1] - 0.2:
        if isinstance(current_lane, NormalLane):
            next_lane = roadgraph.get_available_next_lane(
                current_lane.id, self.available_lanes)

            if next_lane is None:
                print('next_lane is NONE')
            print(f"self.lane_id {self.lane_id}")
            print(f"next_lane.id {next_lane.id}")

            self.lane_id = next_lane.id
            self.current_state = self.get_state_in_lane(next_lane)
            current_lane = next_lane