Gyro sensor doesn't use simGetObjectVelocity

Typically: "How do I... ", "How can I... " questions
Post Reply
kubark42
Posts: 15
Joined: 10 Dec 2014, 18:34

Gyro sensor doesn't use simGetObjectVelocity

Post by kubark42 »

I notice that the gyro sensor's child script performs a simple derivative approximation to get the angular velocity. Would it make more sense to use simGetObjectVelocity instead?

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

Re: Gyro sensor doesn't use simGetObjectVelocity

Post by coppelia »

Hello,

what the sensor does is compute the transformation matrix from one frame to the next. Then divide the positional variation, and the Euler angles, with the simulation time step. Using simGetObjectVelocity, you will very probably obtain the same results. But you are free to modify the child script in order to customize the sensor's behaviour to your own needs.

Cheers

kubark42
Posts: 15
Joined: 10 Dec 2014, 18:34

Re: Gyro sensor doesn't use simGetObjectVelocity

Post by kubark42 »

I'm happy either way. I'm using simObjectGetVelocity in my code, but was wondering which was the "V-REP way" since both seemed to work.

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

Re: Gyro sensor doesn't use simGetObjectVelocity

Post by coppelia »

Oh, probably the model of the gyro was made before the simGetObjectVelocity function was implemented... !

Cheers

Post Reply