# How to Dance with Your Robot
In a time when technology meets artistry, the choreography landscape is undergoing a transformation led by the rhythmic choreography of robots. Once a concept relegated to science fiction, robotic dancers have now taken the spotlight, mesmerizing audiences with their remarkable precision and choreography. These mechanical performers are not only challenging conventional choreography paradigms but are also reshaping the dynamics of human-robot choreography.
As they respond to music and engage in collaborative choreography with human dancers, a novel form of artistic expression emerges—one that fuses technology, choreography, and emotional resonance. Dive into the captivating world of dancing with robots, where the boundaries between human and machine fade, opening up a thrilling realm of creative choreography possibilities.
With the advancements of Machine Learning 2.0, it's now feasible to capture human movements through a computer camera and program these actions into choreography that can be relayed to robots, allowing them to respond and move in sync with their human partners in a beautifully orchestrated choreography..
This #How to will show how to create impressive dance choreography with robots through simple programming and machine learning. Not only does this provide an interesting entry point for learning programming and AI, it also shows us new possibilities for future human-robot interaction.
What does Machine Learning 2.0 do?
• Action Recognition:
Through machine learning algorithms, the system can learn and recognize different human actions. When you make specific actions in front of the camera, the system is able to compare these actions with previously trained data and recognize the actions you have made.
• Pattern Matching and Classification:
The machine learning model learns to classify the input action data into different action categories during the training process. This allows the robot to accurately categorize a particular action into a predefined action type when it is recognized.
• Mapping of actions to responses:
The machine learning model recognizes actions and associates these actions with the corresponding robot's physical responses and music playback. Whenever an action is recognised, the robot will react accordingly, e.g. move, turn, play a specific music clip, etc., based on predefined rules or patterns.
• Adaptive Learning:
If the model is able to learn continuously through a feedback mechanism, the recognition accuracy and reaction speed of the system will gradually improve as you continue to interact with the robot. This means that the robot will mimic your movements more and more accurately and react more naturally.
How to make robots dance with your dance choreography
Step1:Preparation
- An assembled mBot 2 cart
- Type C cable*1
- A computer with internet access
Before diving into dance choreography, you need to assembe your mBot2.
Then use the data cable to connect the mBot2 to your computer, open the Wise Programming Tool (desktop, web, mobile), connect to the mBot2, and switch to upload mode.
Open mBlock
- Visit the mBlock website: https://mblock.cc/
- Click【Code with Block】to open the editor
Step 2: Machine learning
Substep 2.1: Add Extension
- Click on【extension】in 【Sprites】
- Download and add Machine Learning 2.0
- Create/Manage model in 【Machine learning】
Substep 2.2: Training model
- Create a new 【Pose project】 project
- And then the first thing we need to do is add an audio sample of the background noise for your dance choreography
- Click 【Webcam】 to start capturing the dance choreography
- Click 【Long press to collect】 to add image samples
Add more image samples from different angles or magnitudes to be more accurate in recognition of the dance choreography.
Capture and record the recognizable actions of the dance choreography in the way described above.
After all the recordings are finished, click 【Train model】 to start training the model
Step 3: Built-in program
Start by creating a hat block
- Then drag in the trained recognition block
- Repeat execution: send an upload pattern message with the recognition results
Once built, the webcam captures human body movements of the dance choreography and sends signals back to the robot via the mBlock to make it act accordingly.
- Select 【Devices】 to start programming your dance choreography
- Add 【Upload Mode Broadcast】
- Select 【Upload】
- Creating hat blocks for program building
- After creating the hat block, set the size of volume and audio speed first
- Then set the decision condition: upload mode information = duo
- Adding music blocks and action blocks to conditional blocks
After this step, click 【Upload Code】, wait for the upload to be successful, and let your robot dazzle them with its dance choreography!
Full Program & Download
Click to download your dance choreography