Get acceleration

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Get acceleration

Neostek
Hello everyone,
i'm using Gazebo to simulate a PD controller on a quadrotor UAV.
The control evalueates the force and torque to apply to the quadrotor and then i use the methods
dBodyAddRelForce(body_id, 0, 0, thrust) and dBodyAddRelTorque(body_id, roll_torque, pitch_torque, 0).
Now i would like to get information about position, velocity and acceleration of the quadrotor.
To do so, i use the methods:
body->GetPosition()
body->GetLinearVel()
body->GetLinearAccel()
and the last one appears to give practically nonsense results (gravity acceleration depending on the mass for instance...).
Browsing into the code i found out that GetLinearAccel() simply does
return this->GetForce() /  this->GetMass();
That is " F = m*a "  as it should be.
Anyway the controller works and the quadrotor get still on the target point, but the acceleration i get on the z axis is positive (e.g. = 19.6) even though the quadrotor is not varying its height.
I really have no point...please help me! :)
Thanks in advance.  

Marco


For the sake of completeness i'm using the following software version:
Gazebo - 0.9.0
Player - 2.1.3
Reply | Threaded
Open this post in threaded view
|

Re: Get acceleration

Peter Nordin-2
Hello

Unfortunately I do not think that I can help you, but I am having a
similar problem.

I am have been trying to use the IMU sensor, (I have added a few missing
player interface related files), but in my case the acceleration is
allways zero. Anyway I was not able to figure out why so I made some
minor additions to the gazebo code and differentiated the linear
velocity between each timestep. This way the reported acceleration will
be the actual velocity derivative. The problem is that I wont get
g=-9.81 in my output. This is OK in my ground robot case as I usually
just remove the gravity component anyway. For flying robots I do not not
know if this is Ok.

I tried adding an additional "artificial" gravity vector (rotated into
the curent body coordinate system) but realised that when the robot was
moving along the Z-axis (very rarely), I would get double acceleration.
-9.81 as well as the actual velocity derivative (-9.81 when free
falling). I the end I removed the artificial gravity vector, as I actual
have no real use for it.

It is probably possible to solve this in some smart way but I have not
had time to try and figure one out.

I am using a fairly recent Gazebo svn version and player 3.0.2

/Peter


On 03/28/2011 05:26 PM, Neostek wrote:

> Hello everyone,
> i'm using Gazebo to simulate a PD controller on a quadrotor UAV.
> The control evalueates the force and torque to apply to the quadrotor and
> then i use the methods
> dBodyAddRelForce(body_id, 0, 0, thrust) and dBodyAddRelTorque(body_id,
> roll_torque, pitch_torque, 0).
> Now i would like to get information about position, velocity and
> acceleration of the quadrotor.
> To do so, i use the methods:
> body->GetPosition()
> body->GetLinearVel()
> body->GetLinearAccel()
> and the last one appears to give practically nonsense results (gravity
> acceleration depending on the mass for instance...).
> Browsing into the code i found out that GetLinearAccel() simply does
> return this->GetForce() /  this->GetMass();
> That is " F = m*a "  as it should be.
> Anyway the controller works and the quadrotor get still on the target point,
> but the acceleration i get on the z axis is positive (e.g. = 19.6) even
> though the quadrotor is not varying its height.
> I really have no point...please help me! :)
> Thanks in advance.
>
> Marco
>
>
> For the sake of completeness i'm using the following software version:
> Gazebo - 0.9.0
> Player - 2.1.3

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Playerstage-gazebo mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
Reply | Threaded
Open this post in threaded view
|

Re: Get acceleration

John Hsu-2
Hi,
I've opened a ticket for this issue
https://kforge.ros.org/gazebo/trac/ticket/24
Please feel free to update the ticket.
Thanks,
<https://kforge.ros.org/gazebo/trac/ticket/24>John

On Tue, Mar 29, 2011 at 7:25 AM, Peter Nordin <[hidden email]> wrote:

