« Return to Thread: Re: [ns3] Vector and different coordinates system (Federico Guerra) (Nicola Baldo)

Re: [ns3] Vector and different coordinates system (Federico Guerra) (Nicola Baldo)

by Federico Guerra :: Rate this Message:

| View in Thread

Thanks Lloyd,
I've checked the code.

So the idea so far is to have new geographical coord system based on lat (decimal degrees), long (decimal degrees), radius, (or the equivalent spherical coords theta, phi, radius) 
and having user interface (MobilityModels helpers) use latitude, longitude, altitude.

The main question remains open, though, how integrate a new coordinates system within the ns3 framework, without disrupting existing code.

Cheers,

Federico Guerra
http://www.guerra-tlc.com





________________________________
 Da: "L.Wood@..." <L.Wood@...>
A: fedwar82@...; ns-developers@...
Inviato: Mercoledì 18 Aprile 2012 12:25
Oggetto: RE: [Ns-developers] [ns3] Vector and different coordinates system (Federico Guerra) (Nicola Baldo)
 
Henderson's code has that helper - as I said, user interface. Go look at the code.

Lloyd Wood
http://sat-net.com/L.Wood/


________________________________________
From: Federico Guerra [fedwar82@...]
Sent: 18 April 2012 09:36
To: Wood L  Dr (Electronic Eng); ns-developers@...
Subject: Re: [Ns-developers] [ns3] Vector and different coordinates system (Federico Guerra) (Nicola Baldo)

Hi Lloyd,
thanks for your advice: I agree, the coord system should use radius at NS3 framework level.
(Actually my WOSS library does exactly that for other internal computations.)

Question:
Should some helper provide some kind of converter to/from radius, to let the user provide altitude in input for the simulations, which is a more immediate info to gather?

Cheers,

Federico Guerra

________________________________
Da: "L.Wood@..." <L.Wood@...>
A: fedwar82@...; ns-developers@...
Inviato: Mercoledì 18 Aprile 2012 10:13
Oggetto: RE: [Ns-developers] [ns3] Vector and different coordinates system (Federico Guerra) (Nicola Baldo)



My advice: use proper radius from the centre of the body. (Negative radius is 180 degrees the other way.) Turning that into altitude for users by subtracting/adding a SURFACE_RADIUS offset is trivial, and then you cope with bodies of any size - and subtracting SURFACE_RADIUS from a radius lower than that gives you your negative depth. And converting the spherical coordinates to XYZ cartesian is straightforward.

Tom Henderson's ns-2 satellite code does this already. It's already been written.
http://nsnam.cvs.sourceforge.net/viewvc/nsnam/ns-2/satellite/satgeometry.cc?revision=1.6&view=markup

But, let me stress this: altitude is not general enough. Altitude is a user interface thing, much like working in degrees C rather than Kelvin. If the base calculations rely on altitude, the model is broken.

Lloyd Wood
http://sat-net.com/L.Wood/


________________________________________
From: ns-developers-bounces@...<mailto:ns-developers-bounces@...> [ns-developers-bounces@...<mailto:ns-developers-bounces@...>] On Behalf Of Federico Guerra [fedwar82@...<mailto:fedwar82@...>]
Sent: 18 April 2012 08:52
To: ns-developers@...<mailto:ns-developers@...>
Subject: Re: [Ns-developers] [ns3] Vector and different coordinates system      (Federico Guerra) (Nicola Baldo)

Hi Nicola,
a minor correction:

1) the coordinate system that you would like to have is (latitude in
degrees, longitude in degrees, depth below earth surface). Is this correct?


latitude and longitude should be in decimal degrees. I would use altitude though, that is more general, and depth would be represented by negative values.

Cheers

Federico Guerra


________________________________
Da: Federico Guerra <fedwar82@...<mailto:fedwar82@...>>
A: "ns-developers@...<mailto:ns-developers@...>" <ns-developers@...<mailto:ns-developers@...>>
Inviato: Mercoledì 18 Aprile 2012 8:51
Oggetto: Re: Re: [ns3] Vector and different coordinates system (Federico Guerra) (Nicola Baldo)


Hi Nicola,
long time no see! ;)
I will reply inline:

I think your discussion is a bit biased by the fact that you
already have one solution in mind (maybe you already implemented it?)
and that you are already deeply convinced that this is the best one ;-)


Actually no, I did not implement anything, I was just proposing some solutions that came up to my mind to solve the problem.
I'm opened to any suggestion and to implement whatever comes out of this discussion of course!

1) the coordinate system that you would like to have is (latitude in
degrees, longitude in degrees, depth below earth
surface). Is this correct?


correct, I would use altitude though, that is more general, and depth would be represented by negative values.

2) you need to have the same position represented both in the above
coordinate system, and in the traditional cartesian coordinates. In the
latter case, the origin of the cartesian system would be at the center
of the earth. Is this correct?


Correct about the cartesian coords system origin.
I don't actually need them to be represented also in cartesian coordinates.
I think that it would be better though: in that way we could be retrocompatible with all MobilityModel classes already developed.

3) the coordinate system of point 1) is needed by your propagation
model, which looks up in a geoposition database to find out the
propagation conditions for the given TX/RX positions. Is this correct?


Correct.

4) the coordinate system of point 1) is also expected to be used by the
user writing the simulation program, to specify the position of the
nodes in the simulation. Is this correct?


Correct, all mobility models that places nodes in some box or in a vector list would be affected.



________________________________

Message: 2
Date: Tue, 17 Apr 2012 11:04:59 +0200
From: Nicola Baldo <nbaldo@...<mailto:nbaldo@...>>
Subject: Re: [Ns-developers] [ns3] Vector and different coordinates
    system (Federico Guerra)
To: ns-developers <ns-developers@...<mailto:ns-developers@...>>
Message-ID: <4F8D323B.3010702@...<mailto:4F8D323B.3010702@...>>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi
Federico,

first, let me say that I think that the support for geographical
coordinates would be a nice addition to ns-3, not only for your specific
use case (underwater propagation models) but also for other use cases,
such as terrain-based radio propagation models (often used e.g. for
frequency planning in cellular networks).

That said, I think your discussion is a bit biased by the fact that you
already have one solution in mind (maybe you already implemented it?)
and that you are already deeply convinced that this is the best one ;-)
My suggestion is to discuss more the use case and the requirements,
before diving into the details of your proposed implementation, and also
be open to discuss different implementations that can satisfy the same
requirements. I think that this is in line with what asked by Mathieu.

Now, about the use case and the requirements. I'll make you some
questions to
try to clarify them a bit:

1) the coordinate system that you would like to have is (latitude in
degrees, longitude in degrees, depth below earth surface). Is this correct?

2) you need to have the same position represented both in the above
coordinate system, and in the traditional cartesian coordinates. In the
latter case, the origin of the cartesian system would be at the center
of the earth. Is this correct?

3) the coordinate system of point 1) is needed by your propagation
model, which looks up in a geoposition database to find out the
propagation conditions for the given TX/RX positions. Is this correct?

4) the coordinate system of point 1) is also expected to be used by the
user writing the simulation program, to specify the position of the
nodes in the simulation. Is this correct?


Looking forward to having further discussion,

Nicola







On
04/16/2012 10:23 PM, Federico Guerra wrote:

> Hi Mathieu,
> I will reply inline:
>
> In this specific case, what would help is a rough outline of which code
> needs to consume these coordinates. Is it existing code in ns-3 ? Is it
> new code (woss ?) you are working on ? What does it need to do with it ?
> Calculate distances ? Other things ? What exactly ?
>
>
> Basicly WOSS is a framework that needs in input: tx coordinates, rx coordinates and stuff related to propagation (as central frequency).
> In output it will return the calculated power delay profile, that will be converted by my ns3 wrapper classes to a UanPdp (UAN model), for attenuation and delay computation purposes.
> How WOSS calculates this power delay profile is not relevant to this implementation since I'm including and linking against WOSS (I've already written a modified wscript): all I need to do is writing
wrapper classes to let UAN model use the WOSS library.
> Specifically I've already written a UanPropagation subclass that interacts with the WOSS library, all I need is the correct input data.
>
> What do you mean by "work with them" ?
>
>
> For the time being the best thing to have would be a MobilityModel that returns the current updated position in geographical coordinates (with some kind of GetPosition() function) . They will be converted into a WOSS class by my UAN-WOSS wrapper classes.
> For UAN users some common MobilityModels like consant velocity, waypoint etc should be reimplemented into UAN-WOSS model to make them use and return geographical coords.
> I'm well aware (since I did it in my library for WOSS and NS-Miracle) that these mobility models will require careful handling, since geographical
> coords needs special functions for distance, and other computations, but I plan to do it
myself via class inheritation of the base class MobilityModel and by using some of the WOSS functionalities.

