Building Your First App with Pepper SDKPepper is a social humanoid robot developed by SoftBank Robotics, designed to interact with people through speech, gestures, and touch. The Pepper SDK (Software Development Kit) provides the tools, libraries, and documentation you need to create applications that run on Pepper’s NAOqi operating system. This guide walks you through everything to build your first Pepper app: setup, development workflow, sample code, testing, deployment, and tips for making interactions natural and robust.
Overview: What you’ll learn
- How to set up your development environment for Pepper SDK
- Project structure and key concepts (NAOqi, modules, behaviors, dialogues)
- Writing a simple application: greeting, speech recognition, and gesture response
- Testing on Pepper (simulator vs robot) and debugging tips
- Packaging and deploying your app to Pepper
- Best practices for interaction design, privacy, and performance
Prerequisites
Before you begin, ensure you have the following:
- A Pepper robot (any model supported by the Pepper SDK) or the Pepper simulator (Choregraphe/NAOqi simulator)
- A development machine running macOS, Linux, or Windows
- Python 3.6+ (NAOqi supports specific Python versions — check the SDK docs for compatibility with your robot firmware)
- Basic knowledge of Python and HTTP/web concepts
- SSH access to Pepper (if deploying to a physical robot)
- SoftBank Robotics account and access to Pepper’s developer resources (documentation, forums)
Key concepts
- NAOqi: The core middleware and runtime environment on which Pepper apps run. It provides APIs for motion, speech, vision, memory, and more.
- Modules: Independent components that expose functionality via methods and events. You’ll typically create Python modules that extend ALModule.
- Behaviors: High-level actions or scripts (motions, dialogues, animations) that can be triggered by modules.
- Dialogues: Conversational flows defined in topic files (.top) used by the dialogue system for natural language understanding and responses.
- ALMemory: A publish/subscribe system for events and shared data between modules.
- Choregraphe: Visual authoring tool and simulator for designing behaviors, dialogues, and testing apps locally.
Setup: Installing Pepper SDK and tools
- Install NAOqi SDK and Python bindings provided by SoftBank Robotics for Pepper. Download the appropriate package for your OS and Pepper firmware version.
- Install Choregraphe (includes simulator). It’s helpful for designing dialogues and simple behaviors without immediate access to a robot.
- Set up SSH keys for connecting to Pepper and ensure your robot is on the same network as your development machine.
- Install required Python packages (e.g., requests, protobuf) in a virtual environment to avoid conflicts.
Example (Linux/macOS):
python3 -m venv pepper-env source pepper-env/bin/activate pip install requests # copy NAOqi Python SDK into your project or install per SDK instructions
Creating your first Pepper app: “Hello, I’m Pepper”
We’ll build a simple app that:
- Greets the user when someone is nearby
- Listens for the user to say their name
- Responds with a personalized greeting and a nod
Project structure:
pepper_hello/ ├── behavior/ │ └── hello_behavior.xar ├── modules/ │ └── hello_module.py ├── dialogues/ │ └── hello_topic.top ├── manifest.json └── README.md
Step 1 — Hello module (Python)
Create a module that subscribes to people detection and runs a greeting sequence.
# hello_module.py from naoqi import ALProxy, ALModule, ALBroker import time class HelloModule(ALModule): def __init__(self, name, broker): ALModule.__init__(self, name) self.name = name self.motion = ALProxy("ALMotion") self.tts = ALProxy("ALTextToSpeech") self.memory = ALProxy("ALMemory") self.speech_rec = ALProxy("ALSpeechRecognition") self.memory.subscribeToEvent("PeoplePerception/PersonDetected", name, "onPersonDetected") def onPersonDetected(self, key, value, msg): # Basic greeting sequence self.tts.say("Hello, I am Pepper. What is your name?") # start speech recognition here (see dialogue section) time.sleep(1) def main(): broker = ALBroker("myBroker", "0.0.0.0", 0, "<PEPPER_IP>", 9559) hello = HelloModule("hello_module", broker) try: while True: time.sleep(1) except KeyboardInterrupt: broker.shutdown()
Note: Replace
Step 2 — Dialogue topic for name capture
Create a simple .top file to capture the user’s name.
topic: ~hello_topic() language: enu concept:(name) [John Mary Alice Bob] u: (my name is _{name}) ^react("greet_user", name)
In your module, subscribe to ALDialog and handle the event “greet_user” to read the captured name from ALMemory.
Step 3 — Behavior: nod animation
Use Choregraphe to create a simple head nod animation and export it as an XAR under behavior/hello_behavior.xar. Trigger it from Python using ALBehaviorManager or ALMotion routines (e.g., changeAngles on HeadYaw/HeadPitch joints).
Testing and debugging
- Test in Choregraphe simulator first: load dialogue and behavior, connect to the virtual Pepper, and step through events.
- For speech recognition issues, verify microphone sensitivity and the speech recognition vocabulary. Use ALAudioDevice and ALSoundDetection for diagnostics.
- Use robot logs and ALLogger to capture runtime info. SSH into Pepper and check /var/log/ for valuable messages.
Deployment
- Package the app into a .xar or a zip per SDK packaging guidelines.
- Upload via Choregraphe or SSH to Pepper and register your behavior/dialogue with ALBehaviorManager and ALDialog.
- Start your module on boot by creating an init script or using the Robot Configuration tools depending on Pepper firmware.
Best practices
- Keep interactions short and confirm understanding frequently.
- Use a small, targeted vocabulary for speech recognition to improve accuracy.
- Respect privacy: don’t store or transmit personal data unnecessarily.
- Test with real users in the environment where Pepper will operate (noise, lighting, foot traffic).
- Monitor CPU and memory usage; offload heavy processing (vision, ML) to external services if needed.
Troubleshooting checklist
- Robot not responding: check network, NAOqi service status, and SSH access.
- Speech not recognized: reduce vocabulary, tune microphone settings, check language model.
- Motion errors: ensure joint safety settings and stiffness are configured before actuating motors.
Where to go next
- Add computer vision: use ALVideoDevice to detect faces and emotions.
- Integrate cloud services for NLP or user profiles.
- Create multi-turn dialogues with slot-filling and context tracking.
- Explore ROS bridges if integrating with ROS-based systems.
Building your first Pepper app involves combining NAOqi modules, dialogues, and behaviors. Start small, iterate with real users, and use Choregraphe to visualize and test interactions quickly. Good luck — and enjoy bringing Pepper to life!
Leave a Reply