dicelab-rhul / matbii

GNU General Public License v3.0
1 stars 0 forks source link

random crashes from attempt to concatenate float to string #9

Open pingings opened 3 months ago

pingings commented 3 months ago

  File "C:\Users\szonya\anaconda3\envs\matbii\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\matbii\__main__.py", line 161, in <module>
    env.run()
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\icua\environment\multitask_environment.py", line 156, in run
    asyncio.run(_run())
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\icua\environment\multitask_environment.py", line 154, in _run
    raise e
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\icua\environment\multitask_environment.py", line 194, in _run_agent
    raise e  # re-raise
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\icua\environment\multitask_environment.py", line 189, in _run_agent
    await agent.__cycle__()
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\star_ray\utils\_async.py", line 88, in __await__
    return (yield from self._future.__await__())
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\star_ray\utils\_async.py", line 28, in call_sync
    result = func(*args, **kwargs)
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\star_ray_pygame\avatar.py", line 116, in __cycle__
    super().__cycle__()
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\star_ray\agent\agent_routed.py", line 292, in __cycle__
    self.__observe__()
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\star_ray\agent\agent_routed.py", line 319, in __observe__
    self._observe_router(observation, component=sensor)
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\star_ray\utils\type_routing.py", line 70, in __call__
    result.append(func(event, *args, **kwargs))
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\star_ray\agent\agent_routed.py", line 46, in _wrapped
    return func(*args, **kwargs)
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\star_ray_pygame\avatar.py", line 104, in _on_xml_change
    observation.__execute__(self._state)
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\icua\event\event_guidance.py", line 120, in __execute__
    return type(self)._draw(state, self.data, self.xpath)
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\icua\event\event_guidance.py", line 205, in _draw
    cls._update(state, data, uxpath)
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\icua\event\event_guidance.py", line 192, in _update
    rotation = DrawArrowAction.rotation_from_point_to(state, point_to, xpath)
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\icua\event\event_guidance.py", line 250, in rotation_from_point_to
    (x1, y1) = DrawArrowAction.get_element_center(state, xpath)
  File "C:\Users\szonya\anaconda3\envs\matbii\lib\site-packages\icua\event\event_guidance.py", line 234, in get_element_center
    return x + width / 2, y + height / 2
TypeError: can only concatenate str (not "float") to str
pingings commented 3 months ago

happens when i blink (eye coordinates are "nan") whilst the guidance box is showing

pingings commented 3 months ago

I temporarily fixed it by putting this above the line that throws the error


        if x == 'nan' or y == 'nan':
            return 0,0