Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
msgIntersect Namespace Reference

Functions

def send (msg, ip_send, port_send)
 
def listen (ip_listen, port_listen)
 
def main ()
 

Function Documentation

◆ listen()

def msgIntersect.listen (   ip_listen,
  port_listen 
)

Definition at line 23 of file msgIntersect.py.

23def listen(ip_listen, port_listen):
24 listen_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
25 listen_socket.bind((ip_listen, port_listen))
26
27 return listen_socket
28
29
def listen(ip_listen, port_listen)
Definition: msgIntersect.py:23

Referenced by main().

Here is the caller graph for this function:

◆ main()

def msgIntersect.main ( )

Definition at line 30 of file msgIntersect.py.

30def main():
31 # declarations
32 print('Starting intersect.')
33 ip_listen = '127.0.0.1'
34 ip_send = '192.168.0.146'
35 port_listen = 1516 # listen to Immediate Forward Plugin
36 port_send = 5398 # send to CARMA listening_port
37
38 sk_listen = listen(ip_listen, port_listen)
39
40 print("Waiting to receive data\n")
41 while(1):
42 data = sk_listen.recvfrom(10000)[0]
43 data = data.decode('ascii')
44 # print(data)
45
46 idx = data.find("Payload=")
47 payload = data[idx+8:-1]
48 encoded = payload.encode('utf-8')
49 msgBytes = unhexlify(encoded)
50
51 # send
52 send(msgBytes, ip_send, port_send)
53 sleep(0.1)
54
def send(msg, ip_send, port_send)
Definition: msgIntersect.py:17

References listen(), main(), and send().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send()

def msgIntersect.send (   msg,
  ip_send,
  port_send 
)

Definition at line 17 of file msgIntersect.py.

17def send(msg, ip_send, port_send):
18 sk_send = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
19 sk_send.sendto(msg, (ip_send, port_send))
20 # print("Sent: ", msg)
21 sk_send.close()
22

Referenced by main().

Here is the caller graph for this function: