Yutong-gannis / ETSAuto

🚚 ETSAuto is an Advanced driver Assistance System applied in Euro Truck Simulator 2, performing the functions of Lane Centering Control (LCC) and Auto Lane Change (ALC).
MIT License
172 stars 24 forks source link

与前车距离过近时报错 #21

Closed eiyooooo closed 1 year ago

eiyooooo commented 1 year ago

Crisp output cannot be calculated, likely because the system is too sparse. Check to make sure this set of input values will activate at least one connected Term in each Antecedent via the current set of Rules. AssertionError: Total area is zero in defuzzification!

During handling of the above exception, another exception occurred:

File "xxx\Self-driving-Truck-in-Euro-Truck-Simulator2\Control\controllers\fuzzy_controller.py", line 108, in fuzzy_compute fuzzy_system.compute() File "xxx\Self-driving-Truck-in-Euro-Truck-Simulator2\Planning\Follow.py", line 17, in Follow acc = fuzzy_compute(vertical_fuzzy, dspeed, distance) File "xxx\Self-driving-Truck-in-Euro-Truck-Simulator2\script\main.py", line 182, in acc, ang = Follow(cipv, vertical_fuzzy, horizontal_pid, nav_line) ValueError: Crisp output cannot be calculated, likely because the system is too sparse. Check to make sure this set of input values will activate at least one connected Term in each Antecedent via the current set of Rules.

eiyooooo commented 1 year ago

应在Follow函数中判断速度差和距离是否在范围内,再执行fuzzy_compute函数

Yutong-gannis commented 1 year ago

@eiyooooo 感谢,我会在后面解决这个问题

eiyooooo commented 1 year ago

@Yutong-gannis image image 我判断了速度差和距离再执行模糊控制,但是距离在142的时候也会出错,按道理来说142也在范围内吧

eiyooooo commented 1 year ago

@Yutong-gannis image image 我判断了速度差和距离再执行模糊控制,但是距离在142的时候也会出错,按道理来说142也在范围内吧

应该是速度差小于0出的问题