get_current_map()
  • 1 Minute to read

get_current_map()


Article summary

get_current_map()

Get current map name.

Reference

Arguments

None

Return

string: Current map name.

Exceptions

  • RayaNavUnkownError

See the complete list of navigation exceptions.

Usage Example

Important note!

Please pay attention to the setup functions. Without them, navigation controller will not be allowed.

Code:

...
class RayaApplication(RayaApplicationBase):

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

async def loop(self):
...
    map_name = await self.nav.get_current_map()
    self.log.info(f'Map in use: {map_name}.')
        ...

Was this article helpful?

What's Next