Gazebo: Q&A Forum - RSS feedhttp://answers.gazebosim.org/questions/Open source question and answer forum for GazeboenCopyright Askbot, 2010-2011.Wed, 17 Feb 2016 09:41:22 -0600How to get the Acceleration of a Jointhttp://answers.gazebosim.org/question/12562/how-to-get-the-acceleration-of-a-joint/Hi folks,
I have a robotic arm in Gazebo from which I am already reading the angles (i.e. `GetAngle(0).Radian()`) as well as the velocity (i.e. `GetVelocity(0)`) from each joint. Now I also need to get the acceleration from the joints.
So far I haven't come across a way to achieve this.
Do you have any ideas?
Cheers,
DennisThu, 11 Feb 2016 09:33:02 -0600http://answers.gazebosim.org/question/12562/how-to-get-the-acceleration-of-a-joint/Answer by debz for <p>Hi folks,</p>
<p>I have a robotic arm in Gazebo from which I am already reading the angles (i.e. <code>GetAngle(0).Radian()</code>) as well as the velocity (i.e. <code>GetVelocity(0)</code>) from each joint. Now I also need to get the acceleration from the joints.</p>
<p>So far I haven't come across a way to achieve this.
Do you have any ideas?</p>
<p>Cheers,
Dennis</p>
http://answers.gazebosim.org/question/12562/how-to-get-the-acceleration-of-a-joint/?answer=12643#post-id-12643The acceleration is the derivative of the velocity and the velocity is the derivative of the position/angle.
You can just create a small class, that keeps in memory the previous (or many previous) angle/velocity and get the acceleration from that. Typically, if you get the velocity of your joint at each iteration i, then the acceleration would be something like:
accelaration[i] = (velocity[i-1] - velocity[i]) / (time[i-1] - time[i])
This is not perfectly exact since we should use:
accelaration[i] = (velocity[i-1] - velocity[i+1]) / (time[i-1] - time[i+1])
But since we can't predict the future, it should give you good aproximation.
An other way would be to use the force sum on your joint and compute the formula F = m.a but this requires much more knowledge and is too cumbersome. `
Wed, 17 Feb 2016 09:41:22 -0600http://answers.gazebosim.org/question/12562/how-to-get-the-acceleration-of-a-joint/?answer=12643#post-id-12643