GoTo


level_1


Goal - Make Pepper go somewhere. The robot will try to reach safely the target location, while avoiding obstacles. The robot may look around and follow non-straight paths, in order to choose the safest way towards the target.

// Get the target frame.
Frame targetFrame = ...;

// Build the action.
GoTo goTo = GoToBuilder.with(qiContext)
                       .withFrame(targetFrame)
                       .build();

// Run the action synchronously.
goTo.run();

Typical usage - You want Pepper to find a path to reach a target location.


How it works

Defining a target frame

To use GoTo, the pattern is:

Step Action
Define the target location by retrieving or calculating a Frame.
Build the GoTo.
Run the GoTo.

Use case

Move to a static target

You want Pepper to reach the point located one meter in front of him.

Retrieve the robot frame and define the target location relatively to Pepper current location:

Actuation actuation = qiContext.getActuation();

Frame robotFrame = actuation.robotFrame();

Transform transform = TransformBuilder.create()
                                      .fromXTranslation(1);

Mapping mapping = qiContext.getMapping();

FreeFrame targetFrame = mapping.makeFreeFrame();

// Pass a 0-timestamp to publish target relatively to the
// last known location of robotFrame.
targetFrame.update(robotFrame, transform, 0L);

GoTo goTo = GoToBuilder.with(qiContext)
                       .withFrame(targetFrame.frame())
                       .build();

goTo.run();

Performance & Limitations

Obstacle avoidance

Pepper is able to avoid obstacles while moving to a specific location. If there are obstacles on his way, he will try to get around them to reach his destination.

GoTo or Animate?

You can make Pepper move with both Animate and GoTo.

  • Use Animate to perform a constant trajectory with no variation except for obstacle avoidance.
  • Use GoTo to create a dynamically adaptive trajectory based on a target.

See also