get_zones()
  • 1 Minute to read

get_zones()


Article summary

get_zones()

Retrieve all saved zone areas in a specific map.

Reference

Arguments

ArgumentsTypeDefault value
map_namestrThe requested map.

Return

Dict with zone name as key and Dict with data of the zone as value.

KeyTypeInfo
$zone_name_0Dictzone_limits: list of X,Y points limiting zone, zone_points: list of X,Y points inside zone.
$zone_name_1Dictzone_limits: list of X,Y points limiting zone, zone_points: list of X,Y points inside zone.
.........
$zone_name_nDictzone_limits: list of X,Y points limiting zone, zone_points: list of X,Y points inside zone.

zones[zone.zone_name] = {'zone_limits': zone_limit_points, 'zone_points': zone_points_points}

Exceptions

  • RayaNavNotLocated
  • RayaNavZonesNotFound
  • RayaNavUnkownError

See the complete list of navigation exceptions.

Usage Example

Code:

...
class RayaApplication(RayaApplicationBase):

    async def setup(self):
        self.nav = await self.enable_controller('navigation')
        ...

    async def loop(self):
        ...
        zones = await self.nav.get_zones(map_name='unity_apartment')
        self.log.info(zones)
        ...

See the nav_all_unity_apartment, nav_get_info to check some valid uses.


Was this article helpful?