navigate_to_zone()
  • 1 Minute to read

navigate_to_zone()


Article summary

Navigate to a specific zone. By default, it will navigate to the center of the zone.

Reference

Arguments

ArgumentsTypeDefault value
zone_namestrName of the zone to navigate to.
to_centerboolTrueWhether to navigate to the center of the zone.
callback_feedbackCallableNoneCallable function for feedback (optional).
callback_finishCallableNoneCallable function for finish (optional).
waitboolFalseCoolean indicating whether to wait for user response (optional).

Callback Arguments

callback_feedback

ArgumentType
feedback_codeintCode for the type of feedback.
feedback_msgstrDetails regarding the feedback code (empty if no error).
distance_to_goalfloatDistance to goal in meters.
speedfloatRobot current speed.

For a complete list of feedbacks see the complete list of navigation feedbacks.

callback_finish

ArgumentType
error_codeint
error_msgstr

Return

None

Exceptions

  • RayaNavNotLocated
  • RayaNavAlreadyNavigating
  • RayaUnableToFollowPath
  • RayaUnableToComputePath
  • RayaNavUnkownError

See the complete list of navigation exceptions.

Usage Example

Code:

...
class RayaApplication(RayaApplicationBase):

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

    async def loop(self):
        ...
        await self.navigation.navigate_to_zone(
                zone_name='initial_zone',
                to_center=True,
                callback_feedback=self.cb_nav_feedback, 
                callback_finish=self.cb_nav_finish, 
                wait=False
            )
        ...

    async def finish(self):
       ...

See the nav_to_zone, nav_all_unity_apartment to check some valid uses.


Was this article helpful?