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 592 B

123456789101112131415161718192021222324252627
  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. print(
  13. f"""Node received:
  14. id: {event["id"]},
  15. value: {event["value"]},
  16. metadata: {event["metadata"]}"""
  17. )
  18. node.send_output(
  19. "direction",
  20. pa.array(
  21. [random.random() + 1, 0, 0, 0, 0, (random.random() - 0.5) * 5],
  22. type=pa.float64(),
  23. ),
  24. )

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