Encoder based pose movement.

This commit is contained in:
Danny Staple
2022-12-23 21:28:58 +00:00
parent 411baece11
commit 584e189cd1
15 changed files with 4424 additions and 8 deletions
+8 -5
View File
@@ -19,6 +19,12 @@ def read_json():
return None
def send_poses(samples):
send_json({
"poses": np.array(samples[:,:2], dtype=np.int16).tolist(),
})
class Simulation:
def __init__(self):
self.population_size = 20
@@ -27,13 +33,10 @@ class Simulation:
int(random.uniform(0, arena.width)),
int(random.uniform(0, arena.height)),
int(random.uniform(0, 360))) for _ in range(self.population_size)],
dtype=np.int16,
dtype=np.float,
)
def send_poses(samples):
send_json({
"poses": samples[:,:2].tolist(),
})
async def command_handler(simulation):
print("Starting handler")