> The main  issue IMHO is how to modify the base class MobilityModel to make it work with a geographical coordinates and possibly with a general coordinate system so to maximize code reusability.
>
> We were aware that there were other coordinate systems when we came up
> with the ns-3 MobilityModel class so, if you want to submit a proposal
> to change it, you really need to explain what your usecase is so that we
> can figure out how we can best support it.
>
>
> I think I replied to this in the question above.
>
>
>
> Thanks again for you help, don't hesitate to contact me in private if you think you need more details.
>
> Best Regards,
>
> Federico Guerra
>
>
> ________________________________
>  Da:
mathieu<mathieu@...<mailto:mathieu@...>>

> A: Federico Guerra<fedwar82@...<mailto:fedwar82@...>>
> Cc: "ns-developers@...<mailto:ns-developers@...>"<ns-developers@...<mailto:ns-developers@...>>
> Inviato: Luned? 16 Aprile 2012 21:24
> Oggetto: Re: [Ns-developers] [ns3] Vector and different coordinates system (Federico Guerra)
>
> On Sat, 2012-04-14 at 11:09 +0100, Federico Guerra wrote:
>
>> I need to work with geographical coordinates and with mobility models that works with them.
>> I need geographical coordinates because WOSS works only with them (I have data that belong to real geographical coordinates)
>
> I am sorry
but I really do not know much about woss or other stuff like

> that. If you really want to get useful feedback on your proposal, you
> need to give some actual background on what you are trying to achieve
> rather than how which you have indeed already explained with a lot of
> detail.
>
> In this specific case, what would help is a rough outline of which code
> needs to consume these coordinates. Is it existing code in ns-3 ? Is it
> new code (woss ?) you are working on ? What does it need to do with it ?
> Calculate distances ? Other things ? What exactly ?
>
>> I need to rewrite some of the existent models to work with them (for example constant velocity etc etc).
>
> What do you mean by "work with them" ?
>
>
>
>>
>> The straightforward solution to do this is to add to class Vector also latitude , longitude and altitude (or
depth).

>> Lat long and altitude can be easily converted to cartesian coordinates for retrocompatibility with all existent mobility models, the problem is that x, y, z, since they are public can be accessed without accessor functions, and if the user forget to manually update x,y,z with a private function then problems could arise.
>>
>> So I was trying to think a better general way to solve this problem, so that a user can add his own coordinates system and let it be accessible to the whole framework.
>
> We were aware that there were other coordinate systems when we came up
> with the ns-3 MobilityModel class so, if you want to submit a proposal
> to change it, you really need to explain what your usecase is so that we
> can figure out how we can best support it.
>
> Mathieu


------------------------------

Message: 3
Date: Tue, 17 Apr 2012 11:28:03 +0100
From:
Gustavo Carneiro <gjcarneiro@...<mailto:gjcarneiro@...>>
Subject: Re: [Ns-developers] Waf executed from nested directories
To: Tommaso Pecorella <tommaso.pecorella@...<mailto:tommaso.pecorella@...>>
Cc: ns_developers <ns-developers@...<mailto:ns-developers@...>>
Message-ID:
    <CAO-CpEL-maXuV7RqhG5pNmX9dLUQKXESR05yU70H5k0nCAs7+w@...<mailto:w@...>>
Content-Type: text/plain; charset=UTF-8

I pushed a fix for this to ns-3-dev.

Cheers.

On Mon, Apr 16, 2012 at 21:55, Tommaso Pecorella <tommaso.pecorella@...<mailto:tommaso.pecorella@...>
>
wrote:

> Hi Gustavo,
>
> I just found that in the examples/stats directory there is a shell script
> not working as intended.
>
> The reason is the invocation of waf from a nested directory, i.e.:
> ../../waf --run "wifi-example-sim --format=db --distance=$distance
> --run=run-$distance-$trial"
>
> Now, this "once upon a time" was working, but it isn't anymore (from 3.13
> or earlier).
>
> My dumb fix is to do a cd ../.. before the waf invocation, but I feel it's
> a bit a hack.
>
> Do you have a better fix or shall I go with the hack ?
>
> Cheers,
>
> Tommaso
>
>
> --------------------------------------------------------------
>
>
> The nice thing about standards is that there are so many to choose from.
> And if you really don't like all the standards you just have to wait
> another
year until the one arises you are looking for.

>
> -- A. Tanenbaum, "Introduction to Computer Networks"
>
>
> --------------------------------------------------------------
>
>
> Tommaso Pecorella - Ph.D.
>
>
> Assistant professor
>
> Dpt. Elettronica e Telecomunicazioni
>
> Universit? di Firenze
>
>
> CNIT - Universit? di Firenze Unit
>
>
> via di S. Marta 3
>
> 50139, Firenze
>
> ITALY
>
>
> email: tommaso.pecorella@...<mailto:tommaso.pecorella@...>
>
>        tommaso.pecorella@...<mailto:tommaso.pecorella@...>
>
>
> phone : +39-055-4796412
> mobile: +39-320-4379803
> fax  :
+39-055-494569
>
>
>
>
>
>


