save_zone()
- 1 Minute to read
save_zone()
- 1 Minute to read
Article summary
Did you find this summary helpful?
Thank you for your feedback
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
Arguments | Type | Default value | |
---|---|---|---|
zone_name | str | The name of the specified zone. | |
points | list | List of points on the map. | |
pos_unit | POS_UNIT | POS_UNIT.PIXEL | ENUM 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
Exception | Condition |
---|---|
RayaNavNoMapLoaded | No map is loaded. |
RayaWrongArgument | POS_UNIT is neither pixels nor meters or points isn’t filled with tuples of length 2. |
RayaNavMapAlreadyExist | There is a location with this name in the current map. |
RayaNavCurrentlyMapping | There is a mapping command in action. |
RayaNavUnkownError | An 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?