by 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.