Managing Conversation Feedbacks


level_3


Providing feedbacks is essential to be sure that Humans really understand what’s going on when talking with Pepper.

A bar, called SpeechBar, is displayed on the tablet. It helps to understand if the robot is listening, hearing something and what has been understood.

Prerequisite: make sure RobotActivity is implemented. For further details, see: 4. Implementing QiSDK Design & the Robot Life Cycle.

Listening states

../_images/listen_sign_feedback.png

When Pepper is listening, his:

  • shoulders are blue,
  • SpeechBar adapts according to the specified strategy and position.

When Pepper is not listening, his:

  • shoulders are off,
  • SpeechBar adapts according to the specified strategy and position.

Reactions to voice events

Hearing Human Voice

The SpeechBar displays a visual animation.

Not Understood

The SpeechBar displays a question mark: “?”.

Understood

The SpeechBar displays the understood text.

SpeechBar strategies

In order to adapt to many interfaces, RobotActivity provides multiple SpeechBar display strategies. The default SpeechBarDisplayStrategy is ALWAYS.

ALWAYS

Description: the bar is always shown and does not cover the app content.

../_images/speechbar_always.gif
Listening #00d7ff color
Not listening #706565 color
Height 70dp
Text position Inside

OVERLAY

Description: the bar appears as an overlay each time the robot starts listening. The bar disappears when the robot is not listening for a few seconds.

../_images/speechbar_overlay.gif
Listening #00d7ff color
Not listening #706565 color, then disappears
Height 70dp
Text position Inside

IMMERSIVE

Description: the bar appears as a small overlay each time the robot starts listening. The bar disappears when the robot is not listening.

../_images/speechbar_immersive.gif
Listening Colors: #00d7ff, #009dba
Not listening Disappears
Height Dynamic
Text position Outside

SpeechBar positions

RobotActivity provides multiple SpeechBar display positions:

Position Description UI
TOP The bar is shown at the top of the screen. This is the default position. speechbar_top speechbar_bottom
BOTTOM The bar is shown at the bottom of the screen.

Customizing SpeechBar display

The allowed strategies are stored in the SpeechBarDisplayStrategy enum:

enum class SpeechBarDisplayStrategy {
    ALWAYS,
    OVERLAY,
    IMMERSIVE
}

The allowed positions are stored in the SpeechBarDisplayPosition enum:

enum class SpeechBarDisplayPosition {
    TOP,
    BOTTOM
}

To select another strategy or position, you may use the setSpeechBarDisplayStrategy or setSpeechBarDisplayPosition methods:

class SpeechBarActivity : RobotActivity(), RobotLifecycleCallbacks {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setSpeechBarDisplayStrategy(SpeechBarDisplayStrategy.OVERLAY)
        setSpeechBarDisplayPosition(SpeechBarDisplayPosition.BOTTOM)
        setContentView(R.layout.activity_sample)

        QiSDK.register(this, this)
    }
}
public class SpeechBarActivity extends RobotActivity implements RobotLifecycleCallbacks {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setSpeechBarDisplayStrategy(SpeechBarDisplayStrategy.OVERLAY);
        setSpeechBarDisplayPosition(SpeechBarDisplayPosition.BOTTOM);
        setContentView(R.layout.activity_sample);

        QiSDK.register(this, this);
    }
}