Skip to content

Why flip y coordinate in Habitat GPS to camera position conversion? #90

@followingcode

Description

@followingcode

Hi authors,

First of all, thank you for this excellent work and open-sourcing the code! I've learned a lot from your implementation.
I have a question about the GPS coordinate system used in your code. In the file streamvln_dagger.py, line 217, there is a comment:

# Habitat GPS makes west negative, so flip y
camera_position = np.array([x, -y, self._camera_height + height])

I've traced this GPS definition back to the Habitat source code in habitat-lab/habitat/tasks/nav/nav.py
where the 2D GPS is computed as:
# Habitat source code (nav.py)
agent_position = quaternion_rotate_vector(...)  # inverse rotation to agent's frame
if self._dimensionality == 2:
    return np.array([-agent_position[2], agent_position[0]], dtype=np.float32)

So the GPS (x, y) I get from observation["gps"] corresponds to:
- x = -agent_position[2] (forward direction, aligned with the local -Z axis of the agent, displacement relative to the agent's starting position)
- y = agent_position[0] (right direction, aligned with the local X axis of the agent, displacement relative to the agent's starting position)

Therefore, I want to ask:Why is the y-coordinate negated (changed to -y) when calculating camera_position?What is the reason for flipping the y-axis here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions