cmm-21 / a5

0 stars 0 forks source link

Task 4 apply external force on sphere #18

Open vullnetu opened 3 years ago

vullnetu commented 3 years ago

I have implemented task 4 and it seems to work fine. However, If I start to drag the sphere (apply external force to it) it jumps away from my screen. I noticed that it has something to do with the update in the angular velocity (w'=w'+I^-1*(ra x J). Is my implementation wrong or is our model not laid out for this see below the video video

eastskykang commented 3 years ago

It could be possible that you are giving wrong value for ra (as well as dra/dt)

Remember, the bottom of the ball is not a fixed point. It changes as the ball rotates.

eastskykang commented 3 years ago

This is what I got from my implementation: https://youtu.be/6RTHyJI2zUc

Some interpretations:

vullnetu commented 3 years ago

It could be possible that you are giving wrong value for ra (as well as dra/dt)

Remember, the bottom of the ball is not a fixed point. It changes as the ball rotates.

I agree the bottom of the ball is changing but ra is expressed in world coordinates and it is defined from the COM of the rigid body to the contact point. Therefore, I see ra to be constant.

eastskykang commented 3 years ago

@vullnetu Yes. That's correct. Then now the question is how to get dra/dt by using code base we have.

iqiac commented 3 years ago

Is this necessary to get full points or is it sufficient if we can recreate the demo? I mean I implemented everything, but didn't change the lowest point as the sphere turns.

vullnetu commented 3 years ago

just to clarify with "pose" in the hints you mean position and orientation of the rigid body ?

eastskykang commented 3 years ago

@vullnetu yes, you're right.

@iqiac okay, let's do this, I admit my instruction was a bit vague. I will give you full point if your implementation reproduce exactly same result with the demo I posted. You don't need to worry about external force.

But, please try to modify your code to make it work with external force (and torque) and angular velocity > 0 if you have some time (and motivation). It does not require much effort.

vullnetu commented 3 years ago

For anyone wanting to solve this. Look up the definition of Urel closely, especially its direction. The extra documents on the readme file helped me to understand my mistake.

iqiac commented 3 years ago

@eastskykang Thanks, I'll definitely try later. It's just right now I'm pretty occupied with other subjects.