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

Issue with Object Navigation Task: Geodesic and Euclidean Distance Discrepancy #2127

Open
AlooTikkiii opened this issue Jan 3, 2025 · 0 comments

Comments

@AlooTikkiii
Copy link

AlooTikkiii commented Jan 3, 2025

❓ Questions and Help

Problem Description:
I observed a discrepancy in the geodesic and Euclidean distances in the Object Navigation task v0.2. Following is an example of an episode:

{ "episode_id": "1", "scene_id": "hm3d_v0.2/val/00800-TEEsavR23oF/TEEsavR23oF.basis.glb", "scene_dataset_config": "./data/scene_datasets/hm3d_v0.2/hm3d_annotated_basis.scene_dataset_config.json", "additional_obj_config_paths": [], "start_position": [ -5.11524, 3.11338, -0.9598 ], "start_rotation": [ 0, 0.53515, 0, 0.84476 ], "info": { "geodesic_distance": 7.78835, "euclidean_distance": 6.53424, "closest_goal_object_id": 51 }, "goals": [], "start_room": null, "shortest_paths": null, "object_category": "toilet" }

Observations:
I used habitat_sim version 0.3.2 to calculate the geodesic distance using the provided start position and the center of the target object calculated via (semantic_scene.objects[51].aabb.center).

The snapped positions and calculated geodesic distance were as follows:

Snapped Start Position: [-5.11524, 3.163378, -0.9598]
Snapped End Position: [-6.073118, 3.163378, -8.131084]
Geodesic Distance: 9.092076301574707
There is a noticeable discrepancy in the geodesic distance reported in the episode (7.78835) and the calculated geodesic distance (9.092076).

Request:
Could you help identify the potential issue in the dataset or the methodology? If possible, could you share the code or procedure used to generate episodes, particularly how the distances (geodesic_distance and euclidean_distance) were calculated?

Code Used for Distance Calculation:
Here is the code I used for geodesic distance calculation:

def calculate_shortest_geodesic_distance(scene_path, navmesh_file_path, seed=1, isObject=True, startpoint=None, transform_start=False, endpoint=None, transform_end=False):
    sim_settings["scene"] = scene_path
    cfg = make_cfg()
    sim = habitat_sim.Simulator(cfg)
    
    if not sim.pathfinder.load_nav_mesh(navmesh_file_path):
        print("Failed to load NavMesh!")
        return

    sim.seed(seed)

    if transform_start:
        startpoint = transform_center(startpoint)

    snapped_start = np.array(sim.pathfinder.snap_point(np.array(startpoint, dtype=np.float32)))

    if transform_end:
        endpoint = transform_center(endpoint)

    snapped_end = np.array(sim.pathfinder.snap_point(np.array(endpoint, dtype=np.float32)))

    print('Snapped Start Position:', snapped_start)
    print('Snapped End Position:', snapped_end)

    path = habitat_sim.ShortestPath()
    path.requested_start = snapped_start
    path.requested_end = snapped_end

    if sim.pathfinder.find_path(path):
        print(f"Geodesic distance: {path.geodesic_distance}")
        
    sim.reset()
    return None

Additional Notes:
The scene_path and navmesh_file_path were set appropriately for the HM3D Semantics dataset.
Any guidance on resolving this issue or suggestions for debugging would be greatly appreciated.

Thank you for your assistance!

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