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

distance_to_closest_obstacle(pt, radius) cannot return properly while pt getting close to the ground #2351

Open
Fanxing-LI opened this issue Mar 28, 2024 · 1 comment
Labels
support User support requested (e.g. specific issue or API usage question)

Comments

@Fanxing-LI
Copy link

Habitat-Sim version

v0.3.1

I have created a self-defined drone dynamics system using habitatsim as render. And I obtain the collision status by comparing the pathfinder.distance_to_closest_obstacle() to the radius of my ball-shape agent.

I have confirmed that the "collision_assert" (the same as render_assert) is included in configs/stages/**.stage_config.json, "is_collidable" is set as true. Besides, I've double check these settings after creating the Simulator.

the issue is that, the distance returned from pathfinder.distance_to_closest_obstacle(point, max_search_radius) is correct while the point is getting close to walls and objects, but wrong while getting close to ground/floor. It seems that the agents do not consider the ground as obstacles, assuming that robot always stands on the floor.

If I want to free the point in the room and make it aware of the closest distance in any direction (including ground), how could I do.
I appreciate it very much if you can offer any help.

Thanks!

@Fanxing-LI Fanxing-LI changed the title distance_to_closest_obstacle() return wrong distance while getting close to stage distance_to_closest_obstacle(pt, radius) return wrong distance while pt getting close to the ground Mar 28, 2024
@Fanxing-LI Fanxing-LI changed the title distance_to_closest_obstacle(pt, radius) return wrong distance while pt getting close to the ground distance_to_closest_obstacle(pt, radius) cannot return properly while pt getting close to the ground Mar 28, 2024
@aclegg3
Copy link
Contributor

aclegg3 commented Apr 5, 2024

Hey @Fanxing-LI

Interesting application. A few points of clarification about how the system works may help:

  1. The navmesh (PathFinder) is an abstraction of the navigable area in a scene representing the agent as a cylinder and computing a mesh based on a voxelization of the scene geometry.
  2. The distance_to_closest_obstacle function gives distance to the nearest mesh edge from the snapped point.
  3. Pathfinder does not use the collision proxy for the asset, it only uses the NavMeshSettings which by default is computed from the agent's height and radius config.
  4. The navmesh will not be a great representation if you want to the drone to be able to fly/hover over obstacles in addition to avoiding them.

It sounds like you have a clever way of using the navmesh for a drone to avoid walls and large obstacles, but you want vertical distance (e.g. to floor and maybe ceiling) in addition. One way to accomplish this is to setup some raycasts as sensors. For example, cast a ray from the center of your drone down the Y-axis and use the first hit distance (which isn't your drone). Similarly, you could setup rays in other directions for additional sensors.

Another option (if the world is mostly static, like scan scenes) would be to pre-compute a signed distance field in the space and then query from the cache for your drone's position.

@aclegg3 aclegg3 added the support User support requested (e.g. specific issue or API usage question) label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support User support requested (e.g. specific issue or API usage question)
Projects
None yet
Development

No branches or pull requests

2 participants