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

ValueError: Invalid action: SetObjectPoses #1224

Open
Tom-Huang opened this issue Jul 3, 2024 · 1 comment
Open

ValueError: Invalid action: SetObjectPoses #1224

Tom-Huang opened this issue Jul 3, 2024 · 1 comment

Comments

@Tom-Huang
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant