Hey, I am having trouble implementing joints with cODE. I have not been able to find an example to use. I have tried to implement joints based off of the ODE documentation, tho the results have seemed to be quite unreasonable. Would someone be able to point me in the right direction.
Our first suggestion would be to look at the examples provided by ODE. Perhaps you could take the first example 01-ODE-cube in CHAI3D and simply try to add a revolute joint between two of the cubes.
This being being said, we will take a closer look at this matter and will prepare an example that we can add to the CHAI3D ODE module. We will keep you posted.
Here is a short code example on how to place a hinge between two dynamic bodies.
The dynamic objects need to be declared first and then the joints can be placed between them to create a connection. The parameters that describe each joint are expressed in world coordinates in the same manner as the dynamic bodies are created.
In practice you will probably want to set one of the bodies to be static, in particular if you are creating an articulated object such as a door or a grounded robot manipulator.
// create a joint group jointGroupID = dJointGroupCreate(0); // create a hinge hinge01 = dJointCreateHinge(ODEWorld->m_ode_world, jointGroupID); // attach objects 0 and 1 together using a hinge dJointAttach(hinge01, ODEBody0->m_ode_body, ODEBody1->m_ode_body); // set the anchor point and axis of the hinge dJointSetHingeAnchor(hinge01, 0.0,-0.4, 0.45); dJointSetHingeAxis(hinge01, 1.0, 0.0, 0.0);