Closed JeevaPeriasamy closed 3 years ago
It is working perfectly!! for someone new to python
May be there are some easier ways or professional way, but this worked for me
thanks to @gmnvh @gokhanalcan @HemaZ for your work on this repository
@JeevaPeriasamy Sorry for the late reply !! I was on vacation last week. I am glad you got all working.
Could anyone explain how to install pycarmaker for a beginner :)
I have IPG\hil\win32-7.1.4. from carmaker I have to read few data(lat,long,Heave,Roll,Pitch and Yaw) and send it via udp; Code to send via UDP is available at the end
For capturing these data from carmaker I thought your script would be useful. But I could not access it. Could you please explain step by step things that needs to be done
----------- Beginning of script ---------------------
import socket
function to send udp data
def UdpBc( MESSAGE ): UDP_IP = "127.0.0.1" UDP_PORT = 5005
print("UDP target IP: %s" % UDP_IP) print("UDP target port: %s" % UDP_PORT) print("message: %s" % MESSAGE)
convert string to bytes since sock.sendto requires in byte
MESSAGE = str.encode(MESSAGE) sock = socket.socket(socket.AF_INET, # Internet socket.SOCK_DGRAM) # UDP sock.sendto(MESSAGE, (UDP_IP, UDP_PORT)) return;
send
UdpBc("S~;Long=3.0Lat=0.699Heave=0.0Roll=0.000RS;Pitch=0.001RS;Yaw=0.000RS;~E")
-----------End of Script--------------------