[Opengc-devel] Re: [Opengc-announce] like to use instruments for my own simulation - where do i star
Status: Pre-Alpha
Brought to you by:
madmartigan
From: Damion S. <be...@cs...> - 2003-08-15 20:54:12
|
Hi, > My question to you developer guys is which components do I need from > the source code to simply draw a glass cockpit, that is driven with my > simulation data ? This depends on whether you want to have the rendering occur within your code or in a separate program. Either way will work, but the approach would be different: Common to either approach - classes derived from ogcDataSource are responsible for handling the acquisition of data from the simulator. You will need to write a data source that can interface with your computer vision code; exactly how this will be done depends on your system. I would strongly suggest using network communications (probably UDP format) as this will result in the most portable system - any computer that can hook up to your vision machine with an ethernet cable will be able to read data. Look at the X-Plane data source for an example of how UDP programming is done with the Plib library used by OpenGC. Within your code - you need to perform OpenGL window management in a way similar to that done in ogcRenderWindow. The gauges are, for the most part, coded in pure OpenGL and therefore don't actually care about the specifics of window management. Keep in mind that you will need to preserve the overall framework of OpenGC. For instance the AppObject class allows event messages to be passed between objects, so your code would need to replicate this behavior. Separate program - this is by the far the simplest approach. Write your data source in OpenGC to accept UDP network packets that are broadcast from you vision machine and translate them to the internal DataSource format. This is quite similar to how the existing data sources work. In this scheme, OpenGC can be run on any networked machine connected to the sim, or even on the sim machine itself with the network configured in "loopback" mode. To summarize: I suggest keeping OpenGC as a separate program, adding UDP broadcast to your vision system, and writing a new data source (using X-Plane as an example). Keep in mind that the X-Plane data source is an example only; it does some slightly strange variable casting to deal with the floating point format so don't follow it exactly! If you have any more questions feel free to ask (though I'd suggest using the devel instead of announce list). Cheers, -Damion- --------- Damion Shelton The Open Source Glass Cockpit Project (OpenGC) Carnegie Mellon University, Robotics Institute http://www.opengc.org da...@op... |