> Hello
>
> Unfortunately I do not think that I can help you, but I am having a
> similar problem.
>
> I am have been trying to use the IMU sensor, (I have added a few missing
> player interface related files), but in my case the acceleration is
> allways zero. Anyway I was not able to figure out why so I made some
> minor additions to the gazebo code and differentiated the linear
> velocity between each timestep. This way the reported acceleration will
> be the actual velocity derivative. The problem is that I wont get
> g=-9.81 in my output. This is OK in my ground robot case as I usually
> just remove the gravity component anyway. For flying robots I do not not
> know if this is Ok.
>
> I tried adding an additional "artificial" gravity vector (rotated into
> the curent body coordinate system) but realised that when the robot was
> moving along the Z-axis (very rarely), I would get double acceleration.
> -9.81 as well as the actual velocity derivative (-9.81 when free
> falling). I the end I removed the artificial gravity vector, as I actual
> have no real use for it.
>
> It is probably possible to solve this in some smart way but I have not
> had time to try and figure one out.
>
> I am using a fairly recent Gazebo svn version and player 3.0.2
>
> /Peter
>
>
> On 03/28/2011 05:26 PM, Neostek wrote:
> > Hello everyone,
> > i'm using Gazebo to simulate a PD controller on a quadrotor UAV.
> > The control evalueates the force and torque to apply to the quadrotor and
> > then i use the methods
> > dBodyAddRelForce(body_id, 0, 0, thrust) and dBodyAddRelTorque(body_id,
> > roll_torque, pitch_torque, 0).
> > Now i would like to get information about position, velocity and
> > acceleration of the quadrotor.
> > To do so, i use the methods:
> > body->GetPosition()
> > body->GetLinearVel()
> > body->GetLinearAccel()
> > and the last one appears to give practically nonsense results (gravity
> > acceleration depending on the mass for instance...).
> > Browsing into the code i found out that GetLinearAccel() simply does
> > return this->GetForce() /  this->GetMass();
> > That is " F = m*a "  as it should be.
> > Anyway the controller works and the quadrotor get still on the target
> point,
> > but the acceleration i get on the z axis is positive (e.g. = 19.6) even
> > though the quadrotor is not varying its height.
> > I really have no point...please help me! :)
> > Thanks in advance.
> >
> > Marco
> >
> >
> > For the sake of completeness i'm using the following software version:
> > Gazebo - 0.9.0
> > Player - 2.1.3
>
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Playerstage-gazebo mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
>
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Playerstage-gazebo mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
Reply | Threaded
Open this post in threaded view
|

Re: Get acceleration

Luca Ricci
In reply to this post by Peter Nordin-2
Hi Peter,
I'm facing the same problem with getting acceleration from gazebo and i'm using a flying robot.
Do you think it could be possible to have your code (i mean the imu interface and the gazebo files you modified)? I need to solve this problem and a "starting point" would be of great help!
(Obviously i'll share with you my solution when i'll come to one :)
Thanks in advance.

Luca

Peter Nordin-2 wrote
Hello

Unfortunately I do not think that I can help you, but I am having a
similar problem.

I am have been trying to use the IMU sensor, (I have added a few missing
player interface related files), but in my case the acceleration is
allways zero. Anyway I was not able to figure out why so I made some
minor additions to the gazebo code and differentiated the linear
velocity between each timestep. This way the reported acceleration will
be the actual velocity derivative. The problem is that I wont get
g=-9.81 in my output. This is OK in my ground robot case as I usually
just remove the gravity component anyway. For flying robots I do not not
know if this is Ok.

I tried adding an additional "artificial" gravity vector (rotated into
the curent body coordinate system) but realised that when the robot was
moving along the Z-axis (very rarely), I would get double acceleration.
-9.81 as well as the actual velocity derivative (-9.81 when free
falling). I the end I removed the artificial gravity vector, as I actual
have no real use for it.

It is probably possible to solve this in some smart way but I have not
had time to try and figure one out.

I am using a fairly recent Gazebo svn version and player 3.0.2

/Peter


