You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

control_node.py 852 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import random
  4. from dora import Node
  5. import pyarrow as pa
  6. node = Node()
  7. for i in range(500):
  8. event = node.next()
  9. if event is None:
  10. break
  11. if event["type"] == "INPUT":
  12. match event["id"]:
  13. case "turtle_pose":
  14. print(
  15. f"""Pose: {event["value"].tolist()}""".replace("\r", "").replace(
  16. "\n", " "
  17. )
  18. )
  19. case "tick":
  20. direction = {
  21. "linear": {
  22. "x": 1.0 + random.random(),
  23. },
  24. "angular": {"z": (random.random() - 0.5) * 5},
  25. }
  26. node.send_output(
  27. "direction",
  28. pa.array([direction]),
  29. )

DORA (Dataflow-Oriented Robotic Architecture) is middleware designed to streamline and simplify the creation of AI-based robotic applications. It offers low latency, composable, and distributed datafl