Execute direct kinematics with btHingeConstraint
Posted: Fri Jul 05, 2019 6:44 am
Hello Experts,
I am having trouble simulate direct kinematics with the hinge constraints with my data.
I have two cubes which their center of mass is (50,50,50) and (50,50,150) the size of each edge is 100 .
In addition I want to define a hinge constraints on (0,0,100) with the Y axis.
All the coordinates are in the WCS.
When I use the bullet I am creating two rigid bodies with the center of the cubes and a hinge constraint .
The rigid body that represent the (50,50,50) cube is static.
Then I define an angular motor on the hinge so it will move 45 degrees.
My problem is that when I step simulation the object seems to move but the point of the hinge is incorrect and it moves instead of only rotates.
I have tried setting the angular only and it did not move at all and as well I have tried to use the hinge with the offsetframes as false and it didnt work.
As well using a btEmptyshape in the rigid body.
I cannot use the MultiBody capabilities.
Also I have tried to use as I saw in the form the btSliderJoint with an angular but it didnt work.
When I am creating the btHingeConstraint it ask for 2 dots and 2 vectors or a transform. I think that the problem is that I am not supplying the correct information .
I have tried to look on code examples and the documentation and with no luck .
My question is what should I supply in those parameters ? is it relative to the center of mass ? how do I calculate it?
Thanks in advance for the help.
I am having trouble simulate direct kinematics with the hinge constraints with my data.
I have two cubes which their center of mass is (50,50,50) and (50,50,150) the size of each edge is 100 .
In addition I want to define a hinge constraints on (0,0,100) with the Y axis.
All the coordinates are in the WCS.
When I use the bullet I am creating two rigid bodies with the center of the cubes and a hinge constraint .
The rigid body that represent the (50,50,50) cube is static.
Then I define an angular motor on the hinge so it will move 45 degrees.
My problem is that when I step simulation the object seems to move but the point of the hinge is incorrect and it moves instead of only rotates.
I have tried setting the angular only and it did not move at all and as well I have tried to use the hinge with the offsetframes as false and it didnt work.
As well using a btEmptyshape in the rigid body.
I cannot use the MultiBody capabilities.
Also I have tried to use as I saw in the form the btSliderJoint with an angular but it didnt work.
When I am creating the btHingeConstraint it ask for 2 dots and 2 vectors or a transform. I think that the problem is that I am not supplying the correct information .
I have tried to look on code examples and the documentation and with no luck .
My question is what should I supply in those parameters ? is it relative to the center of mass ? how do I calculate it?
Thanks in advance for the help.