go_to_angle()
  • 1 Minute to read

go_to_angle()


Article summary

Rotate to a specific angle.

Reference

Arguments

ArgumentsTypeDefault value
angle_targetfloatTarget angle to reach.
angular_velocityfloatAngular velocity for the movement.
ang_unitANGLE_UNITANGLE_UNIT.DEGREESUnit of measurement of angles (DEGREES or RADIANS).
callback_feedbackCallableNoneCallable function for feedback (optional).
callback_finishCallableNoneCallable function for finish (optional).
waitboolFalseCoolean indicating whether to wait for user response (optional).

Return

None

Exceptions

  • RayaNavNotLocated
  • RayaNavAlreadyNavigating
  • RayaUnableToFollowPath
  • RayaUnableToComputePath
  • RayaNavUnkownError

See the complete list of navigation exceptions.

Callback Arguments

callback_feedback

ArgumentType
feedback_codeintCode for the type of feedback.
feedback_msgstrDetails regarding the feedback code (empty if no error).

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

callback_finish

ArgumentType
error_codeint
error_msgstr

Usage Example

Code:

...
class RayaApplication(RayaApplicationBase):

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

    async def loop(self):
        ...
        await self.navigation.go_to_angle( 
                angle_target=180, 
                angular_velocity=1.0, 
                ang_unit=ANGLE_UNIT.DEGREES,
                callback_feedback=self.cb_go_to_angle_feedback,
                callback_finish=self.cb_go_to_angle_finish,
                wait=True,
            )
        ...

    async def finish(self):
       ...

See the nav_all_unity_apartment example to check some valid uses.


Was this article helpful?