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 22 of file msgIntersect.py.

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

Referenced by main().

Here is the caller graph for this function:

◆ main()

def msgIntersect.main ( )

Definition at line 29 of file msgIntersect.py.

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

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 16 of file msgIntersect.py.

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

Referenced by main().

Here is the caller graph for this function: