Walkthrough: an expressive emoji robot
Try a display, a servo pose, text events, and optional AI interaction.
The Emoji companion template is the smaller reference robot. It includes a display, control electronics, a power system, and a simple servo-driven visual mechanism. Its supplied program alternates expressions and returns a bounded servo goal.
- Open the template chooser and select an Emoji companions variant. Review the wiring and design diagnostics before changing parts.
- Press Run and watch the expression alternate. In Code, find robot.display(...) and the returned servo value.
- Pause and change the expression strings. Press Run to start the revised program. Program globals restart after Pause/Run; a design or code edit also resets the simulation world.
- Try the sample below. It keeps drive motors stopped, changes the expression with simulation time, and moves the supported servo visual pose.
- Inspect power and the console. A speaker request is a text event, not generated sound. The microphone is not a live speech input in this release.
- Use AI models for an optional bounded action. A fresh emoji template may not supply a usable range observation for the offline driving fixture; a stop response is expected. Use the rover for the motion/AI walkthrough.
javascript
let lastExpression = "";
function step(robot) {
const happy = Math.floor(robot.time / 2) % 2 === 0;
const expression = happy ? "😊" : "🤖";
robot.display(expression);
if (expression !== lastExpression) {
robot.log("Expression:", expression);
robot.speak("Hello from my virtual robot.");
lastExpression = expression;
}
return {
left: 0,
right: 0,
expression,
servo: Math.sin(robot.time) * 0.5
};
}