DerrickXuNu / OpenCOOD

[ICRA 2022] An opensource framework for cooperative detection. Official implementation for OPV2V.
https://mobility-lab.seas.ucla.edu/opv2v/
Other
663 stars 99 forks source link

Bug in logreplay #90

Closed ch3ny1 closed 1 year ago

ch3ny1 commented 1 year ago

When using the logreplay tool, the following bug was encountered

Traceback (most recent call last): File "scenarios_manager.py", line 75, in scenarion_manager.tick() File "scenarios_manager.py", line 63, in tick scene_manager.start_simulator() File "/media/chenyi/wiser/Research/OpenCOOD/logreplay/scenario/scene_manager.py", line 140, in start_simulator self.scene_name) File "/media/chenyi/wiser/Research/OpenCOOD/logreplay/map/map_manager.py", line 155, in init self.generate_lane_cross_info() File "/media/chenyi/wiser/Research/OpenCOOD/logreplay/map/map_manager.py", line 546, in generate_lane_cross_info tl_id = self.associate_lane_tl(mid_lane) File "/media/chenyi/wiser/Research/OpenCOOD/logreplay/map/map_manager.py", line 405, in associate_lane_tl trigger_path = Path(trigger_poly.boundary) File "/home/chenyi/miniconda3/envs/opencood/lib/python3.7/site-packages/matplotlib/path.py", line 128, in init vertices = _to_unmasked_float_array(vertices) File "/home/chenyi/miniconda3/envs/opencood/lib/python3.7/site-packages/matplotlib/cbook/init.py", line 1333, in _to_unmasked_float_array return np.asarray(x, float)

TypeError: float() argument must be a string or a number, not 'LineString'

Solved (not so elegantly) through adding a try-except handle in the corresponding file in the matplotlib by changing line 1333 from

return np.asarray(x, float)

to

try:
    return np.asarray(x, float)
except TypeError:
    return np.asarray(x.xy, float).transpose()
DerrickXuNu commented 1 year ago

What is your shapely version? This is very likely caused by the version of shaplely

ch3ny1 commented 1 year ago

It is shapely==2.0.0, as specified in environment.yml. numpy==1.12.6, matplotlib==3.4.2

xavhl commented 1 year ago

Another simpler solution I used was changing line 405 in map_manager.py

from

trigger_path = Path(trigger_poly.boundary)

to

trigger_path = Path(np.array(trigger_poly.boundary.coords))

P.S. I have shapely==2.0.0 as specified in environment.yml too

DerrickXuNu commented 1 year ago

What is the CARLA version you are using?

ch3ny1 commented 1 year ago

It’s 0.9.12. And thanks for the solution! Will try it out later

On Wed, May 31, 2023 at 06:23 Runsheng Xu @.***> wrote:

What is the CARLA version you are using?

— Reply to this email directly, view it on GitHub https://github.com/DerrickXuNu/OpenCOOD/issues/90#issuecomment-1570228591, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALYLURFZDTR53QYD42FEDQTXI5A4TANCNFSM6AAAAAAYUI2FXI . You are receiving this because you authored the thread.Message ID: @.***>

-- Chenyi Wang B.S. Statistics & B.A. Mathematics University of Minnesota, Twin Cities (612) 321-8888

DerrickXuNu commented 1 year ago

That's wired... it works on my machine

DerrickXuNu commented 1 year ago

So if the issue is solved, please close the issue