download_map()
  • 1 Minute to read

download_map()


Article summary

download_map()

Downloads a map image to a path.

Reference

Arguments

ArgumentsTypeDefault value
map_namestrName of the map to download.
pathstrPath to save the downloaded map.

Return

None

Exceptions

  • RayaWrongArgument
  • RayaNavUnknownMapName
  • RayaNavCurrentlyMapping

See the complete list of navigation exceptions.

Usage Example

Code:

...
DOWNLOAD_MAP_PATH = 'dat:downloaded_map.pgm'
UPLOAD_MAP_PATH = 'dat:to_upload_map.pgm'

class RayaApplication(RayaApplicationBase):

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

    async def loop(self):
        ...
        self.log.info(f'Downloading \'{DOWNLOAD_MAP_PATH}\' map...')
        await self.nav.download_map(
                map_name=self.map_name, 
                path=DOWNLOAD_MAP_PATH,
            )
        self.log.info(f'Map downloaded')
        ...

See the nav_update_map to check some valid uses.


Was this article helpful?

What's Next