save_zone()
  • 1 Minute to read

save_zone()


Article summary

save_zone()

Add a permanent new zone area in robotic device.
This function will allow later to use navigate_to_zone() function instead navigate_to_position()

Reference

Arguments

ArgumentsTypeDefault value
zone_namestrThe name of the specified zone.
pointslistList of points on the map.
pos_unitPOS_UNITPOS_UNIT.PIXELENUM to determine whether the x,y values should be returned as pixels of the map image (POS_UNIT.PIXEL) or Cartesian position in meters (POS_UNIT.METERS)

Return

True if the whole function finished with no errors.

Exceptions

ExceptionCondition
RayaNavNoMapLoadedNo map is loaded.
RayaWrongArgumentPOS_UNIT is neither pixels nor meters or points isn’t filled with tuples of length 2.
RayaNavMapAlreadyExistThere is a location with this name in the current map.
RayaNavCurrentlyMappingThere is a mapping command in action.
RayaNavUnkownErrorAn unknown error occurs.

See the complete list of Raya Exceptions.

Example

Code:

...
await self.nav.save_zone( 
                zone_name='kitchen', 
                points=[[0, 1],[1, 1],[1, 0],[0, 0]], 
                pos_unit = POS_UNIT.METERS
                ):      
...

Was this article helpful?

What's Next