Bound urban route clearance preference and expose Nav2 costmap diagnostics
This commit is contained in:
@@ -52,6 +52,7 @@ class Navigation:
|
||||
self.active, self.failure = False, None
|
||||
self.activating = False
|
||||
self.latest_terrain = None
|
||||
self.latest_exchange = None
|
||||
self.control = ContinuousControl(self.monitor, self.support, lambda _:None,
|
||||
lambda *_:None, self.native_command, body_top_m=self.geometry['collision_top_m'],
|
||||
native_only=True)
|
||||
@@ -101,8 +102,9 @@ class Navigation:
|
||||
def plan(self, value):
|
||||
# Transaction-local metadata cannot survive a stale/failed observation.
|
||||
receipts = {}
|
||||
result = self._plan(value, receipts)
|
||||
return {**result, **receipts}
|
||||
result = {**self._plan(value, receipts), **receipts}
|
||||
self.latest_exchange = dict(request=value, result=result)
|
||||
return result
|
||||
|
||||
def _plan(self, value, receipts):
|
||||
entered = time.monotonic()
|
||||
@@ -300,6 +302,9 @@ def main():
|
||||
self.reply(200,dict(schema_version='missioncore.navigation-diagnostic/v1',
|
||||
authority='none',execution_inputs_sha256=inputs['sha256'],
|
||||
exchange=navigation.control.snapshot(),
|
||||
latest_plan=navigation.latest_exchange,
|
||||
native=navigation.node.diagnostic(),
|
||||
search_terrain=observed['search_terrain'].tolist() if observed else [],
|
||||
current_observation_id=observed['observation_id'] if observed else None,
|
||||
current_metrics=observed['metrics'] if observed else None,
|
||||
current_detected=observed['detected'].tolist() if observed else [],
|
||||
|
||||
Reference in New Issue
Block a user