def add_obstacle(self, x, y):
msg = str(x)+" "+str(y)
# Request a cell update
print("[INFO] Sending cell update request")
self.socket.send(b"update")
# Get the reply.
errors = False
if (self.socket.recv() != "go"):
print("[ERROR] Socket could not process update request.")
errors = True
self.socket.send(b"")
else:
self.socket.send(msg)
if (self.socket.recv() != "ok"):
print("[ERROR] Socket was not able to update given cell.")
errors = True
else:
index = np.ravel_multi_index((x, y), self.imsize, order='C')
print("[INFO] Updating new obstacle")
self.grid[index] = 0
return errors
dstar.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录