Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

random crashes from attempt to concatenate float to string #9

Open
pingings opened this issue Aug 7, 2024 · 2 comments
Open

random crashes from attempt to concatenate float to string #9

pingings opened this issue Aug 7, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@pingings
Copy link

pingings commented Aug 7, 2024

  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
Copy link
Author

pingings commented Aug 7, 2024

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

@pingings
Copy link
Author

pingings commented Aug 8, 2024

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

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

@BenedictWilkins BenedictWilkins added the bug Something isn't working label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants