PDA

View Full Version : [Project] HELP: Robot dancing to the rhythm



myrad
09-25-2013, 01:06 PM
I own a Robotis Humanoid Comprehensive Kit. Am a novice in robotics. :(

My project requires me to make the robot dance according to the rhythm. (ie. If the rhythm is fast, the motion of my robot will be fast, if the rhythm is slower, my robot will move slower)

Currently I've already used RoboPlus Task and Motion to create the few basic dance moves. So now how do I go about programming the robot to dance according to the rhythm?

Is there any similar projects that I can refer to?

Thank you.

kgranat
09-26-2013, 10:21 AM
Tracking song rhythm or tempo can be tricky. Simple analog sound sensors (like the ones the CM-5 can interface with) only track volume. Usually for tracking properties like rhythm and tempo you'll need more processing power.

I would take a look into the following
-find some open source pc software or libraries that analyzes music for tempo/ryhthm
-read up on ROBOTIS's Zigbee SDK - this will allow you to control your CM-5 from an application you've written
http://support.robotis.com/en/software/zigbee_sdk.htm
(http://support.robotis.com/en/software/zigbee_sdk.htm)-write/modify a program that will take in music, then control your robot using zigbees/zig2serial module, or through a wired connection

Also, you might take a look at HyperCube's Robot DJ. This project uses some different methods (it uses a USB2DYNAMIXEL to directly control each servo, so all of the code is running on the computer)
http://forums.trossenrobotics.com/robots.php?project_id=37#ad-image-0

(http://forums.trossenrobotics.com/robots.php?project_id=37#ad-image-0)

myrad
09-26-2013, 12:41 PM
Is it possible to link other programming software to my CM-5? So the sequence of my project will go:

Software that analyzes my music (fast/slow beat) > Link to the application I have written to control my CM-5 to dance according to the dance moves I have created in RoboPlus Motion?

The dance moves I have created using RoboPlus Motion will be stored in CM-5, and I need to write a program to actually activate it to start dancing according to the rhythm? Is this an achievable project?

Thank you!!!

myrad
09-26-2013, 01:15 PM
Or how about linking kinect to my CM-5? Instead of using a music analyzer, I use the kinect sensor.

Like when I wave quickly, the robot will dance faster. And when I wave slow, the robot will execuate the slow dance move.

Is it easier to achieve than using the music analyzer?

jwatte
09-26-2013, 02:55 PM
Can you control what music is being played? If so, you can send timecode over the serial port and have the robot dance based on that.

tician
09-26-2013, 05:28 PM
The motions created by RoboPlus play at a fixed rate within Task programs. You will have to either create duplicates of the motion pages and change the play speed using the "Speed rate" option (http://support.robotis.com/en/techsupport_eng.htm#software/roboplus/roboplus_motion/motionedit/pageedit/roboplus_motion_pagerepeatspeed.htm), or manually edit each pose to be a single page that can then be called in sequence by the Task code to match the tempo of the music (this manual motion sequence creation will probably not result in smooth motion as the length of each pose will be fixed in time length).
After you do either of the above options, you can create a Task program that takes the 16-bit value sent from any program you create on the PC using the PC-based Zigbee SDK (available on the Robotis e-support site (http://support.robotis.com/en/techsupport_eng.htm#software/zigbee_sdk/zig2serial.htm)) and starts playing a motion sequence.

If you were using an arbotix, it would be much easier to change the speed of the motion sequences since you have to pass a time interval at the start of each pose. Unfortunately, the CM-5 has no support other than RoboPlus Task and is pining for the fjords (comprehensive kit should soon be discontinued; long overdue).

Another option would be to use a USB2Dynamixel to directly control the servos from a USB equipped PC using the Dynamixel SDK (http://support.robotis.com/en/techsupport_eng.htm#software/dynamixel_sdk/usb2dynamixel.htm) and/or the arbotix's interpolating motion engine (porting it to pc operation should not be too difficult).

myrad
10-04-2013, 03:26 PM
After you do either of the above options, you can create a Task program that takes the 16-bit value sent from any program you create on the PC using the PC-based Zigbee SDK (available on the Robotis e-support site (http://support.robotis.com/en/techsupport_eng.htm#software/zigbee_sdk/zig2serial.htm)) and starts playing a motion sequence.


Hi there. This means that the Task program actually can recognize external program (example: Arduino/Processing etc)?

tician
10-04-2013, 05:47 PM
Hi there. This means that the Task program actually can recognize external program (example: Arduino/Processing etc)?
Yes and no. You cannot run any other program on the CM-5/510/530/700, so no arduino sketches (none of them are supported board in arduino anyway). The CM-5/510/530/700 can accept a 16-bit signed integer when it is sent over the 4-pin Zigbee connector (JST PH series connector on CM-510/530/700), the audio connector RS-232 serial cable (on CM-5/510), or USB cable (CM-530). To be recognized by the Task program, it must be sent as a Robotis zigbee packet as specified on the support site in my last post. The CM-5/510/530/700 does not care what program (written in any language) is running on the other end of the cable (or ZIG-100/110), just as long as it always sends the 16-bit data in the correct packet.

myrad
10-05-2013, 10:30 AM
To be recognized by the Task program, it must be sent as a Robotis zigbee packet as specified on the support site in my last post. The CM-5/510/530/700 does not care what program (written in any language) is running on the other end of the cable (or ZIG-100/110), just as long as it always sends the 16-bit data in the correct packet.

Sorry I have problem understanding the procedures of this. I am really new to this and am trying to get the hang of it.

For example: now I have 2 different kinds of beat - fast and slow. How do I connect this external program to the CM-5 so that when the signal sent is A, it will dance fast and when the signal sent is B, it will dance slow?

tician
10-05-2013, 07:18 PM
Send the CM-5/510/530/700 any 16-bit value split into two bytes (high and low) and transmitted in a 6-byte packet formatted as: 0xFF, 0x55, DATA_L, ~DATA_L, DATA_H, ~DATA_H. The Task program checks for a received packet and extracts the 16-bit value which can be stored into a variable. This gives you 2^16 possible commands to use to control the bot from an external device.

The zigbee sdk that I linked earlier will allow any C/C++ program on the PC to easily send commands to the CM-5/510/530/700. There are ways to import the zigbee library into matlab and labview, if those are more suitable.