I am working on a robotics project with my friends Matthew Ebisu (lead) and Faranak Keshmiri (animator). We are researching ways animators can help improve human-to-robot interactions. My primary role is assembling robot pieces and creating rigs in Maya. We are using Servo Tools for Maya written by Dan Thompson. This page will be updated as we progress with the project.
(This section is copied from one of my blog posts. I figured it would get more visibility here.)
I designed the Maya rig to have FK and two versions of IK chains (arc and spring), and they can all blend between each other.
The IK arc chain is controlled by an expression that I wrote based on some simple geometry.
$pitch = 0.0;
if (IK_ctrl.translateX >= 0){
$pitch = IK_aim.rotateZ;
}
else {
$pitch = IK_aim.rotateZ - 180.0;
}
$lenRatio = `min 1 (shortDistShape.distance / armDistShape.distance)`;
shoulder_IKarc_jnt.rotateY = acosd (1.5 * $lenRatio - 0.5) + $pitch;
elbow_IKarc_jnt.rotateY = (-1.0) * acosd (1.5 * $lenRatio - 0.5);
wrist_IKarc_jnt.rotateY = (-1.0) * acosd (1.5 * $lenRatio - 0.5);$pitch is used to tilt the base joint to meet the IK control.
IK_aim is a Locator on the base aim constrained to another Locator in the same location as the IK control.
$lenRatio is the ratio of the compressed arm length to the uncompressed arm length. I used Maya's Distance Tool for this.
If the ratio exceeds 1 (IK control pulled beyond limit), use 1 for later calculations.
...And the rest is geometry. Yay math!
We also made a lamp robot based on the arm, and even inserted a NeoPixel ring. We are currently figuring out a way to transfer color information from Maya to Arduino.
In the image below, each floating square is a NURBS surface, to which I've added a Hue, Sat, and Lum control. These are fed into an hsvToRgb node, which in turn feeds into one of 16 materials.
For the quadruped, we used a robot designed by Ronald Jaramillo. The main challenge with this is that it interacts with the ground, so the Maya rig must be designed to replicate what would happen in real life.
There are 4 controls for the body: 1 overall position (OP) control, which is the parent of 2 pitch controls and 1 roll control. I'm using the terms pitch and roll the same way they are used to describe aircrafts.
The pitch controls allow users to rotate the body without having to counter-animate, which would be required if the body could only rotate about its center. To achieve this, a locator is constrained such that it is always positioned at the midpoint between each pitch control, and aim constrained to one of them. The locator's orientation is then carried to the root joint.
The roll control works with two empty transform (xform for short) nodes placed flush with the lateral side of the legs: one on the left, another on the right (see white +'s below). The xform nodes are orient constrained to the roll control, and the OP control is parent constrained to both xform nodes. A Condition node is used to determine which xform node is the active "parent", depending on which way the roll control is rotated.
Like the arm and lamp, each leg of the quadruped has FK, IK, and Drive joint chains. I initially tried to lock the IK joints to a single axis, but they did not behave properly when I rolled the rig. Instead, I placed locators (green +'s below) on each side of the rig: one aligned with the left legs, and one aligned with the right. These locators are parented to the OP control, and serve as pole vector constrains. This way, the legs would remain aligned even when the rig is rolled. Lastly, the IK controls are orient constrained to the OP control, to force users to move them along the appropriate axes.
In early tests the Maya-to-Arduino connection would break due to insufficient power to the 8 servos. Matt added 4 AA batteries to the set up, which I have placed inside the body. We had it on top at first, but it became too top-heavy and would topple easily when rolled.