Class Writer

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< Writer >

Class Documentation

class rmf_traffic_ros2::blockade::Writer : public std::enable_shared_from_this<Writer>

The Writer class provides an API that allows a Node to create blockade Participants.

Public Types

using ReservedRange = rmf_traffic::blockade::ReservedRange
using ReservationId = rmf_traffic::blockade::ReservationId
using NewRangeCallback = std::function<void(const ReservationId reservation, const ReservedRange &range)>

Public Functions

rmf_traffic::blockade::Participant make_participant(rmf_traffic::blockade::ParticipantId id, double radius, NewRangeCallback new_range_cb)

Make a blockade participant.

Return

the API for updating the blockade Participant.

Parameters
  • [in] id: The ID of the participant that is being created. This must match the schedule ParticipantId. All blockade participants must also be schedule participants to comply with the RMF traffic protocol.

  • [in] radius: The radius around the path that the participant will occupy.

  • [in] new_range_cb: This callback will get triggered when a new range arrives.

Public Static Functions

static std::shared_ptr<Writer> make(rclcpp::Node &node)

Create an instance of a writer. The writer and all Participants it creates depend on the life of the rclcpp::Node. It’s best to keep all of these as members of the Node.

Parameters
  • [in] node: The node that will manage the subscriptions of this writer.