Board index FlightGear Development Scenery

FlightGear sends constant value of "hground"

Questions and discussion about enhancing and populating the FlightGear world.

FlightGear sends constant value of "hground"

Postby themfark » Fri Jan 07, 2022 2:59 pm

Hello,

I am currently using the FlightGear as image generator. I feed the FG by an external source with "net-fdm" packet, and get the "net-ctrls" packet from FlightGear to receive ground elevation which is needed for the model running.
When FlightGear starts, it sets the ground-elevation value to a constant, which is true for the initial point. However, the ground-elevation value is not updated by FlightGear and stays the same which causes simulation to not working properly.

ground-elevation value= net-ctrls --> hground

Any help would be appreciated.
themfark
 
Posts: 9
Joined: Fri Jan 07, 2022 9:26 am

Re: FlightGear sends constant value of "hground"

Postby wkitty42 » Fri Jan 07, 2022 4:08 pm

look at the very top of this page... above the logo image... see that link to the bug tracker? you should post an issue there for this... that way the devs will actually see it and can better track the problem... they may ask for more information and testing at some point so be aware of that, please...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: FlightGear sends constant value of "hground"

Postby wlbragg » Fri Jan 07, 2022 8:21 pm

More of your code example may help and a pointer to the documentation source your using? It may be your not calling the correct properties or updating you position calls? VS this being a bug?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: FlightGear sends constant value of "hground"

Postby themfark » Sat Jan 08, 2022 9:23 am

My full configuration;
FG computer: 192.168.1.11
Simulation computer: 192.168.1.10
FG is opened by launcher with the command line option;
--fdm=network,192.168.1.10,5501,5502,5503
In simulation computer I fill the "net-fdm" packet and send like this;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
FGNetFDM fdm;
memset(&fdm,0,sizeof(fdm));
fdm.version = htonl(FG_NET_FDM_VERSION);
fdm.latitude = htond(latitude * D2R);
fdm.longitude = htond(longitude * D2R);
fdm.altitude = htond(altitude);
fdm.phi = htonf(roll * D2R);
fdm.theta = htonf(pitch * D2R);
fdm.psi = htonf(yaw * D2R);
fdm.num_engines = htonl(1);
fdm.num_tanks = htonl(1);
fdm.fuel_quantity[0] = htonf(100.0);
fdm.num_wheels = htonl(3);
fdm.cur_time = htonl(time(0));
fdm.warp = htonl(1);
fdm.visibility = htonf(visibility);
sendto(sendSocket,(char *)&fdm,sizeof(fdm),0,(struct sockaddr *)&sendAddr,sizeof(sendAddr));
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
After that FG sends the "net_ctrls" packet, it is read like this;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
FGNetCtrls input_packet;
udp.receive(&input_packet, sizeof(input_packet));
hot = ntohd(input_packet.hground);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
When I checked "debug/browse inertial properties/position/" the "ground-elev" parameter is never updating, causing flying through a mountain not able to landing etc.
Only updated parameters are;
altitude-ft, latitude and longitude.
Also, I want to also remark that, when I fly with FGs own FDM all parameters all updated perfectly.
themfark
 
Posts: 9
Joined: Fri Jan 07, 2022 9:26 am


Return to Scenery

Who is online

Users browsing this forum: No registered users and 4 guests