Add Torque on the model, but the rotation was not excepted

Typically: "How do I... ", "How can I... " questions
Post Reply
MarxLiu
Posts: 8
Joined: 25 Mar 2020, 06:34

Add Torque on the model, but the rotation was not excepted

Post by MarxLiu »

Hi,
I am testing an arm. When I used

Code: Select all

sim.addForceAndTorque
function to add torque on the arm, the rotation is not what I excepted. I tried rotating the model around x axis by

Code: Select all

sim.addForceAndTorque(servo_shoulder_right, {0, 0, 0}, {1, 0, 0})
and rotating the model around z axis by

Code: Select all

sim.addForceAndTorque(servo_shoulder_right, {0, 0, 0}, {0, 0, 1})
. It's all fine. But when I tried rotating it around y axis by

Code: Select all

sim.addForceAndTorque(servo_shoulder_right, {0, 0, 0}, {0, 1, 0})
, it failed. I tried troubleshooting the unexcepted behavior by checking the moment of inertia, which shown below. But I couldn't find useful infomation on it.
0.0053074536845088 1.4479227274933e-06 4.3802359869005e-05
1.4479227274933e-06 0.0022340561263263 0.00022103909577709
4.3802359869005e-05 0.00022103909577709 0.018778828904033
Given any object with moment of inertia coupled in any two axes, it's rotation should be affected by each other equally on the coupled axes. However, the scene, that I am testing, seems not.

To find the problem, I simplify the model and it's here
https://drive.google.com/open?id=1GPwrm ... WuuTN2k3ra

the simulation result is like video below
https://youtu.be/td_OBNda7uE

coppelia
Site Admin
Posts: 8387
Joined: 14 Dec 2012, 00:25

Re: Add Torque on the model, but the rotation was not excepted

Post by coppelia »

Hello,

your principal moment of inertia is [x y 0]. Physics engines do not like that. Try to replace the 0 with a small value.

Cheers

Post Reply