allenai / ai2thor

An open-source platform for Visual AI.
http://ai2thor.allenai.org
Apache License 2.0
1.15k stars 216 forks source link

There is a bug in controller.py. Can't use MoveArm()!!!!!!!!!!!!!! #1212

Open WZX0Swarm0Robotics opened 5 months ago

WZX0Swarm0Robotics commented 5 months ago

My code is: import ai2thor.controller controller = controller.step( action="MoveArm", position=dict(x=object_position['x'], y=object_position['y'], z=object_position['z']), coordinateSpace="world", restrictMovement=False, speed=1, returnToStart=False, fixedDeltaTime=0.02 ) event = controller.search_all_closed('FloorPlan227')

My version of ai2thor is 5.0.0.

The output is: ValueError: Invalid action: MoveArm

winthos commented 5 months ago

could you provide what parameters you are giving your agent on the Initialize action? There may be something related to how you are initializing your agent that may be the cause of this

WZX0Swarm0Robotics commented 5 months ago

my Initialize action are fellow: import ai2thor from ai2thor.controller import Controller controller = ai2thor.controller.Controller(agentMode="arm", scene="FloorPlan203", visibilityDistance=1.5, gridSize=0.5, renderDepthImage=False, renderInstanceSegmentation=False, width=224, height=224, fieldOfView=60)

winthos commented 5 months ago

Aha!! The issue is you are passing in fixedDeltaTime to the action, which is no longer part of the parameters that are valid for MoveArm. This was an internal change where the fixed delta time is now set explicitly during agent initialization by passing in fixedDeltaTime along with all the other controller initializing parameters you are already passing in, and this is set globally for the environment at that time.

I will make a note to update our documentation to reflect these changes so it is less confusing, but for now you should be able to resolve your issue by removing fixedDeltaTime from the action call, and instead setting it upon agent initialization.

WZX0Swarm0Robotics commented 5 months ago

It works. Thank you very much!