execute_predefined_trajectory()
  • 1 Minute to read

execute_predefined_trajectory()


Article summary

Execute a predefined trajectory for the end effector of a arm.

Reference

Arguments

ArgumentsTypeDefault valueDescription
predefined_trajectorystrName of the predefined trajectory.
reverse_executionboolFalseWhether to execute the trajectory in reverse.
go_to_start_positionboolFalseWheter to set start position before execute the trajectory.
use_obstaclesboolFalseWhether to use obstacles during execution.
cameraslist[]List of cameras.
update_obstaclesboolFalseWhether to update obstacles.
min_bbox_clear_obstacleslist[]List of minimum bounding boxes for clearing obstacles.
max_bbox_clear_obstacleslist[]List of maximum bounding boxes for clearing obstacles.
additional_optionsdict{}Additional options for the trajectory execution.
velocity_scalingfloat0.0Scaling factor for velocity.
acceleration_scalingfloat0.0Scaling factor for acceleration.
waitboolFalseWhether to wait for user response.
callback_feedbackCallableNoneCallable function for feedback.
callback_feedback_asyncCallableNoneCallable function for feedback.
callback_finishCallableNoneCallable function for finish .
callback_finish_asyncCallableNoneCallable function for finish.

Return

None

Exceptions

  • RayaInvalidCallback
  • RayaArmsException
  • RayaArmsInvalidArmOrGroupName
  • RayaArmsPredefinedTrajectoryNameAlreadyExist
  • RayaArmsErrorParsingPredefinedTrajectory
  • RayaArmsExternalException

See the complete list of arms exceptions

Feedbacks

  • [1] The arm is in execution of the command
  • [3] Planning of the trajectory in progress
  • [4] Updating obstacles in progress

See the complete list of arms feedbacks

callback_feedback

ArgumentTypeDescription
feedback_codeintCode for the type of feedback.
feedback_msgstrDetails regarding the feedback code (empty if no error).
armstrName of the arm.
percentagefloatPercent of movement completed until target pose is reached.

callback_finish

callback_finish

ArgumentTypeDescription
errorintCode for the type of error encountered (0 if no error).
error_msgstrDetails regarding the error (empty if no error).

Usage Example

...
PREDEFINED_POSES = {

    'pre_pick': {
        'x': 0.35661, 
        'y': -0.258, 
        'z': 0.7011,
        'roll': 0.0, 
        'pitch': -10.0, 
        'yaw': 0.0
    },

    'pick': {
        'x': 0.58661, 
        'y': -0.258, 
        'z': 0.6711,
        'roll': 0.0, 
        'pitch': -10.0, 
        'yaw': 0.0
    },

    'nav_with_tray': {
        'x': 0.30661, 
        'y': -0.258, 
        'z': 0.466,
        'roll': 0.0, 
        'pitch': -10.0, 
        'yaw': 0.0,
    },

}
...
async def setup(self):
    self.arms: ArmsController = await self.enable_controller('arms')
    name = 'nav_with_tray'
    plan = False
...

async def loop(self):
    if plan:
            res = await self.arms.is_pose_valid(
                'right_arm', 
                **(PREDEFINED_POSES[name]),
                use_obstacles=True,
                update_obstacles=True,
                cartesian_path=False,
                tilt_constraint=constraints,
                save_trajectory=True,
                name_trajectory=name,
                wait=True)

    await self.arms.execute_predefined_trajectory(
        name,
        wait=True,
    )
...

Was this article helpful?