2024-09-27 03:30:51 [Error] [carb.scripting-python.plugin] AttributeError: ‘omni.anim.navigation.core.bindings._omni_anim_navi’ object has no attribute ‘query_navmesh_path’
This is an official routine called navmesh-basic.usda and navmesh-basic-bevior.py
[Error][D__path__omniverse_Downloads_Assets_Isaac_4__dot__2_NVIDIA_Assets_AnimGraph_105__dot__0_Samples_Navigation_.navmesh-basic-behavior] NavMesh could not query points between Usd.Prim(</World/PathPoints/Start>) and Usd.Prim(</World/PathPoints/End>)
I suspect that query_navmesh-path may have been abandoned, and the latest one should be INavMesh.query_sthortest-path, but where is the document?
The latest official version is this, it should still be the old one: API Commands — Omniverse Extensions latest documentation
The Navigation/NavMesh extension has been updated with modified APIs that are unfortunately breaking changes from the previous Beta versions.
That particular Navigation example has a sample script on AWS that wont be updated until next release.
In the meantime, if you are creating a new script and want to perform pathfinding with the NavMesh you have first baked. Try out this code snippet as the modified usage:
import omni.anim.navigation.core as nav
inav = nav.acquire_interface()
navmesh = inav.get_navmesh()
if navmesh:
start = carb.Float3(0, 0, 0)
end = carb.Float3(100, 100, 0)
navmesh_path = navmesh.query_shortest_path(start_pos=start, end_pos=end)
If the navmesh is not baked ahead of time, the get_navmesh() will return None.
The navmesh_path that is returned from query_shorted_path will have all the points that are computed.
Thank you very much, seant.
Thank you very much for your prompt and patient answer.
After various attempts, I have finally successfully run NavMesh on Isaac Sim4.2.0.
The example path is: Assets/Isaac/4.2/NVIDIA/Assets/AnimGraph/105.0/Samples/Navigation/
As you said, I have modified the script, and here is my modified code:
def _update_path_points(self, start_position, target_position):
# get path points from current location of character to target inav = nav.acquire_interface() navmesh = inav.get_navmesh()
if navmesh: navmesh_path = navmesh.query_shortest_path(start_position, target_position)
if navmesh_path:
self.path_points = navmesh_path.get_points()
self.last_target_position = target_position
else:
carb.log_error(f"NavMesh could not query points between {self.targets[0]} and {self.targets[1]}")
On the first run, I also encountered warnings such as NavMesh not available and baking failed.
Clicking on Bake also resulted in NavMesh not available.
I suspect it may be related to the order or timing of enabling the Navigation Extension. You can also help confirm this.
Later, when I tested TestNavMesh. usda, everything was fine.
This is a screenshot of the successful operation. Thank you very much: