allenai / ai2thor

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

ValueError: Invalid action: SetObjectPoses #1224

Open Tom-Huang opened 4 months ago

Tom-Huang commented 4 months ago

Dear researchers of AI2THOR, I got an Invalid action error with version ai2thor==5.0.0. This is a code snippet to reproduce the error. It would be great if somebody can help! Thank you in advance!

robot_type = "drone"
is_drone = robot_type == "drone"
controller = Controller(
    agentMode=robot_type,
    visibilityDistance=1.5,
    # scene="FloorPlan_Train1_3",
    scene="FloorPlan1",
    gridSize=0.1,
    snapToGrid=False,
    movementGaussianSigma=0,
    rotateStepDegrees=90,
    rotateGaussianSigma=0,
    renderDepthImage=True,
    renderClassImage=True,
    renderInstanceSegmentation=True,
    width=600,
    height=600,
    fieldOfView=90,
)

event = controller.step(action="Pass")

object_info = []
for obj in event.metadata["objects"]:
    object_info.append(obj)
new_object_poses = []
for obj in object_info:
    if obj["moveable"] or obj["pickupable"]:
        new_object_poses.append(
            dict(
                objectName=obj["name"],
                rotation=obj["rotation"],
                position=obj["position"],
            )
        )
new_object_poses[0]["position"] = dict(
    x=new_object_poses[0]["position"]["x"] + 0.05, # just change the position of the first moveable or pickupable object slightly
    y=new_object_poses[0]["position"]["y"],
    z=new_object_poses[0]["position"]["z"],
)
controller.step(
    dict(action="SetObjectPoses", objectPoses=new_object_poses, placeStationary=False)
)
Tom-Huang commented 4 months ago

I noticed that setting robot_type to default can solve the problem. But is there any possibility to use "SetObjectPoses" when using drone?