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

Updates to Teleport/TeleportFull and isStanding() #1241

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

winthos
Copy link
Collaborator

@winthos winthos commented Sep 25, 2024

The purpose of these updates is to prevent an edge case where, when using an arm-typed agent, calling the Teleport action would cause the isStanding value to default in a weird way, causing the main camera of the arm-typed agent to be changed unexpectedly back to a default position that only has context for the high-level-agent. This update also catches a case where, when using the high-level agent and calling UpdateMainCamera, the `isStanding() return became ambiguous.

  • adding an override to the Teleport/TeleportFull actions in the ArmAgentController class and its derived classes so that an error can be thrown if passing in the standing bool since arm agents don't have a concept of a standing vs crouching camera position

  • updating the isStanding() helper function to return null in cases where the High Level Agent's main camera is not in either the hard-coded standing or crouching local position.

The purpose of these updates is to prevent an edge case where, when using an arm-typed agent, calling the Teleport action would cause the isStanding value to default in a weird way, causing the main camera of the arm-typed agent to be changed unexpectedly back to a default position that only has context for the high-level-agent. This was mainly due to the arm agents being derived classes of the high-level-agent's `PhysicsRemoteFPSAgentController` class

- adding an override to the Teleport/TeleportFull actions in the `ArmAgentController` class so that an error can be thrown if passing in the `standing` bool since arm agents don't have a concept of a standing vs crouching camera position

- updating the isStanding() helper function to throw an exception  in cases where the High Level Agent's main camera is not in either the hard-coded standing or crouching local position. This has some issues as if UpdateMainCamera is called while using the HighLevelAgent, it causes an incompatible state
trying a fix where we allow returning a null value for `isStanding` for cases where the camera position has changed via UpdateMainCamera or for agents that don't have a meaningful use for isStanding like stretch agents
... that uses the high level "hand" rather than a physical arm

also updating errorMessage for armed agents
@AlvaroHG
Copy link
Collaborator

AlvaroHG commented Oct 3, 2024

Minor comment, but LGTM!

allowing epsilon to be parameterized, default to Unity's Vector3.kEpsilon, which apparently is built into the Vector3 class specifically because Unity's representation of floats is the 32-bit variety and that epsilon value is tuned for that??? So seems like a good default still
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

Successfully merging this pull request may close these issues.

2 participants