Skip to content
Snippets Groups Projects
Commit 8a6a2c80 authored by Paul-Winpenny's avatar Paul-Winpenny
Browse files

Explicit cast to float

parent bbeb20ef
No related branches found
No related tags found
No related merge requests found
......@@ -50,14 +50,21 @@ class MessageHandler:
"S": (-0.5, 0), # Move backward
"D": (0, -0.5) # Turn right
}
response_data = directions.get(message.strip().upper(), (0, 0))
# Get direction data and ensure it's a tuple of floats
raw_response_data = directions.get(message.strip().upper(), (0, 0))
response_data = (float(raw_response_data[0]), float(raw_response_data[1])) # Explicitly cast to float
# Send feedback to the client
response = f"Manual control command received: {response_data}".encode()
if self.testing:
print(response.decode())
else:
client_socket.sendall(response)
print("Processed manual control command:", response_data)
return "cmd_vel", response_data
def handle_unknown_message(self, client_socket, _):
"""Handles unknown commands."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment