Goal - Limit robot movements in order to ease user interaction on the tablet, ensuring that:
- the tablet is in a suitable position and does not move,
- the arms movements do not prevent the user from seeing and touching the tablet screen.
// Build the action. EnforceTabletReachability enforceTabletReachability = EnforceTabletReachabilityBuilder.with(qiContext).build(); // Run the action asynchronously Future<Void> enforceTabletReachabilityFuture = enforceTabletReachability.async().run();
Typical usage - You want the user to interact with Pepper’s tablet without being hampered by the robot movements, but you still want the robot to look alive and keep moving its arms, typically thanks to BackgroundMovement.
How it works¶
When the action is run, the robot will:
- prevent base movements,
- change the leg posture in order to set the tablet in a suitable position,
then emit the
positionReached()signal and prevent further leg movements,
- prevent the arms from moving in front of the tablet.
// Build the action. EnforceTabletReachability enforceTabletReachability = EnforceTabletReachabilityBuilder.with(qiContext).build(); // If needed, subscribe to the positionReached() signal // in order to know when the tablet has reached its final position. enforceTabletReachability.addOnPositionReachedListener(() -> Log.i(TAG, "On position reached")); // Run the action asynchronously Future<Void> enforceTabletReachabilityFuture = enforceTabletReachability.async().run();
While the action is running:
- any other action trying to use the leg or the base will fail,
- an action using the arms will run, but the arms movements will be altered.
Performance & limitations¶
- The implementation is quite conservative:
- It prevents the arms from being in front of the tablet, but also below and above the tablet.
- Arm movements toward the tablet are drastically slowed down.
- If the arms are initially in front (or below or above) of the tablet, the action will not move them out of the way, but fail.
- While running, the action will fail if the base is pushed.
- javadoc EnforceTabletReachability.
- Ease tablet interaction — EnforceTabletReachability tutorial.