open-rmf / free_fleet

A free fleet management system.
Apache License 2.0
163 stars 69 forks source link

Client library #1

Closed aaronchongth closed 4 years ago

aaronchongth commented 4 years ago
aaronchongth commented 4 years ago

Just a note, I learnt about the discovery feature on both DDS writer and reader, which some of their examples employ, however I found that it was impossible for the reader to pick up anything, unless the writer uses something like the below code block, which uses dds_set_status_mask even though the reader was not using it :thinking:

  rc = dds_set_status_mask(writer, DDS_PUBLICATION_MATCHED_STATUS);
  if (rc != DDS_RETCODE_OK)
    DDS_FATAL("dds_set_status_mask: %s\n", dds_strretcode(-rc));

  while(!(status & DDS_PUBLICATION_MATCHED_STATUS))
  {
    rc = dds_get_status_changes (writer, &status);
    if (rc != DDS_RETCODE_OK)
      DDS_FATAL("dds_get_status_changes: %s\n", dds_strretcode(-rc));

    /* Polling sleep. */
    dds_sleepfor (DDS_MSECS (20));
  }