What kind of object works in BGE for Rigid Body Joint

I hope to make a walking robot in auto balance without keyframes.
Only calcurate angles of joints for two legs under body.
Then I want to know how to set angle of joint for two block. elementary way.
When I add a Rigid Body Joint Constraint to upper block which raise motion
In BGE what kind of class represents a Rigid Body joint constraint and how to get the object?
thanks

For RBJ’s (Rigif Body Joints) to be accessible to the python scripts, you have to create them from within python. Have a look at the constraints module. In particular createConstraint.
You can get game objects either by name:

obj = bge.logic.getCurrentScene().objects['name']

or by putting and searching for a game property:

obj = [o for o in bge.logic.getCurrentScene().objects if 'property_name' in o][0]

(That is a list comprehension, and could also be written out in full using a for loop, if statement and appending to a list)

For calculating the angles of joints, get the vectors for axis of the two parts (with obj.getAxisVect), and use the angle function in mathutils to calculate an euler angle.

To set the angle of joints, do the reverse (get the vector for one of the parts, use the rotate function, and then use obj.alighnAxisToVect)

Thanks a lot. @sdfgeoff

Because i entered the min and max values of axis X for limit of RBJ constraint in BLENDER UI
and activated the BGE player, the joint was bended.
So I thought a way as below (trial code)


import bpy
import bge

me = bge.logic.getCurrentController()
own = me.owner

if own.sensors[“BUTTON_A”].positive:
own[“angle”] += 0.1
bpy.data.objects[“Cube1”].constraints[“Rigid Body Joint”].limit_angle_min_x = own[“angle”]
bpy.data.objects[“Cube1”].constraints[“Rigid Body Joint”].limit_angle_max_x = own[“angle”]


BUT
When i activated BGE player and did key-in ‘A’ , nothing happened.

Do you mind explain me about
When use limit_angle_min_x & limit_angle_max_x? These variables are read-only?

You’ve imported bpy. You can’t use bpy in the BGE.

I have a thread dedicated to walking 6dof using torque.

I have a thread dedicated to walking 6dof using torque.
/uploads/default/original/3X/6/b/6b9a51c096b147b8414876fb7898138417ad3a56.blendd=1378084810