Review comments
- Indentation issues - Inconsistencies
This commit is contained in:
@@ -20,7 +20,7 @@ class RobotDisplay:
|
||||
self.closed = True
|
||||
|
||||
def handle_data(self, data):
|
||||
self.buffer += data.decode)
|
||||
self.buffer += data.decode()
|
||||
while "\n" in self.buffer:
|
||||
line, self.buffer = self.buffer.split("\n", 1)
|
||||
print(f"Received data: {line}")
|
||||
|
||||
@@ -49,12 +49,12 @@ def send_json(data):
|
||||
|
||||
def read_json():
|
||||
try:
|
||||
data = robot.uart.readline()
|
||||
decoded = data.decode()
|
||||
return json.loads(decoded)
|
||||
data = robot.uart.readline()
|
||||
decoded = data.decode()
|
||||
return json.loads(decoded)
|
||||
except (UnicodeError, ValueError):
|
||||
print("Invalid data")
|
||||
return None
|
||||
print("Invalid data")
|
||||
return None
|
||||
|
||||
|
||||
def send_poses(samples):
|
||||
|
||||
Reference in New Issue
Block a user