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 | Description |
---|---|---|---|
zone_name | str | Name of the zone to save. | |
points | list | List of points defining the zone, must have 2 positions. | |
map_name | str | Name of the map where the zone will be saved. | |
pos_unit | POSITION_UNIT | POSITION_UNIT.PIXELS | Unit of measurement for the points (PIXELs or METERS). |
callback_feedback | Callable | None | Callable function for feedback (optional). |
callback_finish | Callable | None | Callable function for finish (optional). |
wait | bool | False | Coolean indicating whether to wait for user response (optional). |
Return
True
if the whole function finished with no errors.
Exceptions
RayaNavNoMapLoaded
RayaWrongArgument
RayaNavCurrentlyMapping
RayaNavUnkownError
See the complete list of navigation exceptions.
Callback Arguments
callback_feedback
Argument | Type | |
---|---|---|
feedback_code | int | Code for the type of feedback. |
feedback_msg | str | Details regarding the feedback code (empty if no error). |
For a complete list of feedbacks see the complete list of navigation feedbacks.
callback_finish
Argument | Type | |
---|---|---|
error_code | int | |
error_msg | str |
Usage Example
Code:
...
class RayaApplication(RayaApplicationBase):
async def setup(self):
self.nav = await self.enable_controller('navigation')
...
async def loop(self):
...
await self.nav.save_zone(
zone_name='kitchen',
points=[[0, 1],[1, 1],[1, 0],[0, 0]],
pos_unit = POSITION_UNIT.METERS
)
...
async def finish(self):
...
See the nav_get_info examples to check some valid uses.
Was this article helpful?