The online racing simulator
#1 - Equer
OutSim - what is format of the data output?
I'm using code from wiki:


import socket
import struct

# Create UDP socket.
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

# Bind to LFS.
sock.bind(('127.0.0.1', 30000))

while True:
# Receive data.
data = sock.recv(256)

if not data:
break # Lost connection

# Unpack the data.
outsim_pack = struct.unpack('I12f3i', data)
time = outsim_pack[0]
angvel = [outsim_pack[1], outsim_pack[2], outsim_pack[3]]
header = outsim_pack[4]
pitch = outsim_pack[5]
roll = outsim_pack[6]
accel = [outsim_pack[7], outsim_pack[8], outsim_pack[9]]
vel = [outsim_pack[10], outsim_pack[11], outsim_pack[12]]
pos = [outsim_pack[13], outsim_pack[14], outsim_pack[15]]

# Release the socket.
sock.close()

Is it written somewhere on wikipedia what is the format of the output data and the corresponding indexes for each piece of information?
For example:
- time - index 0,
.
.
.
- roll - index 6
etc.
I could not find anything.
#2 - Equer
I just found it in InSim.txt doc,

struct OutSimPack
{
unsigned Time; // time in milliseconds (to check order)

Vector AngVel; // 3 floats, angular velocity vector
float Heading; // anticlockwise from above (Z)
float Pitch; // anticlockwise from right (X)
float Roll; // anticlockwise from front (Y)
Vector Accel; // 3 floats X, Y, Z
Vector Vel; // 3 floats X, Y, Z
Vec Pos; // 3 ints X, Y, Z (1m = 65536)

int ID; // optional - only if OutSim ID is specified
};

But what is the velocity format? km/h or miles per hour?
What are formats for other data?
Hey man.

Okay so Vector type should be 3 floats and in this context its meters per second.

The Roll, Heading, Pitch components are expressed in degrees.

And the Pos component is a 3 component integer(not a decimal number) that is mate a decimal number by dividing the value with 65536

Havent played in InSim/OutGauge/OutSim in a while.

Also genuine advice.
Dont use Python because it does not have a good Insim/OutSim/OutGauge library.
Download Visual Studio IDE and set it up with C++/C#.
Program in either C++ or C# doesent matter.
Use CInsim for C++ applications.
And use InSimLib for C# applications.

For beginner proggramers I would suggest to start in C#. Has nice syntaxs and a lot of tools already built in.
See: LFS\docs\OutSimPack.txt for more advanced OutSimPack

FGED GREDG RDFGDR GSFDG