update_map()
  • 1 Minute to read

update_map()


Article summary

update_map()

Upload a new image from a path to a map.

Reference

Arguments

ArgumentsTypeDefault value
map_namestrName of the map to upload.
pathstrPath to upload from.

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'Uploading \'{UPLOAD_MAP_PATH}\' map...')
        await self.nav.update_map(
                map_name=self.map_name, 
                path=UPLOAD_MAP_PATH,
            )
        self.log.info(f'Map updated')
        ...

See the nav_update_map to check some valid uses.


Was this article helpful?

What's Next