Board index FlightGear Development Aircraft

know the coordinates of the submodel when it was released

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

know the coordinates of the submodel when it was released

Postby abassign » Mon Mar 19, 2018 6:27 pm

My question is whether it is possible to know the coordinates of the submodel when it was released. This in order to be able to construct a "subjective" view. It seems to me a very nice function to see our plane in a very different way. I also need this function to manage the effect of the ejection seat.

Thanks for your help
abassign
 
Posts: 772
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: know the coordinates of the submodel when it was release

Postby wlbragg » Tue Mar 20, 2018 12:56 am

I haven't actually looked at the property tree to see if its position is exposed. But if not, couldn't you extrapolate it's position from the position of the aircraft it is attached to at the moment in time it is released?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4685
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: know the coordinates of the submodel when it was release

Postby Thorsten » Tue Mar 20, 2018 7:06 am

I suspect he wants to follow it /after/ it has been released... Kind of a missile-view. I frankly have no idea whether it's possible.
Thorsten
 
Posts: 10639
Joined: Mon Nov 02, 2009 8:33 am

Re: know the coordinates of the submodel when it was release

Postby abassign » Tue Mar 20, 2018 8:42 am

Thorsten wrote in Tue Mar 20, 2018 7:06 am:I suspect he wants to follow it /after/ it has been released... Kind of a missile-view. I frankly have no idea whether it's possible.


Exactly my desire is precisely that of being able to make subjective ones.
For this we need the position in space and the velocity vector that are present in AIBalistic.cxx which is called by submodel.cxx (All the files are present in AIModel)

Reading the AIBalistic code (... fgfs/build/flightgear/src/AIModel) I noticed that this only inserts some information in the property-tree:

List of ballistic objects that have been activated by submodel:
Image
The reported data that are only a part of those present in AIBalistic. Unfortunately, these data do not report the position in the space of the object and its velocity vector, these are all essential data for the construction of a subjective video recording. I think it would not be a problem to add such data in property-tree. This addition could be optional for speed optimization.
Image

Observing the code of the AIBalistic.cxx module, note that in order to obtain the position coordinates and the velocity vector, a switch must be activated in the "submodels.xml" file:

Code: Select all
 
<submodel>
       <external-force>true</external-force>
</submodel>


This switch enables the ability to display more information for that object. Normally the <external-force> switch is used to allow the object to be guided by a NASAL code (missiles or smart bombs), but in our case the switch will be useful to get the point of view from the object itself.

The image shows what the system responds when the wing tanks have not been released:

Image

The property-tree /ai/models it does not display anything, but as soon as you release the wing tanks (I have dropped 3 in this example), the ballistic objects appear:

Image

As you can see the first part is what you saw even without having activated the option, but now there are new nodes that bring other information:
orientation and position

Image

This is the orientation node:

Image

This is the position node:

Image

With this information it is possible to construct a visualization system that has the object itself as a point of view.
Last edited by abassign on Thu Apr 19, 2018 4:30 pm, edited 1 time in total.
abassign
 
Posts: 772
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: know the coordinates of the submodel when it was release

Postby abassign » Tue Mar 20, 2018 11:10 pm

Image

Test of release of the wing tank with tracking system written in NASAL language. There is still much to do, but finally you can see a ballistic object of FGFS what it really does.
This is the youtube movie test:

https://youtu.be/lKEQKIWgHeo
Last edited by abassign on Thu Apr 19, 2018 4:30 pm, edited 1 time in total.
abassign
 
Posts: 772
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: know the coordinates of the submodel when it was release

Postby wlbragg » Tue Mar 20, 2018 11:26 pm

That will come in quite handy for the camera view on a missile or a potentially a remote controlled drone.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4685
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: know the coordinates of the submodel when it was release

Postby abassign » Wed Mar 21, 2018 7:36 am

wlbragg wrote in Tue Mar 20, 2018 11:26 pm:That will come in quite handy for the camera view on a missile or a potentially a remote controlled drone.


Hello
I do not know if you've ever analyzed submodels.cxx and AIBalistic.cxx as they are very interesting functions that have many parameters to work. As you have noticed from the movie the effect of being able to see an object released from a plane in subjective is interesting and allows many things especially for military aircraft.
But there are many problems that those who programmed these functions did not conceive:

1.There is no ID to assign to the submodel when it is released, this does not allow easy identification of the generated submodel, especially if you make missile launches or projectiles.
2. It would be useful to have a direct assignment of the submodel position to a view or to assign to the submodel, when released, a view or better a canvas (simulation launch of smart bombs)
3. It would be interesting to see the submodel even when it is "loaded" on the plane, ie the coordinates of the submodel normally follow the plane and only when the control is launched passes to the ballistic. In this way the double definition that currently complicates the work is avoided.
4. It does not always work ... :( or I can not always generate the submodel ... this is very strange and I would like to know if anyone has had the same problems.

If you have any advice or idea or you want to give me a hand I would be very pleased as I think it is necessary to change the code of ../src/AIModel/submodel.cxx e ../src/AIModel/AIBalistic.cxx

Ciao :)
abassign
 
Posts: 772
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: know the coordinates of the submodel when it was release

Postby Thorsten » Wed Mar 21, 2018 7:46 am

I can not always generate the submodel ... this is very strange and I would like to know if anyone has had the same problems.


Generally the submodel code has its quirks (and is awkward in terms of coordinates for assigning external forces and limited in what it can do in terms of dynamics of secondary objects) - I've noticed things like submodels not appearing when loaded or flickering before relased,...

All of this has driven me to more and more use Nasal-controlled child models with custom dynamics rather than submodels for things like discarded rocket stages (for which the coordinate info is trivially recovered).
Thorsten
 
Posts: 10639
Joined: Mon Nov 02, 2009 8:33 am

Re: know the coordinates of the submodel when it was release

Postby RenanMsV » Thu Apr 19, 2018 3:03 am

abassign wrote in Wed Mar 21, 2018 7:36 am:4. It does not always work ... :( or I can not always generate the submodel ... this is very strange and I would like to know if anyone has had the same problems.


True. I have the same problem.
www.flightgearbrasil.com.br
www.fgbrazukas.wixsite.com/fgbrazukas
RenanMsV
 
Posts: 134
Joined: Thu Oct 27, 2016 2:02 am
Callsign: BR-RVD

Re: know the coordinates of the submodel when it was release

Postby wlbragg » Thu Apr 19, 2018 3:12 am

All of this has driven me to more and more use Nasal-controlled child models with custom dynamics rather than submodels


Same here. I've noticed a particular bug of submodes loading and unloading only every other time (in weapons load-out code in particular). Although I also noticed when used submodels in the most generic ways they seem to perform adequately.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4685
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640


Return to Aircraft

Who is online

Users browsing this forum: YandexBot [Bot] and 2 guests