Google 云机器人通信

Google Cloud Robotics communication

我目前正在从事一个关于机器人技术的项目,我们正在与 Google Cloud Robotics Core 合作,我了解到与机器人 (ROS 2) 通信的最佳方式是使用声明式 API.

我已阅读教程,但我想了解更多信息。 我向机器人发送订单的方式究竟如何?

"Create a custom resource definition (CRD) to represent orders. Send orders from the cloud by creating a custom resource. Create a controller on the robot, which looks at the orders and executes them"

如果我需要发送像 "init"、"stop"、"update your code"?

这样的订单,它会起作用

感谢您的帮助!

"update your code" 就是一个很好的例子。也许 "init" 是不必要的,因为机器人可以在寻找订单之前在启动时自动初始化自己。同样,您可以取消或删除任何现有订单,而不是创建 "stop" 订单,机器人将在没有活动订单时停止。

API 的详细信息在很大程度上取决于您的用例。理想情况下,订单将是独立的,这样接收订单的机器人即使中途失去网络连接也可以执行订单。例如,我尝试改编 tutorial 中的示例以反映您的建议:

apiVersion: example.com/v1
kind: Order
metadata:
  name: my-move-order
spec:
  moveItem:
    from: manufacturing
    to: logistics
    destinationAfterMove: waitingArea

apiVersion: example.com/v1
kind: Order
metadata:
  name: my-update-order
spec:
  installUpdate:
    url: https://myproject.com/updates/2020-03-10.tar.gz

真实世界的例子,你可以看看ewm-cloud-robotics项目:

我觉得我应该给出一个警告:如果你有良好的网络连接,声明性的 API 可能有点矫枉过正,在这种情况下你可能更愿意使用 VPN 和 ROS2 actionlib。此外,如果您认为您的 API 对于 metacontroller 来说太复杂,并且您想使用 Python 或 Go 以外的编程语言,那么您应该考虑将您的订单存储在数据库中,例如 Redis 或 MySQL,而不是使用 Kubernetes apiserver(我最后检查了一下,除了 Python 或 Go 之外,没有很好的客户端支持语言)。