advertise method

Future<void> advertise()

Advertise the topic.

Implementation

Future<void> advertise() async {
  if (!isAdvertised) {
    // Send the advertisement request.
    advertiseId = ros.requestAdvertiser(name);
    await safeSend(Request(
      op: 'advertise',
      id: advertiseId,
      type: type,
      topic: name,
      latch: latch,
      queueSize: queueSize,
    ));
    // If the ROS connection closes show that we're not advertising anymore.
    watchForClose();
  }
}