From 0f6341352bdb47eae90195f3ba15f00c17e1d62a Mon Sep 17 00:00:00 2001 From: Richard Harrison <rjh@zaretto.com> Date: Mon, 18 Oct 2021 18:11:11 +0200 Subject: [PATCH] Added gear position in meters to yasim and jsbsim --- src/FDM/JSBSim/JSBSim.cxx | 6 ++++++ src/FDM/YASim/YASim.cxx | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/FDM/JSBSim/JSBSim.cxx b/src/FDM/JSBSim/JSBSim.cxx index 359be4d18..405388cc3 100644 --- a/src/FDM/JSBSim/JSBSim.cxx +++ b/src/FDM/JSBSim/JSBSim.cxx @@ -1247,9 +1247,15 @@ void FGJSBsim::init_gear(void ) for (int i=0;i<Ngear;i++) { FGLGear *gear = gr->GetGearUnit(i); SGPropertyNode * node = fgGetNode("gear/gear", i, true); + // coordinates are in feet so convert node->setDoubleValue("xoffset-in", gear->GetBodyLocation()(1) * 12); node->setDoubleValue("yoffset-in", gear->GetBodyLocation()(2) * 12); node->setDoubleValue("zoffset-in", gear->GetBodyLocation()(3) * 12); + + node->setDoubleValue("xoffset-m", gear->GetBodyLocation()(1) * 0.08333333); + node->setDoubleValue("yoffset-m", gear->GetBodyLocation()(2) * 0.08333333); + node->setDoubleValue("zoffset-m", gear->GetBodyLocation()(3) * 0.08333333); + node->setBoolValue("wow", gear->GetWOW()); node->setDoubleValue("rollspeed-ms", gear->GetWheelRollVel()*0.3043); node->setBoolValue("has-brake", gear->GetBrakeGroup() > 0); diff --git a/src/FDM/YASim/YASim.cxx b/src/FDM/YASim/YASim.cxx index bf8f54169..6ed51a60c 100644 --- a/src/FDM/YASim/YASim.cxx +++ b/src/FDM/YASim/YASim.cxx @@ -204,6 +204,10 @@ void YASim::init() node->setDoubleValue("yoffset-in", pos[1] * M2FT * 12); node->setDoubleValue("zoffset-in", pos[2] * M2FT * 12); + node->setDoubleValue("xoffset-m", pos[0]); + node->setDoubleValue("yoffset-m", pos[1]); + node->setDoubleValue("zoffset-m", pos[2]); + _gearProps.push_back(GearProps(node)); }