# Robotics Unit 4: Choreography Final Reflection

We were given the task of making our Vex Squarebots dance to a song for a maximum of two minutes. We had the choice to choose our own song. We had to choreograph the song in sync and creatively portray the song through the robot.

Why did you select that music? How does it work with the movement?

In my thought process, I decided to have the robot follow a piece of music note by note, as it appeared to be easier than matching it to a video on youtube, where I would have to experiment to achieve in sync timings. Because of this, I chose a song without lyrics, and thus came upon the theme to the Pink Panther. To reflect this, in the song the robot moves relatively slowly as the song is slow paced and in the style of Jazz.

Did you take any reference from other robotics dance?

Since Andrew was doing the Habanera from Carmen, he had the arm do the bass portion of the song while the robot moved to the melody. From this, I realized I could also use the robot arm on the Squarebot to move to the bass of the song. The video Mr.Lin showed us when he first assigned the project of a Squarebot dancing also inspired me to think of how the robot should move before we started working on the project.
What are the challenges you encountered when completing this project? How did you solve it?

In the beginning, a major challenge I had was figuring out how to program the robot to follow a sheet of music, as it is different from just listening to a youtube video or an audio file. To solve this, I first had the piece of music move at a speed of 120 bpm. This means there will be 120 beats in a minute, and since there are 60 seconds in a minute, it made the calculations easy, as in each second there are two beats, which correspond to 1 quarter note in the music score. Then, I made multiple functions that I could control how fast the motors moved, and for how many beats in the song, as the there was a delay function that waits for a certain amount of time.

Another issue I encountered in the start of the project was using decimals for the number of beats the robot moved. Prior we had only learned how to use the integer Function, so all numbers we put in were rounded to integers. Mr. Lin helped me solve this by showing me the Float function, which uses the value of the number I enter instead of rounding it to the nearest integer.

A third problem I had was very minor. In the code, I created a turn function and a swing turn function that turned the robot in place. However, throughout the program at times instead of turning the robot just stops. I solved this by increasing the speed of the motors, as the robot needed more power to turn, while before i just gave a high pitched noise signaling something happening with the motors.

Can someone follow your blog and try to recreate the dance? (e.g. share the code, music and tricks you used to complete this project).

Yes it is fairly easy. They could also alter the code to match any song with a few modifications. However, I would suggest that instead of creating functions for each movement of the robot, have one function that you can do everything with. In the function, enter how fast you want each motor to move, individually, and how many beats in the song.

I have uploaded my code to show what I have done, and another file to show what would have been an easier way to program my robot.

New Setup Code

Pink Panther Dance Code

# Robotics Unit 4: Final Project Final Update

I have completed having our squarebot “Harambee 2.1” dance to the Pink Panther main theme. I have the two wheels in the robot match the melody while the arm plays the harmony bass. I found my approach to this task, following a music score rather than just a sound file, worked better since I finished quicker and had less issues timing the robot with the music together.

In addition to the standard squarebot, I have added a piNk pAnThEr module that shows the pink panther moving it’s left arm back and forth. I added this because I finished matching the robot with the song and had two extra classes.