Goal - Limit robot movements in order to ease user interaction on the tablet, ensuring that:
// Build the action.
val enforceTabletReachability: EnforceTabletReachability = EnforceTabletReachabilityBuilder.with(qiContext).build()
// Run the action asynchronously
val enforceTabletReachabilityFuture: Future<Void> = enforceTabletReachability.async().run()
// 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.
When the action is run, the robot will:
positionReached()
signal and prevent further leg movements,// Build the action.
val 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
val enforceTabletReachabilityFuture: Future<Void> = enforceTabletReachability.async().run()
// 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: