flightgear使用UDP通信用作直升机视景的问题
flightgear使用UDP通信用作直升机飞行视景时,直升机的姿态等信息都能通过UDP传输并在视景中显示,但是直升机的主旋翼和尾桨都不转,是什么原因呢?希望有经验的朋友指点一下旋翼的属性没有设置对 349516385 发表于 2013-6-5 15:31 static/image/common/back.gif
旋翼的属性没有设置对
class FGNetData
{
public:
FGNetData(void);
~FGNetData(void);
private:
void htond (double &x);
void htonf (float &x);
public:
void ConverData();
public:
public:
enum {
FG_MAX_ENGINES = 4,
FG_MAX_WHEELS = 3,
FG_MAX_TANKS = 4
};
uint32_t version; // increment when data values change
uint32_t padding; // padding
// Positions
double longitude; // geodetic (radians)
double latitude; // geodetic (radians)
double altitude; // above sea level (meters)
float agl; // above ground level (meters)
float phi; // roll (radians)
float theta; // pitch (radians)
float psi; // yaw or true heading (radians)
float alpha; // angle of attack (radians)
float beta; // side slip angle (radians)
// Velocities
float phidot; // roll rate (radians/sec)
float thetadot; // pitch rate (radians/sec)
float psidot; // yaw rate (radians/sec)
float vcas; // calibrated airspeed
float climb_rate; // feet per second
float v_north; // north velocity in local/body frame, fps
float v_east; // east velocity in local/body frame, fps
float v_down; // down/vertical velocity in local/body frame, fps
float v_wind_body_north; // north velocity in local/body frame
// relative to local airmass, fps
float v_wind_body_east; // east velocity in local/body frame
// relative to local airmass, fps
float v_wind_body_down; // down/vertical velocity in local/body
// frame relative to local airmass, fps
// Accelerations
float A_X_pilot; // X accel in body frame ft/sec^2
float A_Y_pilot; // Y accel in body frame ft/sec^2
float A_Z_pilot; // Z accel in body frame ft/sec^2
// Stall
float stall_warning; // 0.0 - 1.0 indicating the amount of stall
float slip_deg; // slip ball deflection
// Pressure
// Engine status
uint32_t num_engines; // Number of valid engines
uint32_t eng_state;// Engine state (off, cranking, running)
float rpm; // Engine RPM rev/min
float fuel_flow; // Fuel flow gallons/hr
float fuel_px; // Fuel pressure psi
float egt; // Exhuast gas temp deg F
float cht; // Cylinder head temp deg F
float mp_osi; // Manifold pressure
float tit; // Turbine Inlet Temperature
float oil_temp;// Oil temp deg F
float oil_px; // Oil pressure psi
// Consumables
uint32_t num_tanks; // Max number of fuel tanks
float fuel_quantity;
// Gear status
uint32_t num_wheels;
uint32_t wow;
float gear_pos;
float gear_steer;
float gear_compression;
// Environment
uint32_t cur_time; // current unix time
// FIXME: make this uint64_t before 2038
int32_t warp; // offset in seconds to unix time
float visibility; // visibility in meters (for env. effects)
// Control surface positions (normalized values)
float elevator;
float elevator_trim_tab;
float left_flap;
float right_flap;
float left_aileron;
float right_aileron;
float rudder;
float nose_wheel;
float speedbrake;
float spoilers;
};
这个是视景驱动程序,哪个量是旋翼的属性? 顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶 同问,一样好奇,这些参数没有说明呀?看不懂 fg 通信并不止这一种数据结构
你要做这件事情的步骤是这个样子的
1、找到fg属性树中 你需要设置的属性的位置
2、自定义协议
3、自己写程序,定义数据结构,发送或接受数据即可
范例:
1、http://wiki.flightgear.org/Howto:Create_a_generic_protocol
2、你帖子中展示的程序源码 额外说一句
属性树里面的属性需要你自己一点一点总结并发现他的作用
因为除了源代码中涉及到的固定的属性节点以外
所有的属性节点都是可以自定义并可以赋予其不同意义的
并且并未有出现过相关说明属性节点作用的资料
Breaking_Dawn 发表于 2013-11-4 21:30 static/image/common/back.gif
fg 通信并不止这一种数据结构
你要做这件事情的步骤是这个样子的
1、找到fg属性树中 你需要设置的属性的 ...
按照链接地址把自定义协议的文件写完也放在了Property文件夹中,但如何去使用呢? 哪位大神有相关的教材?? 再顶一个:):(,这方面的资料很少啊
页:
[1]
2