--
Gustavo J. A. M. Carneiro
INESC Porto, UTM, WiN, http://win.inescporto.pt/gjc
"The universe is always one step beyond logic." -- Frank Herbert


------------------------------

Message: 4
Date: Tue, 17 Apr 2012 23:07:12 +0200
From: Tommaso Pecorella <tpecorella@...<mailto:tpecorella@...>>
Subject: Re: [Ns-developers] Waf executed from nested directories
To: Gustavo Carneiro <gjcarneiro@...<mailto:gjcarneiro@...>>
Cc: ns_developers <ns-developers@...<mailto:ns-developers@...>>
Message-ID: <AD1C5406-5A7F-4E68-AE5F-E38368ED1C6F@...<mailto:AD1C5406-5A7F-4E68-AE5F-E38368ED1C6F@...>>
Content-Type: text/plain; charset=iso-8859-1

Thanks, quick and effective !

T.


On 17 Apr 2012, at 12:28, Gustavo Carneiro wrote:

> I pushed a fix for this to ns-3-dev.
>
> Cheers.
>
> On Mon, Apr 16, 2012 at 21:55, Tommaso Pecorella <tommaso.pecorella@...<mailto:tommaso.pecorella@...>
>> wrote:
>
>> Hi Gustavo,
>>
>> I just found that in the examples/stats directory there is a shell script
>> not working as intended.
>>
>> The reason is the invocation of waf from a nested directory, i.e.:
>> ../../waf --run "wifi-example-sim --format=db --distance=$distance
>> --run=run-$distance-$trial"
>>
>> Now, this
"once upon a time" was working, but it isn't anymore (from 3.13

>> or earlier).
>>
>> My dumb fix is to do a cd ../.. before the waf invocation, but I feel it's
>> a bit a hack.
>>
>> Do you have a better fix or shall I go with the hack ?
>>
>> Cheers,
>>
>> Tommaso
>>
>>
>> --------------------------------------------------------------
>>
>>
>> The nice thing about standards is that there are so many to choose from.
>> And if you really don't like all the standards you just have to wait
>> another year until the one arises you are looking for.
>>
>> -- A. Tanenbaum, "Introduction to Computer Networks"
>>
>>
>> --------------------------------------------------------------
>>
>>
>> Tommaso Pecorella -
Ph.D.

>>
>>
>> Assistant professor
>>
>> Dpt. Elettronica e Telecomunicazioni
>>
>> Universit? di Firenze
>>
>>
>> CNIT - Universit? di Firenze Unit
>>
>>
>> via di S. Marta 3
>>
>> 50139, Firenze
>>
>> ITALY
>>
>>
>> email: tommaso.pecorella@...<mailto:tommaso.pecorella@...>
>>
>>      tommaso.pecorella@...<mailto:tommaso.pecorella@...>
>>
>>
>> phone : +39-055-4796412
>> mobile: +39-320-4379803
>> fax  : +39-055-494569
>>
>>
>>
>>
>>
>>
>
>
> --
> Gustavo J. A.
M. Carneiro
> INESC Porto, UTM, WiN, http://win.inescporto.pt/gjc
> "The universe is always one step beyond logic." -- Frank Herbert

--------------------------------------------------------------

$25: for you a pizza and some beers with friends, for someone
    might change their lives. Think about it.

Kiva.org - Loans That Change Lives

--------------------------------------------------------------

Tommaso Pecorella - Ph.D.

Assistant professor
Dpt. Elettronica e Telecomunicazioni
Universit? di Firenze

CNIT - Universit? di Firenze Unit

via di S. Marta 3
50139, Firenze
ITALY

email: tommaso.pecorella@...<mailto:tommaso.pecorella@...>
      tommaso.pecorella@...<mailto:tommaso.pecorella@...>

phone : +39-055-4796412
mobile: +39-320-4379803
fax  : +39-055-494569








------------------------------

_______________________________________________
Ns-developers mailing list
Ns-developers@...<mailto:Ns-developers@...>
http://mailman.isi.edu/mailman/listinfo/ns-developers


End of Ns-developers Digest, Vol 65, Issue 23
*********************************************

 « Return to Thread: Re: [ns3] Vector and different coordinates system (Federico Guerra) (Nicola Baldo)