Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused UDP data isn't discarded unless multi-threading is specifically enabled #8

Closed
jake-levy opened this issue Jan 4, 2023 · 0 comments · Fixed by #11
Closed
Assignees
Labels
bug Something isn't working

Comments

@jake-levy
Copy link
Member

jake-levy commented Jan 4, 2023

If Julia is started with only one thread, or if other threads aren't spawned for solvers, then UDP data becomes old if the UDP data rate is faster than the solve rate. This is not robust behavior. Recommend switching to a TCP connection where a server runs on ROS and a request for data is sent from the client (Julia).

task = errormonitor(Threads.@spawn feedback_connection_task(socket,
data_channel, ready_channel))

# This task continuously reads from the UDP port in order to keep the buffer
# clear. That way, when receive_feedback_data is called, stale data will not be
# returned.
function feedback_connection_task(socket, data_channel, ready_channel)
while true
payload = nothing
try
payload = recv(socket)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant