Is agent movement always instantaneous? #1184
Unanswered
garfieldnate
asked this question in
Q&A
Replies: 2 comments
-
Someone suggested I try the ManipulaTHOR API instead, but it has a similar issue: # demo showing that agent movement is always instantaneous
from time import sleep
from ai2thor.controller import Controller
controller = Controller(
snapToGrid=False,
agentMode="arm",
)
controller.step("PausePhysicsAutoSim")
forward = True
while True:
if forward:
print("moving forward")
action = {
"action": "MoveAgent",
"ahead": 0.1,
"speed": 1,
"fixedDeltaTime": 0.0001,
"disableRendering": False,
}
else:
print("moving backward")
action = {
"action": "MoveAgent",
"ahead": -0.1,
"speed": 1,
"fixedDeltaTime": 0.0001,
"disableRendering": False,
}
forward = not forward
# renders a bunch of frames showing the agent moving forward or backward for the entire specified distance
event = controller.step(action=action)
if not event.metadata["lastActionSuccess"]:
raise ValueError(event.metadata["errorMessage"])
print(action)
for i in range(50):
event = controller.step(action="AdvancePhysicsStep", timeStep=0.0001)
print(event.metadata["agent"]["position"])
if not event.metadata["lastActionSuccess"]:
print(event.metadata["errorMessage"])
# no "isMoving" key!
print(event.metadata["agent"].keys())
sleep(1) The And now I'm getting the feeling more strongly that this API does not exist. This is what I need:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I will note also that turning off physics auto-sim prevents the microwave from cooking foods. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I disable physics auto-sim and move time forward via
AdvancePhysicsStep
, the agent appears to always teleport to its new position. An example illustrating this:This script moves the agent back and forth, calling
AdvancePhysicsStep
multiple times in between. I print the agent's position and also watch the Unity window, and it always appears that the agent simply moves instantaneously to its new position, as with teleportation. Here's a sample of the terminal output:Do I have the controller configured incorrectly here, or is continuous agent movement not possible?
(EDIT: I was not using a legal timestep. I have fixed that and added error checking. The original problem persists, and the agent teleports instead of moving continuously.)
Beta Was this translation helpful? Give feedback.
All reactions