Dynamic robot simulation

Hi

I have a school project where I have to control a little robot, with 2 legs, moved by 6 motors. The angles in every small time period must be specified with a PWM signal. The controlling VHDL program is mostly done, the only great problem are the angles that I must give for the walking cycle. For this I thought Blender would come handy. My plan was to create the robot, make a walking cycle which simulates good enough with Bullet physics, then write a python script which will export the angles of the bones in the armature used.

So I made a very similar single-mesh robot in Blender, created an armature for it, rigged it (seems OK for me), also created a simple action, the game logic bricks to start this action, but here I’m stuck. I tried every combination possible for the object type of the armature and mesh, but it’s either not simulated (it’s just simply playing the animation) or it flies away. I’ve read a bunch of tutorials and topics (many here) but I still can’t do it right.

Any help would be greatly appreciated. (Sorry for my English, and in case I’m not posting this in the right place)

EDIT: I forgot to mention, don’t know if it has any importance, but I used Blender 2.49, still can’t get used to the new interface

Attachments

robot.13.blend (261 KB)

I think with normal bone animation it wouldn’t work. If you enable the physic visualisation you will see that the collision mesch wouldn’t folow the visual mesch. You can try it with shape keys. Shape keys deforms the collision mesch.

I have never tried it, but you can try iTaSC (RobotIKSolver) http://wiki.blender.org/index.php/Dev:Source/GameEngine/RobotIKSolver.
It is a special Blender 2.55 version. You can download it here http://graphicall.org/builds/builds/showbuild.php?action=show&id=1525. There is also a 2.49 version but I can’t found it any more.

Thanks for the reply.

According to this it’s possible:
wiki.blender.org/index.php/Meta:Sandbox/Game_Engine/GameKit_2/10.Character_Animation
But the images are missing thus some critical information as well.

Yes, I see it.

Yes, that truly might work, but it’s really hard to make an animation like this. I’ll always need to position the cursor to rotation point, rotate it, if I’m lucky on some global coordinates, but no local coordinate system can be used (because there’s only one mesh), and so on.

I had another idea. I tried using many meshes instead of one. The problem with this is that the GE does not handle well multiple parented rigid bodies, and it goes crazy if these objects intersect each other. I could use boolean operators to make every object disjunctive, but that would also make my objects clustered (creating many new vertices) which will make it even harder to animate, render, simulate and getting the result (angles). If I only make my objects disjunctive, an no parentage, it might work great but my object will shake like it has some kind of disease.

So, with one word, I’m clueless.

At the last time the blenderartists forum is very slow at the evening and all the time when I try to answer you it did not work.

According to this it’s possible:
wiki.blender.org/index.php/Meta:Sandbox/Game_Engine/GameKit_2/10.Character_Animation
But the images are missing thus some critical information as well

That is the normal way how to rigging be done in the game engine.
But the problem is when you use armatures on the mesh the collision would always be calculated from the object where you enable the physic (dynamic or rigid body). You can also have only one object (mesh or armature) as dynamic otherwise the mesh and the armature will be collide and fly away. On all other objects must be enabled “Gost” or “No Collision” .

Your other idea was good, I tried the same with a car and a train but that did not work good. I had the same problems as you.
Instade of using boolean operators to cut a hole through the servo motor you can cut the shaft on the left and the right. You must have a minimum margin of 0.1 blender units between motor an shaft, otherwise the parts will be collide. Then you can try to use constraints (Rigid Body Joint) and lock all non moveable orientations of the objects.
If the blender constraints that not working you can try to use a python script with physic constraints.

I found a robotic simualtion software for Blender, it called MORSE maybe that can help you.

@SinistraD:

It is usual in the game engine to use a separate motion actuator to drive the armature forwards whilst an action is playing. This simulates the forwards motion, it is not actually propelled forwards by the traction of the feet on the floor.

It might be possible to create some kind of rigid body structure propelled by motors on the rigid body joints, but I’m afraid that I don’t yet know how to implement this. 6DoF constraints can act as pivots or sliders and can be driven by rotational and linear forces called “motors” in the api. As I said, I’ve not yet used these, but the following link might help:

http://www.tutorialsforblender3d.com/GameModule/ClassKX_PyConstraintBinding_1f.html

Parameters 6 to 11 on the joints are the motors.