Calculate Hinge Constraint Limit Angle

Software: Away3D 4.x

Betillo555, Newbie
Posted: 19 August 2014 06:24 AM   Total Posts: 2

I’m making a robotic arm which has several joints, each connected to the last one. I’m using Hinge constraints to limit the joints when they are not being used, setting the limit to the same angle like this: myHinge.setLimit(angle,angle);

And setting it back to (-Math.PI/2 , Math.PI/2) when in use.

I’m not sure if this is the best approach for what I’m doing but it’s working quite well.

I managed to get a good approximation of the angle for the bottom arm using Vector3DUtils.getAngle… but this doesn’t work for the middle and upper arm since they are dependent on the movement of the arms below them and I’m not really good at 3D Math.

How can I calculate the angle for each hinge limit in this case?

Thanks for this great engine.

 

Image Attachments
HingeConstraintAngle.png
   

Betillo555, Newbie
Posted: 21 August 2014 07:52 AM   Total Posts: 2   [ # 1 ]

I got it working :D

I went in a different direction, I was opening the limits on each hinge and using setAngularMotor to move the arms around and trying to calculate the ending limit angle when the arms came to a stop using motorTargetVelocity = 0 and activationState = 0.

There was no need to use the motor nor calculate the ending limit angle. The limits are always the same, they are closed, and I update them using the values from the sliders. This works better than expected.

I will be posting a link with a demo.

Cheers!

 

Image Attachments
Robotic_Arm_01.png
   

inCreactive, Newbie
Posted: 22 October 2014 10:28 PM   Total Posts: 2   [ # 2 ]

I’ve been busy with other projects but here’s my promised demo: Robotic Arm

Read the instructions, you can also use the keyboard to manipulate the robotic arm.

Cheers!

 

Image Attachments
Robotic_Arm_03.png
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X