You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
python scripts/debug_random_policy.py
2024-05-29 09:44:18.757 | INFO | robot_sf.render.sim_view:__post_init__:86 - Initializing the simulation view.
Traceback (most recent call last):
File "/workspaces/robot_sf_ll7/scripts/debug_random_policy.py", line 34, in<module>benchmark()
File "/workspaces/robot_sf_ll7/scripts/debug_random_policy.py", line 11, in benchmark
env.render()
File "/workspaces/robot_sf_ll7/robot_sf/gym_env/robot_env.py", line 206, in render
self.sim_ui.render(state)
File "/workspaces/robot_sf_ll7/robot_sf/render/sim_view.py", line 253, in render
self._add_text(state.timestep, state)
File "/workspaces/robot_sf_ll7/robot_sf/render/sim_view.py", line 389, in _add_text
f'RobotAction: {state.action.robot_action}',
AttributeError: 'NoneType' object has no attribute 'robot_action'
The text was updated successfully, but these errors were encountered:
The error message 'NoneType' object has no attribute 'robot_action' suggests that state.action is None at the time when state.action.robot_action is being accessed.
To fix this issue, you should add a check to ensure that state.action is not None before trying to access its robot_action attribute. Here's a proposed fix:
# Before
f'RobotAction: {state.action.robot_action}',
# After
f'RobotAction: {state.action.robot_action if state.action is not None else "None"}',
This change will print "None" for the RobotAction if state.action is None, preventing the AttributeError.
If state.action should not be None at this point in your code, you may have a bug elsewhere that is causing state.action to be None. In that case, you should debug your code to find out why state.action is None.
The text was updated successfully, but these errors were encountered: