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.

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "../build/dora-node-api.h"
  2. #include <iostream>
  3. #include <vector>
  4. int main()
  5. {
  6. std::cout << "HELLO FROM C++" << std::endl;
  7. unsigned char counter = 0;
  8. auto dora_node = init_dora_node();
  9. for (int i = 0; i < 20; i++)
  10. {
  11. auto input = next_input(dora_node.inputs);
  12. if (input.end_of_input)
  13. {
  14. break;
  15. }
  16. counter += 1;
  17. std::cout << "Received input " << std::string(input.id) << " (counter: " << (unsigned int)counter << ")" << std::endl;
  18. std::vector<unsigned char> out_vec{counter};
  19. rust::Slice<const uint8_t> out_slice{out_vec.data(), out_vec.size()};
  20. auto result = send_output(dora_node.send_output, "counter", out_slice);
  21. auto error = std::string(result.error);
  22. if (!error.empty())
  23. {
  24. std::cerr << "Error: " << error << std::endl;
  25. return -1;
  26. }
  27. }
  28. return 0;
  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