On 03/28/2011 05:26 PM, Neostek wrote:
> Hello everyone,
> i'm using Gazebo to simulate a PD controller on a quadrotor UAV.
> The control evalueates the force and torque to apply to the quadrotor and
> then i use the methods
> dBodyAddRelForce(body_id, 0, 0, thrust) and dBodyAddRelTorque(body_id,
> roll_torque, pitch_torque, 0).
> Now i would like to get information about position, velocity and
> acceleration of the quadrotor.
> To do so, i use the methods:
> body->GetPosition()
> body->GetLinearVel()
> body->GetLinearAccel()
> and the last one appears to give practically nonsense results (gravity
> acceleration depending on the mass for instance...).
> Browsing into the code i found out that GetLinearAccel() simply does
> return this->GetForce() /  this->GetMass();
> That is " F = m*a "  as it should be.
> Anyway the controller works and the quadrotor get still on the target point,
> but the acceleration i get on the z axis is positive (e.g. = 19.6) even
> though the quadrotor is not varying its height.
> I really have no point...please help me! :)
> Thanks in advance.
>
> Marco
>
>
> For the sake of completeness i'm using the following software version:
> Gazebo - 0.9.0
> Player - 2.1.3

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Playerstage-gazebo mailing list
Playerstage-gazebo@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
Reply | Threaded
Open this post in threaded view
|

Re: Get acceleration

Neostek
In reply to this post by John Hsu-2
Hi Peter and John,
I'm facing the same problem with getting acceleration from gazebo and i'm using a flying robot.
Do you think it could be possible to have your code (i mean the imu interface and the gazebo files you modified)? I need to solve this problem and a "starting point" would be of great help!
(Obviously i'll share with you my solution when i'll come to one :)
Thanks in advance.
Marco

@John: Thanks a lot for opening thread. It could be very useful!

John Hsu-2 wrote
Hi,
I've opened a ticket for this issue
https://kforge.ros.org/gazebo/trac/ticket/24
Please feel free to update the ticket.
Thanks,
<https://kforge.ros.org/gazebo/trac/ticket/24>John

On Tue, Mar 29, 2011 at 7:25 AM, Peter Nordin <peter.nordin@liu.se> wrote:

> Hello
>
> Unfortunately I do not think that I can help you, but I am having a
> similar problem.
>
> I am have been trying to use the IMU sensor, (I have added a few missing
> player interface related files), but in my case the acceleration is
> allways zero. Anyway I was not able to figure out why so I made some
> minor additions to the gazebo code and differentiated the linear
> velocity between each timestep. This way the reported acceleration will
> be the actual velocity derivative. The problem is that I wont get
> g=-9.81 in my output. This is OK in my ground robot case as I usually
> just remove the gravity component anyway. For flying robots I do not not
> know if this is Ok.
>
> I tried adding an additional "artificial" gravity vector (rotated into
> the curent body coordinate system) but realised that when the robot was
> moving along the Z-axis (very rarely), I would get double acceleration.
> -9.81 as well as the actual velocity derivative (-9.81 when free
> falling). I the end I removed the artificial gravity vector, as I actual
> have no real use for it.
>
> It is probably possible to solve this in some smart way but I have not
> had time to try and figure one out.
>
> I am using a fairly recent Gazebo svn version and player 3.0.2
>
> /Peter
>
>
> On 03/28/2011 05:26 PM, Neostek wrote:
> > Hello everyone,
> > i'm using Gazebo to simulate a PD controller on a quadrotor UAV.
> > The control evalueates the force and torque to apply to the quadrotor and
> > then i use the methods
> > dBodyAddRelForce(body_id, 0, 0, thrust) and dBodyAddRelTorque(body_id,
> > roll_torque, pitch_torque, 0).
> > Now i would like to get information about position, velocity and
> > acceleration of the quadrotor.
> > To do so, i use the methods:
> > body->GetPosition()
> > body->GetLinearVel()
> > body->GetLinearAccel()
> > and the last one appears to give practically nonsense results (gravity
> > acceleration depending on the mass for instance...).
> > Browsing into the code i found out that GetLinearAccel() simply does
> > return this->GetForce() /  this->GetMass();
> > That is " F = m*a "  as it should be.
> > Anyway the controller works and the quadrotor get still on the target
> point,
> > but the acceleration i get on the z axis is positive (e.g. = 19.6) even
> > though the quadrotor is not varying its height.
> > I really have no point...please help me! :)
> > Thanks in advance.
> >
> > Marco
> >
> >
> > For the sake of completeness i'm using the following software version:
> > Gazebo - 0.9.0
> > Player - 2.1.3
>
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Playerstage-gazebo mailing list
> Playerstage-gazebo@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
>
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Playerstage-gazebo mailing list
Playerstage-gazebo@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
Reply | Threaded
Open this post in threaded view
|

