get_zone_center()
- 1 Minute to read
get_zone_center()
- 1 Minute to read
Article summary
Did you find this summary helpful?
Thank you for your feedback
get_zone_center()
Retrieve the center coordintates of a specified zone.
Reference
Arguments
Arguments | Type | Default value | |
---|---|---|---|
zone_name | str | The requested zone on the map. | |
pos_unit | POSITION_UNIT | POSITION_UNIT.PIXELS | Unit of measurement for the points (PIXELs or METERS). |
Return
Returns
x, y = zone_center.x, zone_center.y
Exceptions
RayaNavNotLocated
RayaNavZonesNotFound
RayaWrongArgument
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):
...
zone_center = await self.nav.get_zone_center(
zone_name=kitchen,
pos_unit=POSITION_UNIT.PIXELS
)
self.log.info(zone_center)
...
See the nav_all_unity_apartment, nav_get_info to check some valid uses.
Was this article helpful?