# 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]]
print "udp received"
#print "time is ", time
#print "angvel is ", angvel
#print "header is ", header
#print "pitch is ", pitch
#print "roll is ", roll
#print accel
print "vel is ", vel
#print "pos is ", pos
# Release the socket.
sock.close()
It actually was so much better but now it just gives one "udp received":/
It used to give like 30, 40 or something...
And is there a way to tell the time between each time it prints or gets the packet?
Yeah I did thanks, but after some printing it gives an error: unpack requires a string argument of length 64 :/
It didn't happen before without printings so I don't know I have no idea why it gives it do you know ?
Ummm I know MATLAB and a bit of Vb,Vb.net and C. I think I know the basics of network communication.
So how can I get the values of the stored variables?
Is it possible to see them with wireshark?
I tried to track the packets with wireshark but I was not able to do it so I'm trying to find something (some video or whatever) about how to track UDP packets with wireshark or whatever to be able to do it.
Thanks this helped a lot but I don't know why even before moving none of the velocity vectors are literally zero they are all something like 0089384 and they are changing isn't that wrong?
Thanks for your answer My programming is so basic not so good at all, do you have any suggestions so that I can become something like you guys in future?
and I tried the codes I only can get the headings, RPM and vector things doesn't work because I think C# cannot writeline vectors so I don't know what to do about that.
I have two other questions anyways:
1) I've tried the outsim code for python which is written here : http://en.lfsmanual.net/wiki/OutSim_/_OutGauge
It seems that the code is running but no data will come to there (cfg.text is correct), do you know what is going on? It will be awesome if I can get all the values from the game.
2) I want to decode a UDP packet sent from a micro autobox in a car to send it to a motion simulator seat. Any suggestions about that??
It has nothing to do with these right???
Is it easy to do it with wireshark?
Sorry for all the questions it will be so good if you can answer them somehow...
Regards,
Parsa
Hey I want to simply be able to get the datas (ax,ay,az,vx,vy,vz and etc.) from LFS but I have no idea how to do it...
Can someone help me please?
where should I write a code and where should I get started to finally be able to write the code...
I've been struggling about 16 hours between these forums LFS programming manual INsim and Outsim but I wasn't able to connect to LFS nor with outsim nor with insim and I really want to do it...
where should I start what should I read/learn please help me please
Hey I want to simply be able to get the datas (ax,ay,az,vx,vy,vz and etc.) from LFS but I have no idea how to do it...
Can someone help me please?
where should I write a code and where should I get started to finally be able to write the code...
I've been struggling about 16 hours between these forums LFS programming manual INsim and Outsim but I wasn't able to connect to LFS nor with outsim nor with insim and I really want to do it...
where should I start what should I read/learn please help me please