Re: Get acceleration

Peter Nordin-2
Ok, a made a svn diff on my current working directory, I then clean this
up by hand a bit.
I removed some other stuff that is unrelated.

You can find my latest atempt att sending in a patch that adds the
missing imu player interface files here:
http://sourceforge.net/tracker/?func=detail&aid=3195458&group_id=42445&atid=433166

This patch is against a very recent trunk revsion so you will have to
make some modifications. I previously tried to commit this path and
those files should still be in the tracker if you want to look for them.
That version may be more likely to work with gazebo 0.9. But I think the
only difference is that some file changed name, gazebo.h to gz.h, and
maybe some function names were changes.

After taking a look at, or applying that patch you can check the svn
diff file that will hopefully be attached to this email.
Do not try to apply this as a patch, as I have made some manual cleanup.
Also some contents may overlap with the IMU patch.
In the diff file you can find my additional (more or less ugly) changes
that I made to get velocity derivative in the accelerometer output.

If you find something in there that looks suspicious, please let me
know. I have not really made sure that it actually works as it is
suposed to, (it seems to however).

/Peter



On 03/30/2011 04:42 PM, Neostek wrote:

> Hi Peter and John,
> I'm facing the same problem with getting acceleration from gazebo and i'm
> using a flying robot.
> Do you think it could be possible to have your code (i mean the imu
> interface and the gazebo files you modified)? I need to solve this problem
> and a "starting point" would be of great help!
> (Obviously i'll share with you my solution when i'll come to one :)
> Thanks in advance.
> Marco
>
> @John: Thanks a lot for opening thread. It could be very useful!
>
>
> John Hsu-2 wrote:
>> Hi,
>> I've opened a ticket for this issue
>> https://kforge.ros.org/gazebo/trac/ticket/24
>> Please feel free to update the ticket.
>> Thanks,
>> <https://kforge.ros.org/gazebo/trac/ticket/24>John
>>
>> On Tue, Mar 29, 2011 at 7:25 AM, Peter Nordin<[hidden email]>  wrote:
>>
>>> Hello
>>>
>>> Unfortunately I do not think that I can help you, but I am having a
>>> similar problem.
>>>
>>> I am have been trying to use the IMU sensor, (I have added a few missing
>>> player interface related files), but in my case the acceleration is
>>> allways zero. Anyway I was not able to figure out why so I made some
>>> minor additions to the gazebo code and differentiated the linear
>>> velocity between each timestep. This way the reported acceleration will
>>> be the actual velocity derivative. The problem is that I wont get
>>> g=-9.81 in my output. This is OK in my ground robot case as I usually
>>> just remove the gravity component anyway. For flying robots I do not not
>>> know if this is Ok.
>>>
>>> I tried adding an additional "artificial" gravity vector (rotated into
>>> the curent body coordinate system) but realised that when the robot was
>>> moving along the Z-axis (very rarely), I would get double acceleration.
>>> -9.81 as well as the actual velocity derivative (-9.81 when free
>>> falling). I the end I removed the artificial gravity vector, as I actual
>>> have no real use for it.
>>>
>>> It is probably possible to solve this in some smart way but I have not
>>> had time to try and figure one out.
>>>
>>> I am using a fairly recent Gazebo svn version and player 3.0.2
>>>
>>> /Peter
>>>
>>>
>>> On 03/28/2011 05:26 PM, Neostek wrote:
>>>> Hello everyone,
>>>> i'm using Gazebo to simulate a PD controller on a quadrotor UAV.
>>>> The control evalueates the force and torque to apply to the quadrotor
>>> and
>>>> then i use the methods
>>>> dBodyAddRelForce(body_id, 0, 0, thrust) and dBodyAddRelTorque(body_id,
>>>> roll_torque, pitch_torque, 0).
>>>> Now i would like to get information about position, velocity and
>>>> acceleration of the quadrotor.
>>>> To do so, i use the methods:
>>>> body->GetPosition()
>>>> body->GetLinearVel()
>>>> body->GetLinearAccel()
>>>> and the last one appears to give practically nonsense results (gravity
>>>> acceleration depending on the mass for instance...).
>>>> Browsing into the code i found out that GetLinearAccel() simply does
>>>> return this->GetForce() /  this->GetMass();
>>>> That is " F = m*a "  as it should be.
>>>> Anyway the controller works and the quadrotor get still on the target
>>> point,
>>>> but the acceleration i get on the z axis is positive (e.g. = 19.6) even
>>>> though the quadrotor is not varying its height.
>>>> I really have no point...please help me! :)
>>>> Thanks in advance.
>>>>
>>>> Marco
>>>>
>>>>
>>>> For the sake of completeness i'm using the following software version:
>>>> Gazebo - 0.9.0
>>>> Player - 2.1.3
>>>
>>> ------------------------------------------------------------------------------
>>> Enable your software for Intel(R) Active Management Technology to meet
>>> the
>>> growing manageability and security demands of your customers. Businesses
>>> are taking advantage of Intel(R) vPro (TM) technology - will your
>>> software
>>> be a part of the solution? Download the Intel(R) Manageability Checker
>>> today! http://p.sf.net/sfu/intel-dev2devmar
>>> _______________________________________________
>>> Playerstage-gazebo mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
>>>
>> ------------------------------------------------------------------------------
>> Enable your software for Intel(R) Active Management Technology to meet the
>> growing manageability and security demands of your customers. Businesses
>> are taking advantage of Intel(R) vPro (TM) technology - will your software
>> be a part of the solution? Download the Intel(R) Manageability Checker
>> today! http://p.sf.net/sfu/intel-dev2devmar
>> _______________________________________________
>> Playerstage-gazebo mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
>>
>>

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself;
WebMatrix provides all the features you need to develop and
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf

