Skip to content

Conversation

@colton-smith
Copy link
Contributor

@colton-smith colton-smith commented Apr 4, 2021

Brief

WIP - Porting the PDS from competition 4.

Completed So far:

  • Example UDP server/client
  • Added uni-directional UDPListener class, a port of the PodUdpConnection class

Need to add:

  • Class representing a TCP connection
  • Socketio telemetry manager
  • Socketio command manager

@Burke-Daniel
Copy link
Collaborator

@colton-smith is this ready for review yet or still WIP?

@colton-smith
Copy link
Contributor Author

@Burke-Daniel
Might as well review just the UDP part, I like keeping PRs small anyways, I have updated asana with the other tasks that PDS requires, will put up prs for each part.

Copy link
Contributor Author

@colton-smith colton-smith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of things I need to fix here stylewise

class BoringPacket():
""" Create and pack The Boring Struct
"""
raise NotImplementedError No newline at end of file
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new newline EOF

sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))
print("Message sent...\n")
time.sleep(1/SEND_FREQUENCY)

No newline at end of file
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats going on here

timeout: timedelta - how long to poll for data on the socket before timing out
"""

def __init__(self, ip : str, port : int, max_buffer : int, timeout : timedelta):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this typehinting style??

Copy link
Collaborator

@Burke-Daniel Burke-Daniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple little style things we discussed on call but after that GTM!

Comment on lines +75 to +81
def __str__(self):
ret_str = f"""UDP Connection:
\nIp: {self.ip}
\nPort: {self.port}
\nBuffer Size: {self.max_buffer_size}
"""
return ret_str
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very nice

con = UDPListener(VEHICLE_IP, VEHICLE_UDP_PORT, 1024, timedelta(seconds=2))
con.connect()

counter = 5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to be getting used anywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants