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

1234567891011121314151617181920212223242526272829303132
  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. event = node.next()
  8. direction = {
  9. "linear": {
  10. "x": random.random() + 1,
  11. },
  12. "angular": {
  13. "z": (random.random() - 0.5) * 5,
  14. },
  15. }
  16. if event["type"] == "INPUT":
  17. print(
  18. f"""Node received:
  19. id: {event["id"]},
  20. value: {event["data"]},
  21. metadata: {event["metadata"]}"""
  22. )
  23. node.send_output(
  24. "direction",
  25. pa.array(
  26. [random.random() + 1, 0, 0, 0, 0, random.random() - 0.5],
  27. type=pa.uint8(),
  28. ),
  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