is_in_zone()
  • 1 Minute to read

is_in_zone()


Article summary

Checks if the robot is inside a specific zone.

Reference

Arguments

ArgumentsTypeDefault value
zone_namestringName of the zone.

Return

TypeDescription
boolTrue if the robot is inside the zone.

Exceptions

  • RayaNavNotLocated
  • RayaNavZonesNotFound
  • RayaNavNoMapLoaded
  • 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):
        ...
        in_zone = await self.nav.is_in_zone(
                    zone_name=kitchen, 
                )
        self.log.info(f'is robot in kitchen: {in_zone}')
        ...

See the nav_all_unity_apartment, nav_get_info to check some valid uses.


Was this article helpful?