_______________________________________________
Playerstage-gazebo mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo

difffile (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

kforge.ros.org or sourceforge

Peter Nordin-2
Hi Jhon,

After seeing that there is an issue tracker at
https://kforge.ros.org/gazebo/trac/ I am wondering.

Which bug tracker should we use, the sourceforge one or the ros one?

Is kforge.ros only meant for ROS related Gazebo issues or for Player
related ones to?

I have seen that there is a WG branch of Gazebo on sourceforge. Is that
the code that I can browse from the kforge.ros site or is that yet
another version of the Gazebo code?

Will ros related Gazebo fixes and additions be merged into the Gazebo
trunk at sourceforge?

Actually what I basically would like to know is if WillowGarage is
"taking over" the main Gazebo development?

/Peter


------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself;
WebMatrix provides all the features you need to develop and
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Playerstage-gazebo mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
Reply | Threaded
Open this post in threaded view
|

Re: kforge.ros.org or sourceforge

Nate Koenig
Hi Peter,

Thanks for the email.

Gazebo is currently in transition from Sourceforge to a WillowGarage
supported system (kforge.ros.org). What this means is that we will
have more resources at our disposal for development and support. There
are no plans to tie Gazebo directly to ROS. Gazebo itself will remain
an independent library for use by the community.

While this transition is taking place over the next few weeks, please
use the Sourceforge resources. All patches and bug fixes will be
applied to both the SVN repo on Sourceforge and the Mercurial repo on
kforge.ros.org.

Look for a email on this list in the near future about a formal switch
to kforge.

Cheers,
-nate

On Wed, Mar 30, 2011 at 8:58 AM, Peter Nordin <[hidden email]> wrote:

> Hi Jhon,
>
> After seeing that there is an issue tracker at
> https://kforge.ros.org/gazebo/trac/ I am wondering.
>
> Which bug tracker should we use, the sourceforge one or the ros one?
>
> Is kforge.ros only meant for ROS related Gazebo issues or for Player
> related ones to?
>
> I have seen that there is a WG branch of Gazebo on sourceforge. Is that
> the code that I can browse from the kforge.ros site or is that yet
> another version of the Gazebo code?
>
> Will ros related Gazebo fixes and additions be merged into the Gazebo
> trunk at sourceforge?
>
> Actually what I basically would like to know is if WillowGarage is
> "taking over" the main Gazebo development?
>
> /Peter
>
>
> ------------------------------------------------------------------------------
> Create and publish websites with WebMatrix
> Use the most popular FREE web apps or write code yourself;
> WebMatrix provides all the features you need to develop and
> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
> _______________________________________________
> Playerstage-gazebo mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
>

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself;
WebMatrix provides all the features you need to develop and
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Playerstage-gazebo mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo