Skip to content

Start Task - Designated Robot

Method

startTask(task, robotId?: string) -> {Promise.<boolean>}

Start executing the task.

Parameters

Name Type Description
task TaskInfo Task information
robotId String Robot SN

Return Value Promise.<boolean>

Whether the execution is successful

  • true - success
  • false - fail

Example

JavaScript
...
let task = {
  name: "Multi-point meal delivery",
  runNum: 1,
  taskType: 2,
  runType: 21,
  pts: [
    {
      x: 0.11,
      y: 1.22,
      yaw: 89,
      areaId: "xxxxxxxxxxxxxx",
      type: -1,
      ext: {},
      stepActs: [
        {
          type: ActionType.PlayAudio,
          data: {...}
        },
        ...
      ]
    },
    ...
  ]
}
const success = await axRobot.startTask(task, robotId);
...