rmf_traffic¶
A package for managing traffic in OpenRMF.
rmf_traffic API¶
File Hierarchy¶
-
- File bidirectional_iterator.hpp
- File CentralizedNegotiation.hpp
- File Change.hpp
- File Circle.hpp
- File ConvexShape.hpp
- File Database.hpp
- File debug_Negotiator.hpp
- File debug_Planner.hpp
- File DetectConflict.hpp
- File forward_iterator.hpp
- File Graph.hpp
- File Inconsistencies.hpp
- File Interpolate.hpp
- File Itinerary.hpp
- File LaneClosure.hpp
- File Mirror.hpp
- File Moderator.hpp
- File Motion.hpp
- File Negotiation.hpp
- File Negotiator.hpp
- File Participant.hpp
- File Participant.hpp
- File ParticipantDescription.hpp
- File Patch.hpp
- File Planner.hpp
- File Plumber.hpp
- File Profile.hpp
- File Query.hpp
- File Rectifier.hpp
- File Rectifier.hpp
- File Region.hpp
- File Rollout.hpp
- File Route.hpp
- File RouteValidator.hpp
- File Shape.hpp
- File SimpleNegotiator.hpp
- File Snapshot.hpp
- File Space.hpp
- File Status.hpp
- File StubbornNegotiator.hpp
- File Time.hpp
- File Trajectory.hpp
- File VehicleTraits.hpp
- File Version.hpp
- File Viewer.hpp
- File Writer.hpp
- File Writer.hpp
Full API¶
Namespaces¶
Namespace rmf_traffic::@19¶
Namespace rmf_traffic::geometry¶
Classes¶
Functions¶
Template Function rmf_traffic::geometry::make_final(Args&&…)
Template Function rmf_traffic::geometry::make_final(const T&)
Template Function rmf_traffic::geometry::make_final_convex(Args&&…)
Template Function rmf_traffic::geometry::make_final_convex(const T&)
Function rmf_traffic::geometry::operator!=(const Circle&, const Circle&)
Function rmf_traffic::geometry::operator!=(const Space&, const Space&)
Function rmf_traffic::geometry::operator==(const Circle&, const Circle&)
Function rmf_traffic::geometry::operator==(const Space&, const Space&)
Typedefs¶
Namespace rmf_traffic::internal¶
Classes and Structs¶
Struct Plan::Checkpoint¶
Defined in File Planner.hpp
Nested Relationships¶
This struct is a nested type of Class Plan.
Struct Documentation¶
-
struct
rmf_traffic::agv::Plan
::
Checkpoint
Struct Plan::Progress¶
Defined in File Planner.hpp
Nested Relationships¶
This struct is a nested type of Class Plan.
Struct Documentation¶
-
struct
rmf_traffic::agv::Plan
::
Progress
Struct Debug::Node¶
Defined in File debug_Planner.hpp
Nested Relationships¶
This struct is a nested type of Class Planner::Debug.
Struct Documentation¶
-
struct
rmf_traffic::agv::Planner::Debug
::
Node
A Node in the planning search. A final Planning solution will be a chain of these Nodes, aggregated into a Plan data structure.
Public Types
-
using
SearchQueue
= std::priority_queue<ConstNodePtr, std::vector<ConstNodePtr>, Compare>
-
using
Vector
= std::vector<ConstNodePtr>
Public Members
-
ConstNodePtr
parent
The parent of this Node. If this is a nullptr, then this was a starting node.
-
double
remaining_cost_estimate
An estimate of the remaining cost, based on the heuristic.
-
double
current_cost
The actual cost that has accumulated on the way to this Node.
-
rmf_utils::optional<std::size_t>
waypoint
The waypoint that this Node stops on.
-
double
orientation
The orientation that this Node ends with.
-
rmf_utils::optional<std::size_t>
start_set_index
If this is a starting node, then this will be the index.
-
std::size_t
id
A unique ID that sticks with this node for its entire lifetime. This will also (roughly) reflect the order of node creation.
-
struct
Compare
Public Functions
-
inline bool
operator()
(const ConstNodePtr &a, const ConstNodePtr &b)
-
inline bool
-
using
Struct Node::Compare¶
Defined in File debug_Planner.hpp
Nested Relationships¶
This struct is a nested type of Struct Debug::Node.
Struct Documentation¶
-
struct
rmf_traffic::agv::Planner::Debug::Node
::
Compare
Public Functions
-
inline bool
operator()
(const ConstNodePtr &a, const ConstNodePtr &b)
-
inline bool
Struct RouteValidator::Conflict¶
Defined in File RouteValidator.hpp
Nested Relationships¶
This struct is a nested type of Class RouteValidator.
Struct Documentation¶
-
struct
rmf_traffic::agv::RouteValidator
::
Conflict
Struct TimeVelocity¶
Defined in File Interpolate.hpp
Struct Documentation¶
-
struct
rmf_traffic::agv
::
TimeVelocity
¶
Struct ReservedRange¶
Defined in File Status.hpp
Struct Documentation¶
-
struct
rmf_traffic::blockade
::
ReservedRange
¶ Public Functions
-
inline bool
operator==
(const ReservedRange &other) const¶
-
inline bool
Struct Status¶
Defined in File Status.hpp
Struct Documentation¶
-
struct
rmf_traffic::blockade
::
Status
¶ Public Members
-
ReservationId
reservation
¶
-
std::optional<CheckpointId>
last_ready
¶
-
CheckpointId
last_reached
¶
-
bool
critical_error
¶
-
ReservationId
Struct Writer::Checkpoint¶
Defined in File Writer.hpp
Nested Relationships¶
This struct is a nested type of Class Writer.
Struct Documentation¶
-
struct
rmf_traffic::blockade::Writer
::
Checkpoint
Public Members
-
Eigen::Vector2d
position
-
std::string
map_name
-
bool
can_hold
-
Eigen::Vector2d
Struct Writer::Reservation¶
Defined in File Writer.hpp
Nested Relationships¶
This struct is a nested type of Class Writer.
Struct Documentation¶
-
struct
rmf_traffic::blockade::Writer
::
Reservation
Struct Dependency¶
Defined in File Route.hpp
Struct Documentation¶
-
struct
rmf_traffic
::
Dependency
¶ Bundle of integers representing a dependency on a checkpoint within a specific participant’s plan.
Public Functions
-
bool
operator==
(const Dependency &other) const¶ Equality operator.
-
bool
Struct DependsOnPlan::Dependency¶
Defined in File Route.hpp
Nested Relationships¶
This struct is a nested type of Class DependsOnPlan.
Struct Documentation¶
-
struct
rmf_traffic::DependsOnPlan
::
Dependency
Struct DetectConflict::Conflict¶
Defined in File DetectConflict.hpp
Nested Relationships¶
This struct is a nested type of Class DetectConflict.
Struct Documentation¶
-
struct
rmf_traffic::DetectConflict
::
Conflict
Struct Add::Item¶
Defined in File Change.hpp
Nested Relationships¶
This struct is a nested type of Class Change::Add.
Struct Documentation¶
-
struct
rmf_traffic::schedule::Change::Add
::
Item
A description of an addition.
Public Members
-
RouteId
route_id
The ID of the route being added, relative to the plan it belongs to.
-
StorageId
storage_id
The storage ID of the route.
-
ConstRoutePtr
route
The information for the route being added.
-
RouteId
Struct Inconsistencies::Element¶
Defined in File Inconsistencies.hpp
Nested Relationships¶
This struct is a nested type of Class Inconsistencies.
Struct Documentation¶
-
struct
rmf_traffic::schedule::Inconsistencies
::
Element
An element of the Inconsistencies container. This tells the ranges of inconsistencies that are present for the specified Participant.
Struct Ranges::Range¶
Defined in File Inconsistencies.hpp
Nested Relationships¶
This struct is a nested type of Class Inconsistencies::Ranges.
Struct Documentation¶
-
struct
rmf_traffic::schedule::Inconsistencies::Ranges
::
Range
A single range of inconsistencies within a participant.
Every version between (and including) the lower and upper versions have not been received by the Database.
Template Struct Negotiation::SearchResult¶
Defined in File Negotiation.hpp
Nested Relationships¶
This struct is a nested type of Class Negotiation.
Struct Documentation¶
-
template<typename
Ptr
>
structrmf_traffic::schedule::Negotiation
::
SearchResult
Public Functions
-
inline bool
deprecated
() const
-
inline bool
absent
() const
-
inline bool
found
() const
-
inline
operator bool
() const
Public Members
-
SearchStatus
status
The status of the search.
-
inline bool
Struct Negotiation::Submission¶
Defined in File Negotiation.hpp
Nested Relationships¶
This struct is a nested type of Class Negotiation.
Struct Documentation¶
-
struct
rmf_traffic::schedule::Negotiation
::
Submission
Struct Negotiation::VersionedKey¶
Defined in File Negotiation.hpp
Nested Relationships¶
This struct is a nested type of Class Negotiation.
Struct Documentation¶
-
struct
rmf_traffic::schedule::Negotiation
::
VersionedKey
This struct is used to select a child table, demaning a specific version.
Public Functions
-
inline bool
operator==
(const VersionedKey &other) const
-
inline bool
operator!=
(const VersionedKey &other) const
-
inline bool
Struct Rectifier::Range¶
Defined in File Rectifier.hpp
Nested Relationships¶
This struct is a nested type of Class Rectifier.
Struct Documentation¶
-
struct
rmf_traffic::schedule::Rectifier
::
Range
A range of itinerary change IDs that is currently missing from a database. All IDs from lower to upper are missing, including lower and upper themselves.
It is undefined behavior if the value given to upper is less than the value given to upper.
Public Members
-
ItineraryVersion
lower
The ID of the first itinerary change in this range that is missing.
-
ItineraryVersion
upper
The ID of the last itinerary change in this range that is missing.
-
ItineraryVersion
Struct View::Element¶
Defined in File Viewer.hpp
Nested Relationships¶
This struct is a nested type of Class Viewer::View.
Struct Documentation¶
-
struct
rmf_traffic::schedule::Viewer::View
::
Element
Public Members
-
const ParticipantId
participant
-
const PlanId
plan_id
-
const RouteId
route_id
-
const std::shared_ptr<const Route>
route
-
const ParticipantDescription &
description
-
const ParticipantId
Struct Trajectory::InsertionResult¶
Defined in File Trajectory.hpp
Nested Relationships¶
This struct is a nested type of Class Trajectory.
Struct Documentation¶
-
struct
rmf_traffic::Trajectory
::
InsertionResult
Template Struct hash< rmf_traffic::agv::LaneClosure >¶
Defined in File LaneClosure.hpp
Struct Documentation¶
-
template<>
structstd
::
hash
<rmf_traffic::agv::LaneClosure>¶ Public Functions
-
inline std::size_t
operator()
(const rmf_traffic::agv::LaneClosure &closure) const noexcept¶
-
inline std::size_t
Class CentralizedNegotiation¶
Defined in File CentralizedNegotiation.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic::agv
::
CentralizedNegotiation
¶ Public Types
-
using
Proposal
= std::unordered_map<schedule::ParticipantId, Plan>¶ When a proposal is found, it will provide a plan for each agent.
Public Functions
Constructor
- Parameters
[in] viewer
: A viewer for the traffic schedule. You may provide a std::shared_ptr<const schedule::Database> for this. The negotiation will avoid creating any new conflicts with schedule participants that are not part of the negotiation.
Set the schedule viewer.
-
CentralizedNegotiation &
optimal
(bool on = true)¶ Require the negotiation to consider all combinations so that it finds the (near-)optimal solution. Off by default.
-
CentralizedNegotiation &
log
(bool on = true)¶ Toggle on/off whether to log the progress of the negotiation and save it in the Result. Off by default.
-
CentralizedNegotiation &
print
(bool on = true)¶ Toggle on/off whether to print the progress of the negotiation while it is running. Off by default.
-
class
Agent
¶ Public Functions
Constructor
- Parameters
[in] id
: This agent’s ID within the schedule database. If multiple agents are given the same ID in a negotiation, then a runtime exception will be thrown.[in] starts
: The starting condition for this agent.[in] goal
: The goal for this agent.[in] planner
: The single-agent planner used for this agent. Each agent can have its own planner or they can share planners. If this is set to nullptr when the negotiation begins, then a runtime exception will be thrown.[in] options
: Options to use for the negotiator of this agent. If nullopt is provided, then the default options of the SimpleNegotiator will be used.
Constructor
The planner will use whichever starting condition provides the optimal plan.
- Parameters
[in] id
: This agent’s ID within the schedule database. If multiple agents are given the same ID in a negotiation, then a runtime exception will be thrown.[in] starts
: One or more starting conditions for this agent. If no starting conditions are provided before the negotiation begins, then a runtime exception will be thrown.
- Parameters
[in] goal
: The goal for this agent.[in] planner
: The single-agent planner used for this agent. Each agent can have its own planner or they can share planners. If this is set to nullptr when the negotiation begins, then a runtime exception will be thrown.[in] options
: Options to use for the negotiator of this agent. If nullopt is provided, then the default options of the SimpleNegotiator will be used.
-
schedule::ParticipantId
id
() const¶ Get the ID for this agent.
-
Agent &
id
(schedule::ParticipantId value)¶ Set the ID for this agent.
Set the planner for this agent.
-
const std::optional<SimpleNegotiator::Options> &
options
() const¶ Get the options for this agent.
-
Agent &
options
(std::optional<SimpleNegotiator::Options> value)¶ Set the options for this agent.
-
class
Result
¶ Public Functions
-
const std::optional<Proposal> &
proposal
() const¶ If a solution was found, it will be provided by this proposal.
-
const std::unordered_set<schedule::ParticipantId> &
blockers
() const¶ This is a list of schedule Participants that were not part of the negotiation who blocked the planning effort. Blockers do not necessarily prevent a solution from being found, but they do prevent the optimal solution from being available.
-
const std::vector<std::string> &
log
() const¶ A log of messages related to the negotiation. This will be empty unless the log() function of the CentralizedNegotiation is toggled on before solving.
-
const std::optional<Proposal> &
-
using
Class CentralizedNegotiation::Agent¶
Defined in File CentralizedNegotiation.hpp
Nested Relationships¶
This class is a nested type of Class CentralizedNegotiation.
Class Documentation¶
-
class
rmf_traffic::agv::CentralizedNegotiation
::
Agent
Public Functions
Constructor
- Parameters
[in] id
: This agent’s ID within the schedule database. If multiple agents are given the same ID in a negotiation, then a runtime exception will be thrown.[in] starts
: The starting condition for this agent.[in] goal
: The goal for this agent.[in] planner
: The single-agent planner used for this agent. Each agent can have its own planner or they can share planners. If this is set to nullptr when the negotiation begins, then a runtime exception will be thrown.[in] options
: Options to use for the negotiator of this agent. If nullopt is provided, then the default options of the SimpleNegotiator will be used.
Constructor
The planner will use whichever starting condition provides the optimal plan.
- Parameters
[in] id
: This agent’s ID within the schedule database. If multiple agents are given the same ID in a negotiation, then a runtime exception will be thrown.[in] starts
: One or more starting conditions for this agent. If no starting conditions are provided before the negotiation begins, then a runtime exception will be thrown.
- Parameters
[in] goal
: The goal for this agent.[in] planner
: The single-agent planner used for this agent. Each agent can have its own planner or they can share planners. If this is set to nullptr when the negotiation begins, then a runtime exception will be thrown.[in] options
: Options to use for the negotiator of this agent. If nullopt is provided, then the default options of the SimpleNegotiator will be used.
-
schedule::ParticipantId
id
() const Get the ID for this agent.
-
Agent &
id
(schedule::ParticipantId value) Set the ID for this agent.
-
const std::shared_ptr<const Planner> &
planner
() const Get the planner for this agent.
Set the planner for this agent.
-
const std::optional<SimpleNegotiator::Options> &
options
() const Get the options for this agent.
-
Agent &
options
(std::optional<SimpleNegotiator::Options> value) Set the options for this agent.
Class CentralizedNegotiation::Result¶
Defined in File CentralizedNegotiation.hpp
Nested Relationships¶
This class is a nested type of Class CentralizedNegotiation.
Class Documentation¶
-
class
rmf_traffic::agv::CentralizedNegotiation
::
Result
Public Functions
-
const std::optional<Proposal> &
proposal
() const If a solution was found, it will be provided by this proposal.
-
const std::unordered_set<schedule::ParticipantId> &
blockers
() const This is a list of schedule Participants that were not part of the negotiation who blocked the planning effort. Blockers do not necessarily prevent a solution from being found, but they do prevent the optimal solution from being available.
-
const std::vector<std::string> &
log
() const A log of messages related to the negotiation. This will be empty unless the log() function of the CentralizedNegotiation is toggled on before solving.
-
const std::optional<Proposal> &
Class Graph¶
Defined in File Graph.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic::agv
::
Graph
¶ Public Functions
-
Graph
()¶ Default constructor.
-
Waypoint &
add_waypoint
(std::string map_name, Eigen::Vector2d location)¶ Make a new waypoint for this graph. It will not be connected to any other waypoints until you use make_lane() to connect it.
- Note
Waypoints cannot be erased from a Graph after they are created.
-
const Waypoint &
get_waypoint
(std::size_t index) const¶ const-qualified get_waypoint()
-
Waypoint *
find_waypoint
(const std::string &key)¶ Find a waypoint given a key name. If the graph does not have a matching key name, then a nullptr will be returned.
-
const Waypoint *
find_waypoint
(const std::string &key) const¶ const-qualified find_waypoint()
-
bool
add_key
(const std::string &key, std::size_t wp_index)¶ Add a new waypoint key name to the graph. If a new key name is given, then this function will return true. If the given key name was already in use, then this will return false and nothing will be changed in the graph.
-
bool
remove_key
(const std::string &key)¶ Remove the waypoint key with the given name, if it exists in this Graph. If the key was removed, this will return true. If the key did not exist, this will return false.
-
bool
set_key
(const std::string &key, std::size_t wp_index)¶ Set a waypoint key. If this key is already in the Graph, it will be changed to the new association.
This function will return false if wp_index is outside the range of the waypoints in this Graph.
-
const std::unordered_map<std::string, std::size_t> &
keys
() const¶ Get the map of all keys in this Graph.
-
Lane &
add_lane
(const Lane::Node &entry, const Lane::Node &exit, Lane::Properties properties = Lane::Properties())¶ Make a lane for this graph. Lanes connect waypoints together, allowing the graph to know how the robot is allowed to traverse between waypoints.
-
const Lane &
get_lane
(std::size_t index) const¶ const-qualified get_lane()
-
const std::vector<std::size_t> &
lanes_from
(std::size_t wp_index) const¶ Get the indices of lanes that come out of the given Waypoint index.
-
const std::vector<std::size_t> &
lanes_into
(std::size_t wp_index) const¶ Get the indices of lanes that arrive into the given Waypoint index.
-
Lane *
lane_from
(std::size_t from_wp, std::size_t to_wp)¶ Get a reference to the lane that goes from from_wp to to_wp if such a lane exists. If no such lane exists, this will return a nullptr. If multiple exist, this will return the one that was added most recently.
-
const Lane *
lane_from
(std::size_t from_wp, std::size_t to_wp) const¶ const-qualified lane_from()
-
class
Lane
¶ Add a lane to connect two waypoints.
Public Functions
-
Node &
entry
()¶ Get the entry node of this Lane. The lane represents an edge in the graph that goes away from this node.
-
Node &
exit
()¶ Get the exit node of this Lane. The lane represents an edge in the graph that goes into this node.
-
Properties &
properties
()¶ Get the properties of this Lane.
-
const Properties &
properties
() const¶ const-qualified properties()
-
class
Dock
¶
-
class
Door
¶ A door in the graph which needs to be opened before a robot can enter a certain lane or closed before the robot can exit the lane.
Subclassed by rmf_traffic::agv::Graph::Lane::DoorClose, rmf_traffic::agv::Graph::Lane::DoorOpen
-
class
Event
¶ An abstraction for the different kinds of Lane events.
Public Functions
-
template<typename
DerivedExecutor
>
inline DerivedExecutor &execute
(DerivedExecutor &executor) const¶
-
virtual
~Event
() = default¶
Public Static Functions
-
static EventPtr
make
(LiftSessionBegin open)¶
-
static EventPtr
make
(LiftSessionEnd close)¶
-
static EventPtr
make
(LiftDoorOpen open)¶
-
template<typename
-
class
Executor
¶ A customizable Executor that can carry out actions based on which Event type is present.
Public Types
-
using
LiftSessionBegin
= Lane::LiftSessionBegin¶
-
using
LiftDoorOpen
= Lane::LiftDoorOpen¶
-
using
LiftSessionEnd
= Lane::LiftSessionEnd¶
Public Functions
-
virtual void
execute
(const LiftSessionBegin &begin) = 0¶
-
virtual void
execute
(const LiftDoorOpen &open) = 0¶
-
virtual void
execute
(const LiftSessionEnd &end) = 0¶
-
virtual
~Executor
() = default¶
-
using
-
class
LiftDoorOpen
: public rmf_traffic::agv::Graph::Lane::LiftSession¶
-
class
LiftMove
: public rmf_traffic::agv::Graph::Lane::LiftSession¶
-
class
LiftSession
¶ A lift door in the graph which needs to be opened before a robot can enter a certain lane or closed before the robot can exit the lane.
Subclassed by rmf_traffic::agv::Graph::Lane::LiftDoorOpen, rmf_traffic::agv::Graph::Lane::LiftMove, rmf_traffic::agv::Graph::Lane::LiftSessionBegin, rmf_traffic::agv::Graph::Lane::LiftSessionEnd
Public Functions
-
LiftSession
(std::string lift_name, std::string floor_name, Duration duration)¶ Constructor
- Parameters
[in] lift_name
: Name of the lift that this door belongs to.[in] floor_name
: Name of the floor that this door belongs to.[in] duration
: How long the door takes to open or close.
-
const std::string &
lift_name
() const¶ Get the name of the lift that the door belongs to.
-
LiftSession &
lift_name
(std::string name)¶ Set the name of the lift that the door belongs to.
-
const std::string &
floor_name
() const¶ Get the name of the floor that this door is on.
-
LiftSession &
floor_name
(std::string name)¶ Set the name of the floor that this door is on.
-
LiftSession &
duration
(Duration duration)¶ Set an estimate of how long it will take the door to open or close.
-
-
class
LiftSessionBegin
: public rmf_traffic::agv::Graph::Lane::LiftSession¶
-
class
LiftSessionEnd
: public rmf_traffic::agv::Graph::Lane::LiftSession¶
-
class
Node
¶ A Lane Node wraps up a Waypoint with constraints. The constraints stipulate the conditions for entering or exiting the lane to reach this waypoint.
Public Functions
-
Node
(std::size_t waypoint_index, rmf_utils::clone_ptr<Event> event = nullptr, rmf_utils::clone_ptr<OrientationConstraint> orientation = nullptr)¶ Constructor
- Parameters
waypoint_index
: The index of the waypoint for this Nodeevent
: An event that must happen before/after this Node is approached (before if it’s an entry Node or after if it’s an exit Node).orientation
: Any orientation constraints for moving to/from this Node (depending on whether it’s an entry Node or an exit Node).
-
Node
(std::size_t waypoint_index, rmf_utils::clone_ptr<OrientationConstraint> orientation)¶ Constructor. The event parameter will be nullptr.
-
const Event *
event
() const¶ Get a reference to an event that must occur before or after this Node is visited.
- Note
Before if this is an entry node or after if this is an exit node
-
Node &
event
(rmf_utils::clone_ptr<Event> new_event)¶ Set the event that must occur before or after this Node is visited.
-
const OrientationConstraint *
orientation_constraint
() const¶ Get the constraint on orientation that is tied to this Node.
-
-
class
Properties
¶ The Lane Properties class contains properties that apply across the full extent of the lane.
Public Functions
-
Properties
()¶ Construct a default set of properties
speed_limit: nullopt
-
std::optional<double>
speed_limit
() const¶ Get the speed limit along this lane. If a std::nullopt is returned, then there is no specified speed limit for the lane.
-
Properties &
speed_limit
(std::optional<double> value)¶ Set the speed limit along this lane. Providing a std::nullopt indicates that there is no speed limit for the lane.
-
-
class
Wait
¶
-
Node &
-
class
OrientationConstraint
¶ A class that implicitly specifies a constraint on the robot’s orientation.
Public Functions
-
virtual bool
apply
(Eigen::Vector3d &position, const Eigen::Vector2d &course_vector) const = 0¶ Apply the constraint to the given homogeneous position.
- Return
True if the constraint is satisfied with the new value of position. False if the constraint could not be satisfied.
- Parameters
[inout] position
: The position which needs to be constrained. The function should modify this position such that it satisfies the constraint, if possible.[in] course_vector
: The direction that the robot is travelling in. Given for informational purposes.
-
virtual rmf_utils::clone_ptr<OrientationConstraint>
clone
() const = 0¶ Clone this OrientationConstraint.
-
virtual
~OrientationConstraint
() = default¶
Public Static Functions
-
static rmf_utils::clone_ptr<OrientationConstraint>
make
(std::vector<double> acceptable_orientations)¶ Make an orientation constraint that requires a specific value for the orientation.
-
static rmf_utils::clone_ptr<OrientationConstraint>
make
(Direction direction, const Eigen::Vector2d &forward_vector)¶ Make an orientation constraint that requires the vehicle to face forward or backward.
-
virtual bool
-
class
Waypoint
¶ Public Functions
-
bool
is_holding_point
() const¶ Returns true if this Waypoint can be used as a holding point for the vehicle, otherwise returns false.
-
Waypoint &
set_holding_point
(bool _is_holding_point)¶ Set whether this waypoint can be used as a holding point for the vehicle.
-
bool
is_passthrough_point
() const¶ Returns true if this Waypoint is a passthrough point, meaning a planner should not have a robot wait at this point, even just briefly to allow another robot to pass. Setting passthrough points reduces the branching factor of a planner, allowing it to run faster, at the cost of losing possible solutions to conflicts.
-
bool
is_parking_spot
() const¶ Returns true if this Waypoint is a parking spot. Parking spots are used when an emergency alarm goes off, and the robot is required to park itself.
-
bool
is_charger
() const¶ Returns true if this Waypoint is a charger spot. Robots are routed to these spots when their batteries charge levels drop below the threshold value.
-
std::size_t
index
() const¶ The index of this waypoint within the Graph. This cannot be changed after the waypoint is created.
-
const std::string *
name
() const¶ If this waypoint has a name, return a reference to it. If this waypoint does not have a name, return a nullptr.
The name of a waypoint can only be set using add_key() or set_key().
-
std::string
name_or_index
(const std::string &name_format = "%s", const std::string &index_format = "#%d") const¶ If this waypoint has a name, the name will be returned. Otherwise it will return the waypoint index, formatted into a string based on the index_format argument.
- Parameters
[in] name_format
: If this waypoint has an assigned name, the first instance of “%s” within name_format will be replaced with the name of the waypoint. If there is no s in the name_format string, then this function will simply return the name_format string as-is when the waypoint has a name.[in] index_format
: If this waypoint does not have an assigned name, the first instance of “%d” within the index_format string will be replaced with the stringified decimal index value of the waypoint. If there is no “%d” in the index_format string, then this function will simply return the index_format string as-is when the waypoint does not have a name.
-
bool
-
Class Graph::Lane¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph.
Class Documentation¶
-
class
rmf_traffic::agv::Graph
::
Lane
Add a lane to connect two waypoints.
Public Types
-
using
EventPtr
= rmf_utils::clone_ptr<Event>
Public Functions
-
Node &
entry
() Get the entry node of this Lane. The lane represents an edge in the graph that goes away from this node.
-
Node &
exit
() Get the exit node of this Lane. The lane represents an edge in the graph that goes into this node.
-
Properties &
properties
() Get the properties of this Lane.
-
const Properties &
properties
() const const-qualified properties()
-
class
Dock
Public Functions
-
Dock
(std::string dock_name, Duration duration) Constructor
- Parameters
[in] Name
: of the dock that will be approached[in] How
: long the robot will take to dock
-
const std::string &
dock_name
() const Get the name of the dock.
-
Dock &
dock_name
(std::string name) Set the name of the dock.
-
Duration
duration
() const Get an estimate for how long the docking will take.
-
-
class
Door
A door in the graph which needs to be opened before a robot can enter a certain lane or closed before the robot can exit the lane.
Subclassed by rmf_traffic::agv::Graph::Lane::DoorClose, rmf_traffic::agv::Graph::Lane::DoorOpen
Public Functions
-
Door
(std::string name, Duration duration) Constructor
- Parameters
[in] name
: Unique name of the door.[in] duration
: How long the door takes to open or close.
-
const std::string &
name
() const Get the unique name (ID) of this Door.
-
Duration
duration
() const Get the duration incurred by waiting for this door to open or close.
-
-
class
Event
An abstraction for the different kinds of Lane events.
Public Functions
-
virtual Duration
duration
() const = 0 An estimate of how long the event will take.
-
template<typename
DerivedExecutor
>
inline DerivedExecutor &execute
(DerivedExecutor &executor) const
-
virtual EventPtr
clone
() const = 0 Clone this event.
-
virtual
~Event
() = default
Public Static Functions
-
static EventPtr
make
(LiftSessionBegin open)
-
static EventPtr
make
(LiftSessionEnd close)
-
static EventPtr
make
(LiftDoorOpen open)
-
virtual Duration
-
class
Executor
A customizable Executor that can carry out actions based on which Event type is present.
Public Types
-
using
LiftSessionBegin
= Lane::LiftSessionBegin
-
using
LiftDoorOpen
= Lane::LiftDoorOpen
-
using
LiftSessionEnd
= Lane::LiftSessionEnd
Public Functions
-
virtual void
execute
(const DoorOpen &open) = 0
-
virtual void
execute
(const DoorClose &close) = 0
-
virtual void
execute
(const LiftSessionBegin &begin) = 0
-
virtual void
execute
(const LiftDoorOpen &open) = 0
-
virtual void
execute
(const LiftSessionEnd &end) = 0
-
virtual void
execute
(const LiftMove &move) = 0
-
virtual void
execute
(const Dock &dock) = 0
-
virtual void
execute
(const Wait &wait) = 0
-
virtual
~Executor
() = default
-
using
-
class
LiftDoorOpen
: public rmf_traffic::agv::Graph::Lane::LiftSession
-
class
LiftMove
: public rmf_traffic::agv::Graph::Lane::LiftSession
-
class
LiftSession
A lift door in the graph which needs to be opened before a robot can enter a certain lane or closed before the robot can exit the lane.
Subclassed by rmf_traffic::agv::Graph::Lane::LiftDoorOpen, rmf_traffic::agv::Graph::Lane::LiftMove, rmf_traffic::agv::Graph::Lane::LiftSessionBegin, rmf_traffic::agv::Graph::Lane::LiftSessionEnd
Public Functions
-
LiftSession
(std::string lift_name, std::string floor_name, Duration duration) Constructor
- Parameters
[in] lift_name
: Name of the lift that this door belongs to.[in] floor_name
: Name of the floor that this door belongs to.[in] duration
: How long the door takes to open or close.
-
const std::string &
lift_name
() const Get the name of the lift that the door belongs to.
-
LiftSession &
lift_name
(std::string name) Set the name of the lift that the door belongs to.
-
const std::string &
floor_name
() const Get the name of the floor that this door is on.
-
LiftSession &
floor_name
(std::string name) Set the name of the floor that this door is on.
-
Duration
duration
() const Get an estimate of how long it will take the door to open or close.
-
LiftSession &
duration
(Duration duration) Set an estimate of how long it will take the door to open or close.
-
-
class
LiftSessionBegin
: public rmf_traffic::agv::Graph::Lane::LiftSession
-
class
LiftSessionEnd
: public rmf_traffic::agv::Graph::Lane::LiftSession
-
class
Node
A Lane Node wraps up a Waypoint with constraints. The constraints stipulate the conditions for entering or exiting the lane to reach this waypoint.
Public Functions
-
Node
(std::size_t waypoint_index, rmf_utils::clone_ptr<Event> event = nullptr, rmf_utils::clone_ptr<OrientationConstraint> orientation = nullptr) Constructor
- Parameters
waypoint_index
: The index of the waypoint for this Nodeevent
: An event that must happen before/after this Node is approached (before if it’s an entry Node or after if it’s an exit Node).orientation
: Any orientation constraints for moving to/from this Node (depending on whether it’s an entry Node or an exit Node).
-
Node
(std::size_t waypoint_index, rmf_utils::clone_ptr<OrientationConstraint> orientation) Constructor. The event parameter will be nullptr.
-
std::size_t
waypoint_index
() const Get the index of the waypoint that this Node is wrapped around.
-
const Event *
event
() const Get a reference to an event that must occur before or after this Node is visited.
- Note
Before if this is an entry node or after if this is an exit node
-
Node &
event
(rmf_utils::clone_ptr<Event> new_event) Set the event that must occur before or after this Node is visited.
-
const OrientationConstraint *
orientation_constraint
() const Get the constraint on orientation that is tied to this Node.
-
-
class
Properties
The Lane Properties class contains properties that apply across the full extent of the lane.
Public Functions
-
Properties
() Construct a default set of properties
speed_limit: nullopt
-
std::optional<double>
speed_limit
() const Get the speed limit along this lane. If a std::nullopt is returned, then there is no specified speed limit for the lane.
-
Properties &
speed_limit
(std::optional<double> value) Set the speed limit along this lane. Providing a std::nullopt indicates that there is no speed limit for the lane.
-
-
class
Wait
-
using
Class Lane::Dock¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Class Documentation¶
-
class
rmf_traffic::agv::Graph::Lane
::
Dock
Public Functions
-
Dock
(std::string dock_name, Duration duration) Constructor
- Parameters
[in] Name
: of the dock that will be approached[in] How
: long the robot will take to dock
-
const std::string &
dock_name
() const Get the name of the dock.
-
Dock &
dock_name
(std::string name) Set the name of the dock.
-
Duration
duration
() const Get an estimate for how long the docking will take.
-
Class Lane::Door¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Inheritance Relationships¶
public rmf_traffic::agv::Graph::Lane::DoorClose
(Class Lane::DoorClose)public rmf_traffic::agv::Graph::Lane::DoorOpen
(Class Lane::DoorOpen)
Class Documentation¶
-
class
rmf_traffic::agv::Graph::Lane
::
Door
A door in the graph which needs to be opened before a robot can enter a certain lane or closed before the robot can exit the lane.
Subclassed by rmf_traffic::agv::Graph::Lane::DoorClose, rmf_traffic::agv::Graph::Lane::DoorOpen
Public Functions
-
Door
(std::string name, Duration duration) Constructor
- Parameters
[in] name
: Unique name of the door.[in] duration
: How long the door takes to open or close.
-
const std::string &
name
() const Get the unique name (ID) of this Door.
-
Duration
duration
() const Get the duration incurred by waiting for this door to open or close.
-
Class Lane::DoorClose¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Inheritance Relationships¶
public rmf_traffic::agv::Graph::Lane::Door
(Class Lane::Door)
Class Documentation¶
Class Lane::DoorOpen¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Inheritance Relationships¶
public rmf_traffic::agv::Graph::Lane::Door
(Class Lane::Door)
Class Documentation¶
Class Lane::Event¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Class Documentation¶
-
class
rmf_traffic::agv::Graph::Lane
::
Event
An abstraction for the different kinds of Lane events.
Public Functions
-
virtual Duration
duration
() const = 0 An estimate of how long the event will take.
-
template<typename
DerivedExecutor
>
inline DerivedExecutor &execute
(DerivedExecutor &executor) const
-
virtual EventPtr
clone
() const = 0 Clone this event.
-
virtual
~Event
() = default
Public Static Functions
-
static EventPtr
make
(LiftSessionBegin open)
-
static EventPtr
make
(LiftSessionEnd close)
-
static EventPtr
make
(LiftDoorOpen open)
-
virtual Duration
Class Lane::Executor¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Class Documentation¶
-
class
rmf_traffic::agv::Graph::Lane
::
Executor
A customizable Executor that can carry out actions based on which Event type is present.
Public Types
-
using
LiftSessionBegin
= Lane::LiftSessionBegin
-
using
LiftDoorOpen
= Lane::LiftDoorOpen
-
using
LiftSessionEnd
= Lane::LiftSessionEnd
Public Functions
-
virtual void
execute
(const DoorOpen &open) = 0
-
virtual void
execute
(const DoorClose &close) = 0
-
virtual void
execute
(const LiftSessionBegin &begin) = 0
-
virtual void
execute
(const LiftDoorOpen &open) = 0
-
virtual void
execute
(const LiftSessionEnd &end) = 0
-
virtual void
execute
(const LiftMove &move) = 0
-
virtual void
execute
(const Dock &dock) = 0
-
virtual void
execute
(const Wait &wait) = 0
-
virtual
~Executor
() = default
-
using
Class Lane::LiftDoorOpen¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Inheritance Relationships¶
public rmf_traffic::agv::Graph::Lane::LiftSession
(Class Lane::LiftSession)
Class Documentation¶
-
class
LiftDoorOpen
: public rmf_traffic::agv::Graph::Lane::LiftSession
Class Lane::LiftMove¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Inheritance Relationships¶
public rmf_traffic::agv::Graph::Lane::LiftSession
(Class Lane::LiftSession)
Class Documentation¶
-
class
LiftMove
: public rmf_traffic::agv::Graph::Lane::LiftSession
Class Lane::LiftSession¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Inheritance Relationships¶
public rmf_traffic::agv::Graph::Lane::LiftDoorOpen
(Class Lane::LiftDoorOpen)public rmf_traffic::agv::Graph::Lane::LiftMove
(Class Lane::LiftMove)public rmf_traffic::agv::Graph::Lane::LiftSessionBegin
(Class Lane::LiftSessionBegin)public rmf_traffic::agv::Graph::Lane::LiftSessionEnd
(Class Lane::LiftSessionEnd)
Class Documentation¶
-
class
rmf_traffic::agv::Graph::Lane
::
LiftSession
A lift door in the graph which needs to be opened before a robot can enter a certain lane or closed before the robot can exit the lane.
Subclassed by rmf_traffic::agv::Graph::Lane::LiftDoorOpen, rmf_traffic::agv::Graph::Lane::LiftMove, rmf_traffic::agv::Graph::Lane::LiftSessionBegin, rmf_traffic::agv::Graph::Lane::LiftSessionEnd
Public Functions
-
LiftSession
(std::string lift_name, std::string floor_name, Duration duration) Constructor
- Parameters
[in] lift_name
: Name of the lift that this door belongs to.[in] floor_name
: Name of the floor that this door belongs to.[in] duration
: How long the door takes to open or close.
-
const std::string &
lift_name
() const Get the name of the lift that the door belongs to.
-
LiftSession &
lift_name
(std::string name) Set the name of the lift that the door belongs to.
-
const std::string &
floor_name
() const Get the name of the floor that this door is on.
-
LiftSession &
floor_name
(std::string name) Set the name of the floor that this door is on.
-
Duration
duration
() const Get an estimate of how long it will take the door to open or close.
-
LiftSession &
duration
(Duration duration) Set an estimate of how long it will take the door to open or close.
-
Class Lane::LiftSessionBegin¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Inheritance Relationships¶
public rmf_traffic::agv::Graph::Lane::LiftSession
(Class Lane::LiftSession)
Class Documentation¶
-
class
LiftSessionBegin
: public rmf_traffic::agv::Graph::Lane::LiftSession
Class Lane::LiftSessionEnd¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Inheritance Relationships¶
public rmf_traffic::agv::Graph::Lane::LiftSession
(Class Lane::LiftSession)
Class Documentation¶
-
class
LiftSessionEnd
: public rmf_traffic::agv::Graph::Lane::LiftSession
Class Lane::Node¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Class Documentation¶
-
class
rmf_traffic::agv::Graph::Lane
::
Node
A Lane Node wraps up a Waypoint with constraints. The constraints stipulate the conditions for entering or exiting the lane to reach this waypoint.
Public Functions
-
Node
(std::size_t waypoint_index, rmf_utils::clone_ptr<Event> event = nullptr, rmf_utils::clone_ptr<OrientationConstraint> orientation = nullptr) Constructor
- Parameters
waypoint_index
: The index of the waypoint for this Nodeevent
: An event that must happen before/after this Node is approached (before if it’s an entry Node or after if it’s an exit Node).orientation
: Any orientation constraints for moving to/from this Node (depending on whether it’s an entry Node or an exit Node).
-
Node
(std::size_t waypoint_index, rmf_utils::clone_ptr<OrientationConstraint> orientation) Constructor. The event parameter will be nullptr.
-
std::size_t
waypoint_index
() const Get the index of the waypoint that this Node is wrapped around.
-
const Event *
event
() const Get a reference to an event that must occur before or after this Node is visited.
- Note
Before if this is an entry node or after if this is an exit node
-
Node &
event
(rmf_utils::clone_ptr<Event> new_event) Set the event that must occur before or after this Node is visited.
-
const OrientationConstraint *
orientation_constraint
() const Get the constraint on orientation that is tied to this Node.
-
Class Lane::Properties¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Class Documentation¶
-
class
rmf_traffic::agv::Graph::Lane
::
Properties
The Lane Properties class contains properties that apply across the full extent of the lane.
Public Functions
-
Properties
() Construct a default set of properties
speed_limit: nullopt
-
std::optional<double>
speed_limit
() const Get the speed limit along this lane. If a std::nullopt is returned, then there is no specified speed limit for the lane.
-
Properties &
speed_limit
(std::optional<double> value) Set the speed limit along this lane. Providing a std::nullopt indicates that there is no speed limit for the lane.
-
Class Lane::Wait¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph::Lane.
Class Documentation¶
Class Graph::OrientationConstraint¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph.
Class Documentation¶
-
class
rmf_traffic::agv::Graph
::
OrientationConstraint
A class that implicitly specifies a constraint on the robot’s orientation.
Public Types
-
enum
Direction
Values:
-
enumerator
Forward
-
enumerator
Backward
-
enumerator
Public Functions
-
virtual bool
apply
(Eigen::Vector3d &position, const Eigen::Vector2d &course_vector) const = 0 Apply the constraint to the given homogeneous position.
- Return
True if the constraint is satisfied with the new value of position. False if the constraint could not be satisfied.
- Parameters
[inout] position
: The position which needs to be constrained. The function should modify this position such that it satisfies the constraint, if possible.[in] course_vector
: The direction that the robot is travelling in. Given for informational purposes.
-
virtual rmf_utils::clone_ptr<OrientationConstraint>
clone
() const = 0 Clone this OrientationConstraint.
-
virtual
~OrientationConstraint
() = default
Public Static Functions
-
static rmf_utils::clone_ptr<OrientationConstraint>
make
(std::vector<double> acceptable_orientations) Make an orientation constraint that requires a specific value for the orientation.
-
static rmf_utils::clone_ptr<OrientationConstraint>
make
(Direction direction, const Eigen::Vector2d &forward_vector) Make an orientation constraint that requires the vehicle to face forward or backward.
-
enum
Class Graph::Waypoint¶
Defined in File Graph.hpp
Nested Relationships¶
This class is a nested type of Class Graph.
Class Documentation¶
-
class
rmf_traffic::agv::Graph
::
Waypoint
Public Functions
-
const std::string &
get_map_name
() const Get the name of the map that this Waypoint exists on.
-
const Eigen::Vector2d &
get_location
() const Get the position of this Waypoint.
-
bool
is_holding_point
() const Returns true if this Waypoint can be used as a holding point for the vehicle, otherwise returns false.
-
Waypoint &
set_holding_point
(bool _is_holding_point) Set whether this waypoint can be used as a holding point for the vehicle.
-
bool
is_passthrough_point
() const Returns true if this Waypoint is a passthrough point, meaning a planner should not have a robot wait at this point, even just briefly to allow another robot to pass. Setting passthrough points reduces the branching factor of a planner, allowing it to run faster, at the cost of losing possible solutions to conflicts.
-
bool
is_parking_spot
() const Returns true if this Waypoint is a parking spot. Parking spots are used when an emergency alarm goes off, and the robot is required to park itself.
-
bool
is_charger
() const Returns true if this Waypoint is a charger spot. Robots are routed to these spots when their batteries charge levels drop below the threshold value.
-
std::size_t
index
() const The index of this waypoint within the Graph. This cannot be changed after the waypoint is created.
-
const std::string *
name
() const If this waypoint has a name, return a reference to it. If this waypoint does not have a name, return a nullptr.
The name of a waypoint can only be set using add_key() or set_key().
-
std::string
name_or_index
(const std::string &name_format = "%s", const std::string &index_format = "#%d") const If this waypoint has a name, the name will be returned. Otherwise it will return the waypoint index, formatted into a string based on the index_format argument.
- Parameters
[in] name_format
: If this waypoint has an assigned name, the first instance of “%s” within name_format will be replaced with the name of the waypoint. If there is no s in the name_format string, then this function will simply return the name_format string as-is when the waypoint has a name.[in] index_format
: If this waypoint does not have an assigned name, the first instance of “%d” within the index_format string will be replaced with the stringified decimal index value of the waypoint. If there is no “%d” in the index_format string, then this function will simply return the index_format string as-is when the waypoint does not have a name.
-
const std::string &
Class Interpolate¶
Defined in File Interpolate.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic::agv
::
Interpolate
¶ Public Static Functions
-
static Trajectory
positions
(const VehicleTraits &traits, Time start_time, const std::vector<Eigen::Vector3d> &input_positions, const Options &options = Options())¶
-
class
Options
¶ Public Functions
-
Options
(bool always_stop = false, double translation_thresh = 1e-3, double rotation_thresh = 1.0 * M_PI / 180.0, double corner_angle_thresh = 1.0 * M_PI / 180.0)¶
-
Options &
set_always_stop
(bool choice)¶ The robot must always come to a complete stop at every position. When this is true, all other properties in the options will have no effect.
-
bool
always_stop
() const¶
-
Options &
set_translation_threshold
(double dist)¶ If a waypoint is closer than this distance to its prior or subsequent waypoint, then it is allowed to be skipped.
-
double
get_translation_threshold
() const¶ Get the translation threshold.
-
Options &
set_rotation_threshold
(double angle)¶ If a waypoint’s orientation is closer than this angle to the prior or subsequent waypoint, then it is allowed to be skipped.
-
double
get_rotation_threshold
() const¶ Get the rotation threshold.
-
Options &
set_corner_angle_threshold
(double angle)¶ If two line segments make a corner that is greater than this angle, then the waypoint must not be ignored.
-
double
get_corner_angle_threshold
() const¶ Get the corner angle threshold.
-
-
static Trajectory
Class Interpolate::Options¶
Defined in File Interpolate.hpp
Nested Relationships¶
This class is a nested type of Class Interpolate.
Class Documentation¶
-
class
rmf_traffic::agv::Interpolate
::
Options
Public Functions
-
Options
(bool always_stop = false, double translation_thresh = 1e-3, double rotation_thresh = 1.0 * M_PI / 180.0, double corner_angle_thresh = 1.0 * M_PI / 180.0)
-
Options &
set_always_stop
(bool choice) The robot must always come to a complete stop at every position. When this is true, all other properties in the options will have no effect.
-
bool
always_stop
() const
-
Options &
set_translation_threshold
(double dist) If a waypoint is closer than this distance to its prior or subsequent waypoint, then it is allowed to be skipped.
-
double
get_translation_threshold
() const Get the translation threshold.
-
Options &
set_rotation_threshold
(double angle) If a waypoint’s orientation is closer than this angle to the prior or subsequent waypoint, then it is allowed to be skipped.
-
double
get_rotation_threshold
() const Get the rotation threshold.
-
Options &
set_corner_angle_threshold
(double angle) If two line segments make a corner that is greater than this angle, then the waypoint must not be ignored.
-
double
get_corner_angle_threshold
() const Get the corner angle threshold.
-
Class invalid_traits_error¶
Defined in File Interpolate.hpp
Inheritance Relationships¶
public exception
Class Documentation¶
-
class
rmf_traffic::agv
::
invalid_traits_error
: public exception¶ This exception is thrown by Interpolate functions when the VehicleTraits that are provided cannot be interpolated as requested.
Public Functions
-
const char *
what
() const noexcept override¶
-
const char *
Class LaneClosure¶
Defined in File LaneClosure.hpp
Class Documentation¶
-
class
rmf_traffic::agv
::
LaneClosure
¶ This class describes the closure status of lanes in a Graph, i.e. whether a lane is open or closed. Open lanes can be used by the planner to reach a goal. The planner will not expand down a lane that is closed.
Public Functions
-
LaneClosure
()¶ Default constructor.
By default, all lanes are open.
-
bool
is_open
(std::size_t lane) const¶ Check whether the lane corresponding to the given index is open.
- Parameters
[in] lane
: The index for the lane of interest
-
bool
is_closed
(std::size_t lane) const¶ Check whether the lane corresponding to the given index is closed.
- Parameters
[in] lane
: The index for the lane of interest
-
LaneClosure &
open
(std::size_t lane)¶ Set the lane corresponding to the given index to be open.
- Parameters
[in] lane
: The index for the opening lane
-
LaneClosure &
close
(std::size_t lane)¶ Set the lane corresponding to the given index to be closed.
- Parameters
[in] lane
: The index for the closing lane
-
std::size_t
hash
() const¶ Get an integer that uniquely describes the overall closure status of the graph lanes.
-
bool
operator==
(const LaneClosure &other) const¶ Equality comparison operator.
-
Class NegotiatingRouteValidator¶
Defined in File RouteValidator.hpp
Nested Relationships¶
Inheritance Relationships¶
public rmf_traffic::agv::RouteValidator
(Class RouteValidator)
Class Documentation¶
-
class
rmf_traffic::agv
::
NegotiatingRouteValidator
: public rmf_traffic::agv::RouteValidator¶ Public Functions
-
NegotiatingRouteValidator &
mask
(schedule::ParticipantId id)¶ Mask the given Participant so that conflicts with it will be ignored. In the current implementation, only one participant can be masked at a time.
- Parameters
[in] id
: The ID of a participant whose conflicts should be ignored when checking for collisions.
-
NegotiatingRouteValidator &
remove_mask
()¶ Remove any mask that has been applied using the mask() function.
-
NegotiatingRouteValidator
next
(schedule::ParticipantId id) const¶ Get a NegotiatingRouteValidator for the next rollout alternative offered by the given participant.
-
const schedule::Negotiation::VersionedKeySequence &
alternatives
() const¶ Get the set of child Table alternatives used by this NegotiatingRouteValidator.
-
operator bool
() const¶ Implicitly cast this validator instance to true if it can be used as a validator. If it cannot be used as a validator, return false. This will have the opposite value of end().
-
bool
end
() const¶ Return true if this validator object has gone past the end of its limits. Return false if it can still be used as a validator.
-
virtual rmf_utils::optional<Conflict>
find_conflict
(const Route &route) const final¶ If the specified route has a conflict with another participant, this will return the participant ID for the first conflict that gets identified. Otherwise it will return a nullopt.
- Parameters
[in] route
: The route that is being checked.
-
virtual std::unique_ptr<RouteValidator>
clone
() const final¶ Create a clone of the underlying RouteValidator object.
-
class
Generator
¶ The Generator class begins the creation of NegotiatingRouteValidator instances. NegotiatingRouteValidator may be able to brach in multiple dimensions because of the rollout alternatives that are provided during a rejection.
Public Functions
-
Generator
(schedule::Negotiation::Table::ViewerPtr viewer, rmf_traffic::Profile profile)¶ Constructor
This version is safe to use even if the participant being negotiated for is not in the schedule yet.
- Parameters
[in] viewer
: A viewer for the Negotiation Table that the generated validators are concerned with[in] profile
: The profile of the participant whose routes are being validated.
-
Generator
(schedule::Negotiation::Table::ViewerPtr viewer)¶ Constructor
This version looks for the participant in the schedule to find its profile.
- Parameters
[in] table
: A viewer for the Negotiation Table that the generated validators are concerned with
-
Generator &
ignore_unresponsive
(bool val = true)¶ Toggle whether to ignore “unresponsive” (also called “read-only”) schedule participants when determining conflicts. By default, conflicts with unresponsive participants will be caught.
-
Generator &
ignore_bystanders
(bool val = true)¶ Toggle whether to ignore “bystanders” which means schedule participants that are not being involved in the negotiation. By default, conflicts with bystanders will be caught.
-
NegotiatingRouteValidator
begin
() const¶ Start with a NegotiatingRouteValidator that will use all the most preferred alternatives from every participant.
-
std::vector<rmf_utils::clone_ptr<NegotiatingRouteValidator>>
all
() const¶ Get all the Negotiating Route Validators that can be generated.
-
const std::vector<schedule::ParticipantId> &
alternative_sets
() const¶ Get the set of participants who have specified what their available rollouts are.
-
std::size_t
alternative_count
(schedule::ParticipantId participant) const¶ Get the number of alternative rollouts for the specified participant. This function will throw an excpetion if participant does not offer an alternative set.
-
-
NegotiatingRouteValidator &
Class NegotiatingRouteValidator::Generator¶
Defined in File RouteValidator.hpp
Nested Relationships¶
This class is a nested type of Class NegotiatingRouteValidator.
Class Documentation¶
-
class
rmf_traffic::agv::NegotiatingRouteValidator
::
Generator
The Generator class begins the creation of NegotiatingRouteValidator instances. NegotiatingRouteValidator may be able to brach in multiple dimensions because of the rollout alternatives that are provided during a rejection.
Public Functions
-
Generator
(schedule::Negotiation::Table::ViewerPtr viewer, rmf_traffic::Profile profile) Constructor
This version is safe to use even if the participant being negotiated for is not in the schedule yet.
- Parameters
[in] viewer
: A viewer for the Negotiation Table that the generated validators are concerned with[in] profile
: The profile of the participant whose routes are being validated.
-
Generator
(schedule::Negotiation::Table::ViewerPtr viewer) Constructor
This version looks for the participant in the schedule to find its profile.
- Parameters
[in] table
: A viewer for the Negotiation Table that the generated validators are concerned with
-
Generator &
ignore_unresponsive
(bool val = true) Toggle whether to ignore “unresponsive” (also called “read-only”) schedule participants when determining conflicts. By default, conflicts with unresponsive participants will be caught.
-
Generator &
ignore_bystanders
(bool val = true) Toggle whether to ignore “bystanders” which means schedule participants that are not being involved in the negotiation. By default, conflicts with bystanders will be caught.
-
NegotiatingRouteValidator
begin
() const Start with a NegotiatingRouteValidator that will use all the most preferred alternatives from every participant.
-
std::vector<rmf_utils::clone_ptr<NegotiatingRouteValidator>>
all
() const Get all the Negotiating Route Validators that can be generated.
-
const std::vector<schedule::ParticipantId> &
alternative_sets
() const Get the set of participants who have specified what their available rollouts are.
-
std::size_t
alternative_count
(schedule::ParticipantId participant) const Get the number of alternative rollouts for the specified participant. This function will throw an excpetion if participant does not offer an alternative set.
-
Class Plan¶
Defined in File Planner.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic::agv
::
Plan
¶ Public Types
-
using
Configuration
= Planner::Configuration¶
-
using
Checkpoints
= std::vector<Checkpoint>¶
Public Functions
-
const std::vector<Route> &
get_itinerary
() const¶ If this Plan is valid, this will return the trajectory of the successful plan. If the Start satisfies the Goal, then the itinerary will be empty.
-
const std::vector<Waypoint> &
get_waypoints
() const¶ If this plan is valid, this will return the waypoints of the successful plan.
-
double
get_cost
() const¶ Get the final cost of this plan.
-
struct
Checkpoint
¶
-
struct
Progress
¶
-
class
Waypoint
¶ -
This class helps to discretize a Plan based on the Waypoints belonging to the agv::Graph. Each Graph::Waypoint that the Plan stops or turns at will be accounted for by a Plan::Waypoint.
To indicate the intended orientation, each of these Waypoints provides an Eigen::Vector3d where the third element is the orientation.
The time that the position is meant to be arrived at is also given by the Waypoint.
- Note
Users are not allowed to make their own Waypoint instances, because it is too easy to accidentally get inconsistencies in the position and graph_index fields. Plan::Waypoints can only be created by Plan instances and can only be retrieved using Plan::get_waypoints().
Public Functions
-
const std::vector<std::size_t> &
approach_lanes
() const¶ Get the graph indices of the lanes that will be traversed on the way to this Waypoint. This will have multiple values if the robot is able to move straight through multiple lanes without stopping to reach this Waypoint. It will be empty if the robot does not need to traverse any lanes to reach this Waypoint (e.g. it is simply turning in place).
-
const std::vector<Progress> &
progress_checkpoints
() const¶ Points on the graph that will be passed along the way to this waypoint.
-
const Checkpoints &
arrival_checkpoints
() const¶ Points in the itinerary that have been reached when the robot arrives at this waypoint.
-
std::size_t
itinerary_index
() const¶
-
std::size_t
trajectory_index
() const¶
-
const Dependencies &
dependencies
() const¶ The dependencies on other traffic participants that must be satisfied before leaving this waypoint.
-
using
Class Plan::Waypoint¶
Defined in File Planner.hpp
Nested Relationships¶
This class is a nested type of Class Plan.
Class Documentation¶
-
class
rmf_traffic::agv::Plan
::
Waypoint
-
This class helps to discretize a Plan based on the Waypoints belonging to the agv::Graph. Each Graph::Waypoint that the Plan stops or turns at will be accounted for by a Plan::Waypoint.
To indicate the intended orientation, each of these Waypoints provides an Eigen::Vector3d where the third element is the orientation.
The time that the position is meant to be arrived at is also given by the Waypoint.
- Note
Users are not allowed to make their own Waypoint instances, because it is too easy to accidentally get inconsistencies in the position and graph_index fields. Plan::Waypoints can only be created by Plan instances and can only be retrieved using Plan::get_waypoints().
Public Functions
-
const Eigen::Vector3d &
position
() const Get the position for this Waypoint.
-
std::optional<std::size_t>
graph_index
() const Get the graph index of this Waypoint.
-
const std::vector<std::size_t> &
approach_lanes
() const Get the graph indices of the lanes that will be traversed on the way to this Waypoint. This will have multiple values if the robot is able to move straight through multiple lanes without stopping to reach this Waypoint. It will be empty if the robot does not need to traverse any lanes to reach this Waypoint (e.g. it is simply turning in place).
-
const std::vector<Progress> &
progress_checkpoints
() const Points on the graph that will be passed along the way to this waypoint.
-
const Checkpoints &
arrival_checkpoints
() const Points in the itinerary that have been reached when the robot arrives at this waypoint.
-
std::size_t
itinerary_index
() const
-
std::size_t
trajectory_index
() const
-
const Dependencies &
dependencies
() const The dependencies on other traffic participants that must be satisfied before leaving this waypoint.
Class Planner¶
Defined in File Planner.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic::agv
::
Planner
¶ -
Public Functions
-
Planner
(Configuration config, Options default_options)¶ Constructor
- Parameters
[in] config
: This is the Configuration for the Planner. The Planner instance will maintain a cache while it performs planning requests. This cache will offer potential speed ups to subsequent planning requests, but the correctness of the cache depends on the fields in the Configuration to remain constant. Therefore you are not permitted to modify a Planner’s Configuration after the Planner is constructed. To change the planning Configuration, you will need to create a new Planner instance with the desired Configuration.[in] default_options
: Unlike the Configuration, you are allowed to change a Planner’s Options. The parameter given here will be used as the default options, so you can set them here and then forget about them. These options can be overriden each time you request a plan.
-
const Configuration &
get_configuration
() const¶ Get a const reference to the configuration for this Planner. Note that the configuration of a planner cannot be changed once it is set.
- Note
The Planner maintains a cache that allows searches to become progressively faster. This cache depends on the fields in the Planner’s configuration, so those fields cannot be changed without invalidating that cache. To plan using a different configuration, you should create a new Planner instance with the desired configuration.
-
Result
plan
(const Start &start, Goal goal) const¶ Produce a plan for the given starting conditions and goal. The default Options of this Planner instance will be used.
- Parameters
[in] start
: The starting conditions[in] goal
: The goal conditions
-
Result
plan
(const Start &start, Goal goal, Options options) const¶ Product a plan for the given start and goal conditions. Override the default options.
-
Result
plan
(const StartSet &starts, Goal goal) const¶ Produces a plan for the given set of starting conditions and goal. The default Options of this Planner instance will be used.
The planner will choose the start condition that allows for the shortest plan (not the one that finishes the soonest according to wall time).
At least one start must be specified or else this is guaranteed to return a nullopt.
- Parameters
[in] starts
: The set of available starting conditions[in] goal
: The goal conditions
-
Result
plan
(const StartSet &starts, Goal goal, Options options) const¶ Produces a plan for the given set of starting conditions and goal. Override the default options.
The planner will choose the start condition that allows for the shortest plan (not the one that finishes the soonest according to wall time).
At least one start must be specified or else this is guaranteed to return a nullopt.
-
Result
setup
(const Start &start, Goal goal) const¶ Set up a planning job, but do not start iterating.
- See
plan(const Start&, Goal)
-
Result
setup
(const Start &start, Goal goal, Options options) const¶ Set up a planning job, but do not start iterating.
- See
plan(const Start&, Goal, Options)
-
class
Configuration
¶ The Configuration class contains planning parameters that are immutable for each Planner instance.
These parameters generally describe the capabilities or behaviors of the AGV that is being planned for, so they shouldn’t need to change in between plans anyway.
Public Functions
-
Configuration
(Graph graph, VehicleTraits traits, Interpolate::Options interpolation = Interpolate::Options())¶ Constructor
- Parameters
[in] vehicle_traits
: The traits of the vehicle that is being planned for[in] graph
: The graph which is being planned over[in] interpolation
: The options for how the planner will perform trajectory interpolation
-
Configuration &
graph
(Graph graph)¶ Set the graph to use for planning.
-
Configuration &
vehicle_traits
(VehicleTraits traits)¶ Set the vehicle traits to use for planning.
-
VehicleTraits &
vehicle_traits
()¶ Get a mutable reference to the vehicle traits.
-
const VehicleTraits &
vehicle_traits
() const¶ Get a const reference to the vehicle traits.
-
Configuration &
interpolation
(Interpolate::Options interpolate)¶ Set the interpolation options for the planner.
-
Interpolate::Options &
interpolation
()¶ Get a mutable reference to the interpolation options.
-
const Interpolate::Options &
interpolation
() const¶ Get a const reference to the interpolation options.
-
Configuration &
lane_closures
(LaneClosure closures)¶ Set the lane closures for the graph. The planner will not attempt to expand down any lanes that are closed.
-
LaneClosure &
lane_closures
()¶ Get a mutable reference to the LaneClosure setting.
-
const LaneClosure &
lane_closures
() const¶ Get a const reference to the LaneClosure setting.
-
Configuration &
traversal_cost_per_meter
(double value)¶ How much the cost should increase per meter travelled. Besides this, cost is measured by the number of seconds spent travelling.
-
double
traversal_cost_per_meter
() const¶ Get the traversal cost.
-
-
class
Debug
¶ This class exists only for debugging purposes. It is not to be used in live production, and its API is to be considered unstable at all times. Any minor version increment
Public Functions
Public Static Functions
-
static std::size_t
queue_size
(const Planner::Result &result)¶ Get the current size of the frontier queue of a Planner Result.
-
struct
Node
¶ A Node in the planning search. A final Planning solution will be a chain of these Nodes, aggregated into a Plan data structure.
Public Types
-
using
SearchQueue
= std::priority_queue<ConstNodePtr, std::vector<ConstNodePtr>, Compare>¶
-
using
Vector
= std::vector<ConstNodePtr>¶
Public Members
-
ConstNodePtr
parent
¶ The parent of this Node. If this is a nullptr, then this was a starting node.
-
double
remaining_cost_estimate
¶ An estimate of the remaining cost, based on the heuristic.
-
rmf_utils::optional<std::size_t>
start_set_index
¶ If this is a starting node, then this will be the index.
-
std::size_t
id
¶ A unique ID that sticks with this node for its entire lifetime. This will also (roughly) reflect the order of node creation.
-
struct
Compare
¶ Public Functions
-
inline bool
operator()
(const ConstNodePtr &a, const ConstNodePtr &b)¶
-
inline bool
-
using
-
class
Progress
¶ Public Functions
-
rmf_utils::optional<Plan>
step
()¶ Step the planner forward one time. This will expand the current highest priority Node in the queue and move it to the back of expanded_nodes. The nodes that result from the expansion will all be added to the queue.
-
inline
operator bool
() const¶ Implicitly cast the Progress instance to a boolean. The value will be true if the plan can keep expanding, and it will be false if it cannot expand any further.
After finding a solution, it may be possible to continue expanding, but there is no point because the first solution returned is guaranteed to be the optimal one.
-
const Node::SearchQueue &
queue
() const¶ A priority queue of unexpanded Nodes. They are sorted based on g(n)+h(n) in ascending order (see Node::Compare).
-
rmf_utils::optional<Plan>
-
static std::size_t
-
class
Goal
¶ Describe the goal conditions of a plan.
Public Functions
-
Goal
(std::size_t goal_waypoint)¶ Constructor
- Note
With this constructor, any final orientation will be accepted.
- Parameters
[in] goal_waypoint
: The waypoint that the AGV needs to reach.
-
Goal
(std::size_t goal_waypoint, double goal_orientation)¶ Constructor
- Parameters
[in] goal_waypoint
: The waypoint that the AGV needs to reach.[in] goal_orientation
: The orientation that the AGV needs to end with.
-
Goal
(std::size_t goal_waypoint, std::optional<rmf_traffic::Time> minimum_time, std::optional<double> goal_orientation = std::nullopt)¶ Constructor
- Parameters
[in] goal_waypoint
: The waypoint that the AGV needs to reach.[in] minimum_time
: The AGV must be on the goal waypoint at or after this time for the plan to be successful. This is useful if a robot needs to wait at a location, but you want it to give way for other robots.[in] goal_orientation
: An optional goal orientation that the AGV needs to end with.
-
std::size_t
waypoint
() const¶ Get the goal waypoint.
-
const double *
orientation
() const¶ Get a reference to the goal orientation (or a nullptr if any orientation is acceptable).
-
-
class
Options
¶ The Options class contains planning parameters that can change between each planning attempt.
Public Functions
Constructor
- Parameters
[in] validator
: A validator to check the validity of the planner’s branching options.[in] min_hold_time
: The minimum amount of time that the planner should spend waiting at holding points. Smaller values will make the plan more aggressive about being time-optimal, but the plan may take longer to produce. Larger values will add some latency to the execution of the plan as the robot may wait at a holding point longer than necessary, but the plan will usually be generated more quickly.[in] interrupt_flag
: A pointer to a flag that should be used to interrupt the planner if it has been running for too long. If the planner should run indefinitely, then pass in a nullptr.[in] maximum_cost_estimate
: A cap on how high the best possible solution’s cost can be. If the cost of the best possible solution ever exceeds this value, then the planner will interrupt itself, no matter what the state of the interrupt_flag is. Set this to nullopt to specify that there should not be a cap.[in] saturation_limit
: A cap on how many search nodes the planner is allowed to produce.
-
Options
(rmf_utils::clone_ptr<RouteValidator> validator, Duration min_hold_time, std::function<bool()> interrupterstd::optional<double> maximum_cost_estimate = std::nullopt, std::optional<std::size_t> saturation_limit = std::nullopt, )¶ Constructor
- Parameters
[in] validator
: A validator to check the validity of the planner’s branching options.[in] validator
: A validator to check the validity of the planner’s branching options.[in] min_hold_time
: The minimum amount of time that the planner should spend waiting at holding points. Smaller values will make the plan more aggressive about being time-optimal, but the plan may take longer to produce. Larger values will add some latency to the execution of the plan as the robot may wait at a holding point longer than necessary, but the plan will usually be generated more quickly.[in] interrupter
: A function that can determine whether the planning should be interrupted. This is an alternative to using the interrupt_flag.[in] maximum_cost_estimate
: A cap on how high the best possible solution’s cost can be. If the cost of the best possible solution ever exceeds this value, then the planner will interrupt itself, no matter what the state of the interrupt_flag is. Set this to nullopt to specify that there should not be a cap.[in] saturation_limit
: A cap on how many search nodes the planner is allowed to produce.
-
Options &
validator
(rmf_utils::clone_ptr<RouteValidator> v)¶ Set the route validator.
-
const rmf_utils::clone_ptr<RouteValidator> &
validator
() const¶ Get the route validator.
-
Options &
minimum_holding_time
(Duration holding_time)¶ Set the minimum amount of time to spend waiting at holding points.
-
Duration
minimum_holding_time
() const¶ Get the minimum amount of time to spend waiting at holding points.
-
Options &
interrupter
(std::function<bool()> cb)¶ Set an interrupter callback that can indicate to the planner if it should stop trying to plan.
- Warning
Using this function will replace anything that was given to interrupt_flag, and it will nullify the interrupt_flag() field.
-
const std::function<bool()> &
interrupter
() const¶ Get the interrupter that will be used in these Options.
Set an interrupt flag to stop this planner if it has run for too long.
- Warning
Using this function will replace anything that was given to interrupter.
-
const std::shared_ptr<const std::atomic_bool> &
interrupt_flag
() const¶ Get the interrupt flag that will stop this planner if it has run for too long.
-
Options &
maximum_cost_estimate
(std::optional<double> value)¶ Set the maximum cost estimate that the planner should allow. If the cost estimate of the best possible plan that the planner could produce ever exceeds this value, the planner will pause itself (but this will not be considered an interruption).
-
std::optional<double>
maximum_cost_estimate
() const¶ Get the maximum cost estimate that the planner will allow.
-
Options &
saturation_limit
(std::optional<std::size_t> value)¶ Set the saturation limit for the planner. If the planner produces more search nodes than this limit, then the planning will stop.
-
std::optional<std::size_t>
saturation_limit
() const¶ Get the saturation limit.
-
Options &
dependency_window
(std::optional<Duration> value)¶ Set the dependency window for generated plans. Any potential conflicts with the generated plan that happen within this window will be added as dependencies to the plan waypoints. If set to a nullopt, the plan will not have any dependencies.
-
std::optional<Duration>
dependency_window
() const¶ Dependency window for the planner.
-
Options &
dependency_resoution
(Duration value)¶ Set the dependency resolution for generated plans. To check for dependencies, the planner will step the generated routes back in time by this value and check for conflicts. Detected conflicts get added to the list of dependencies. This backstepping happens until dependency_window is reached. If dependency_window is nullopt, this value will not be used.
-
class
Result
¶ Public Functions
-
bool
success
() const¶ True if a plan was found and this Result can be dereferenced to obtain a plan.
-
bool
disconnected
() const¶ True if there is no feasible path that connects the start to the goal. In this case, a plan will never be found.
-
operator bool
() const¶ Implicitly cast the result to a boolean. It will return true if a plan was found, otherwise it will return false.
-
Result
replan
(const Start &new_start) const¶ Replan to the same goal from a new start location using the same options as before.
- Parameters
[in] new_start
: The starting conditions that should be used for replanning.
-
Result
replan
(const Start &new_start, Options new_options) const¶ Replan to the same goal from a new start location using a new set of options.
- Parameters
[in] new_start
: The starting conditions that should be used for replanning.[in] new_options
: The options that should be used for replanning.
-
Result
replan
(const StartSet &new_starts) const¶ Replan to the same goal from a new set of start locations using the same options.
- Parameters
[in] new_starts
: The set of starting conditions that should be used for replanning.
-
Result
replan
(const StartSet &new_starts, Options new_options) const¶ Replan to the same goal from a new set of start locations using a new set of options.
- Parameters
[in] new_starts
: The set of starting conditions that should be used for replanning.[in] new_options
: The options that should be used for replanning.
-
Result
setup
(const Start &new_start) const¶ Set up a new planning job to the same goal, but do not start iterating.
- See
replan(const Start&)
-
Result
setup
(const Start &new_start, Options new_options) const¶ Set up a new planning job to the same goal, but do not start iterating.
- See
replan(const Start&, Options)
-
Result
setup
(const StartSet &new_starts) const¶ Set up a new planning job to the same goal, but do not start iterating.
- See
replan(const StartSet&)
-
Result
setup
(const StartSet &new_starts, Options new_options) const¶ Set up a new planning job to the same goal, but do not start iterating.
- See
replan(const StartSet&, Options)
-
bool
resume
()¶ Resume planning if the planner was paused.
- Return
true if a plan has been found, false otherwise.
Resume planning if the planner was paused.
- Return
true if a plan has been found, false otherwise.
- Parameters
[in] interrupt_flag
: A new interrupt flag to listen to while planning.
-
std::optional<double>
cost_estimate
() const¶ Get the best cost estimate of the current state of this planner result. This is the value of the lowest f(n)=g(n)+h(n) in the planner’s queue. If the node queue of this planner result is empty, this will return a nullopt.
-
double
initial_cost_estimate
() const¶ Get the cost estimate that was initially computed for this plan. If no valid starts were provided, then this will return infinity.
-
std::optional<double>
ideal_cost
() const¶ Get the cost that this plan would have if there is no traffic. If the plan is impossible (e.g. the starts are disconnected from the goal) this will return a nullopt.
-
const std::vector<Start> &
get_starts
() const¶ Get the start conditions that were given for this planning task.
-
const Configuration &
get_configuration
() const¶ If this Plan is valid, this will return the Planner::Configuration that was used to produce it.
If replan() is called, this Planner::Configuration will be used to produce the new Plan.
-
bool
interrupted
() const¶ This will return true if the planning failed because it was interrupted. Otherwise it will return false.
-
bool
saturated
() const¶ This will return true if the planner has reached its saturation limit.
-
std::vector<schedule::ParticipantId>
blockers
() const¶ This is a list of schedule Participants who blocked the planning effort. Blockers do not necessarily prevent a solution from being found, but they do prevent the optimal solution from being available.
-
bool
-
class
Start
¶ Describe the starting conditions of a plan.
Public Functions
-
Start
(Time initial_time, std::size_t initial_waypoint, double initial_orientation, std::optional<Eigen::Vector2d> location = std::nullopt, std::optional<std::size_t> initial_lane = std::nullopt)¶ Constructor
- Parameters
[in] inital_time
: The starting time of the plan.[in] initial_waypoint
: The waypoint index that the plan will begin from.[in] initial_orientation
: The orientation that the AGV will start with.[in] initial_location
: Optional field to specify if the robot is not starting directly on the initial_waypoint location. When planning from this initial_location to the initial_waypoint the planner will assume it has an unconstrained lane.[in] initial_lane
: Optional field to specify if the robot is starting in a certain lane. This will only be used if an initial_location is specified.
-
std::size_t
waypoint
() const¶ Get the starting waypoint.
-
double
orientation
() const¶ Get the starting orientation.
-
const std::optional<Eigen::Vector2d> &
location
() const¶ Get the starting location, if one was specified.
-
Start &
location
(std::optional<Eigen::Vector2d> initial_location)¶ Set the starting location, or remove it by using std::nullopt.
-
const std::optional<std::size_t> &
lane
() const¶ Get the starting lane, if one was specified.
-
-
Class Planner::Configuration¶
Defined in File Planner.hpp
Nested Relationships¶
This class is a nested type of Class Planner.
Class Documentation¶
-
class
rmf_traffic::agv::Planner
::
Configuration
The Configuration class contains planning parameters that are immutable for each Planner instance.
These parameters generally describe the capabilities or behaviors of the AGV that is being planned for, so they shouldn’t need to change in between plans anyway.
Public Functions
-
Configuration
(Graph graph, VehicleTraits traits, Interpolate::Options interpolation = Interpolate::Options()) Constructor
- Parameters
[in] vehicle_traits
: The traits of the vehicle that is being planned for[in] graph
: The graph which is being planned over[in] interpolation
: The options for how the planner will perform trajectory interpolation
-
Configuration &
graph
(Graph graph) Set the graph to use for planning.
-
Graph &
graph
() Get a mutable reference to the graph.
-
const Graph &
graph
() const Get a const reference to the graph.
-
Configuration &
vehicle_traits
(VehicleTraits traits) Set the vehicle traits to use for planning.
-
VehicleTraits &
vehicle_traits
() Get a mutable reference to the vehicle traits.
-
const VehicleTraits &
vehicle_traits
() const Get a const reference to the vehicle traits.
-
Configuration &
interpolation
(Interpolate::Options interpolate) Set the interpolation options for the planner.
-
Interpolate::Options &
interpolation
() Get a mutable reference to the interpolation options.
-
const Interpolate::Options &
interpolation
() const Get a const reference to the interpolation options.
-
Configuration &
lane_closures
(LaneClosure closures) Set the lane closures for the graph. The planner will not attempt to expand down any lanes that are closed.
-
LaneClosure &
lane_closures
() Get a mutable reference to the LaneClosure setting.
-
const LaneClosure &
lane_closures
() const Get a const reference to the LaneClosure setting.
-
Configuration &
traversal_cost_per_meter
(double value) How much the cost should increase per meter travelled. Besides this, cost is measured by the number of seconds spent travelling.
-
double
traversal_cost_per_meter
() const Get the traversal cost.
-
Class Planner::Debug¶
Defined in File debug_Planner.hpp
Nested Relationships¶
This class is a nested type of Class Planner.
Class Documentation¶
-
class
rmf_traffic::agv::Planner
::
Debug
This class exists only for debugging purposes. It is not to be used in live production, and its API is to be considered unstable at all times. Any minor version increment
Public Types
-
using
ConstNodePtr
= std::shared_ptr<const Node>
Public Functions
-
Debug
(const Planner &planner) Create a debugger for a planner.
Public Static Functions
-
static std::size_t
queue_size
(const Planner::Result &result) Get the current size of the frontier queue of a Planner Result.
-
struct
Node
A Node in the planning search. A final Planning solution will be a chain of these Nodes, aggregated into a Plan data structure.
Public Types
-
using
SearchQueue
= std::priority_queue<ConstNodePtr, std::vector<ConstNodePtr>, Compare>
-
using
Vector
= std::vector<ConstNodePtr>
Public Members
-
ConstNodePtr
parent
The parent of this Node. If this is a nullptr, then this was a starting node.
-
double
remaining_cost_estimate
An estimate of the remaining cost, based on the heuristic.
-
double
current_cost
The actual cost that has accumulated on the way to this Node.
-
rmf_utils::optional<std::size_t>
waypoint
The waypoint that this Node stops on.
-
double
orientation
The orientation that this Node ends with.
-
rmf_utils::optional<std::size_t>
start_set_index
If this is a starting node, then this will be the index.
-
std::size_t
id
A unique ID that sticks with this node for its entire lifetime. This will also (roughly) reflect the order of node creation.
-
struct
Compare
Public Functions
-
inline bool
operator()
(const ConstNodePtr &a, const ConstNodePtr &b)
-
inline bool
-
using
-
class
Progress
Public Functions
-
rmf_utils::optional<Plan>
step
() Step the planner forward one time. This will expand the current highest priority Node in the queue and move it to the back of expanded_nodes. The nodes that result from the expansion will all be added to the queue.
-
inline
operator bool
() const Implicitly cast the Progress instance to a boolean. The value will be true if the plan can keep expanding, and it will be false if it cannot expand any further.
After finding a solution, it may be possible to continue expanding, but there is no point because the first solution returned is guaranteed to be the optimal one.
-
const Node::SearchQueue &
queue
() const A priority queue of unexpanded Nodes. They are sorted based on g(n)+h(n) in ascending order (see Node::Compare).
-
rmf_utils::optional<Plan>
-
using
Class Debug::Progress¶
Defined in File debug_Planner.hpp
Nested Relationships¶
This class is a nested type of Class Planner::Debug.
Class Documentation¶
-
class
rmf_traffic::agv::Planner::Debug
::
Progress
Public Functions
-
rmf_utils::optional<Plan>
step
() Step the planner forward one time. This will expand the current highest priority Node in the queue and move it to the back of expanded_nodes. The nodes that result from the expansion will all be added to the queue.
-
inline
operator bool
() const Implicitly cast the Progress instance to a boolean. The value will be true if the plan can keep expanding, and it will be false if it cannot expand any further.
After finding a solution, it may be possible to continue expanding, but there is no point because the first solution returned is guaranteed to be the optimal one.
-
const Node::SearchQueue &
queue
() const A priority queue of unexpanded Nodes. They are sorted based on g(n)+h(n) in ascending order (see Node::Compare).
-
rmf_utils::optional<Plan>
Class Planner::Goal¶
Defined in File Planner.hpp
Nested Relationships¶
This class is a nested type of Class Planner.
Class Documentation¶
-
class
rmf_traffic::agv::Planner
::
Goal
Describe the goal conditions of a plan.
Public Functions
-
Goal
(std::size_t goal_waypoint) Constructor
- Note
With this constructor, any final orientation will be accepted.
- Parameters
[in] goal_waypoint
: The waypoint that the AGV needs to reach.
-
Goal
(std::size_t goal_waypoint, double goal_orientation) Constructor
- Parameters
[in] goal_waypoint
: The waypoint that the AGV needs to reach.[in] goal_orientation
: The orientation that the AGV needs to end with.
-
Goal
(std::size_t goal_waypoint, std::optional<rmf_traffic::Time> minimum_time, std::optional<double> goal_orientation = std::nullopt) Constructor
- Parameters
[in] goal_waypoint
: The waypoint that the AGV needs to reach.[in] minimum_time
: The AGV must be on the goal waypoint at or after this time for the plan to be successful. This is useful if a robot needs to wait at a location, but you want it to give way for other robots.[in] goal_orientation
: An optional goal orientation that the AGV needs to end with.
-
Goal &
waypoint
(std::size_t goal_waypoint) Set the goal waypoint.
-
std::size_t
waypoint
() const Get the goal waypoint.
-
Goal &
orientation
(double goal_orientation) Set the goal orientation.
-
Goal &
any_orientation
() Accept any orientation for the final goal.
-
const double *
orientation
() const Get a reference to the goal orientation (or a nullptr if any orientation is acceptable).
-
Goal &
minimum_time
(std::optional<rmf_traffic::Time> value) Set the minimum time for the goal. Pass in a nullopt to remove the minimum time.
-
std::optional<rmf_traffic::Time>
minimum_time
() const Get the minimum time for the goal (or a nullopt is there is no minimum time).
-
Class Planner::Options¶
Defined in File Planner.hpp
Nested Relationships¶
This class is a nested type of Class Planner.
Class Documentation¶
-
class
rmf_traffic::agv::Planner
::
Options
The Options class contains planning parameters that can change between each planning attempt.
Public Functions
Constructor
- Parameters
[in] validator
: A validator to check the validity of the planner’s branching options.[in] min_hold_time
: The minimum amount of time that the planner should spend waiting at holding points. Smaller values will make the plan more aggressive about being time-optimal, but the plan may take longer to produce. Larger values will add some latency to the execution of the plan as the robot may wait at a holding point longer than necessary, but the plan will usually be generated more quickly.[in] interrupt_flag
: A pointer to a flag that should be used to interrupt the planner if it has been running for too long. If the planner should run indefinitely, then pass in a nullptr.[in] maximum_cost_estimate
: A cap on how high the best possible solution’s cost can be. If the cost of the best possible solution ever exceeds this value, then the planner will interrupt itself, no matter what the state of the interrupt_flag is. Set this to nullopt to specify that there should not be a cap.[in] saturation_limit
: A cap on how many search nodes the planner is allowed to produce.
-
Options
(rmf_utils::clone_ptr<RouteValidator> validator, Duration min_hold_time, std::function<bool()> interrupterstd::optional<double> maximum_cost_estimate = std::nullopt, std::optional<std::size_t> saturation_limit = std::nullopt, ) Constructor
- Parameters
[in] validator
: A validator to check the validity of the planner’s branching options.[in] validator
: A validator to check the validity of the planner’s branching options.[in] min_hold_time
: The minimum amount of time that the planner should spend waiting at holding points. Smaller values will make the plan more aggressive about being time-optimal, but the plan may take longer to produce. Larger values will add some latency to the execution of the plan as the robot may wait at a holding point longer than necessary, but the plan will usually be generated more quickly.[in] interrupter
: A function that can determine whether the planning should be interrupted. This is an alternative to using the interrupt_flag.[in] maximum_cost_estimate
: A cap on how high the best possible solution’s cost can be. If the cost of the best possible solution ever exceeds this value, then the planner will interrupt itself, no matter what the state of the interrupt_flag is. Set this to nullopt to specify that there should not be a cap.[in] saturation_limit
: A cap on how many search nodes the planner is allowed to produce.
-
Options &
validator
(rmf_utils::clone_ptr<RouteValidator> v) Set the route validator.
-
const rmf_utils::clone_ptr<RouteValidator> &
validator
() const Get the route validator.
-
Options &
minimum_holding_time
(Duration holding_time) Set the minimum amount of time to spend waiting at holding points.
-
Duration
minimum_holding_time
() const Get the minimum amount of time to spend waiting at holding points.
-
Options &
interrupter
(std::function<bool()> cb) Set an interrupter callback that can indicate to the planner if it should stop trying to plan.
- Warning
Using this function will replace anything that was given to interrupt_flag, and it will nullify the interrupt_flag() field.
-
const std::function<bool()> &
interrupter
() const Get the interrupter that will be used in these Options.
Set an interrupt flag to stop this planner if it has run for too long.
- Warning
Using this function will replace anything that was given to interrupter.
-
const std::shared_ptr<const std::atomic_bool> &
interrupt_flag
() const Get the interrupt flag that will stop this planner if it has run for too long.
-
Options &
maximum_cost_estimate
(std::optional<double> value) Set the maximum cost estimate that the planner should allow. If the cost estimate of the best possible plan that the planner could produce ever exceeds this value, the planner will pause itself (but this will not be considered an interruption).
-
std::optional<double>
maximum_cost_estimate
() const Get the maximum cost estimate that the planner will allow.
-
Options &
saturation_limit
(std::optional<std::size_t> value) Set the saturation limit for the planner. If the planner produces more search nodes than this limit, then the planning will stop.
-
std::optional<std::size_t>
saturation_limit
() const Get the saturation limit.
-
Options &
dependency_window
(std::optional<Duration> value) Set the dependency window for generated plans. Any potential conflicts with the generated plan that happen within this window will be added as dependencies to the plan waypoints. If set to a nullopt, the plan will not have any dependencies.
-
std::optional<Duration>
dependency_window
() const Dependency window for the planner.
-
Options &
dependency_resoution
(Duration value) Set the dependency resolution for generated plans. To check for dependencies, the planner will step the generated routes back in time by this value and check for conflicts. Detected conflicts get added to the list of dependencies. This backstepping happens until dependency_window is reached. If dependency_window is nullopt, this value will not be used.
-
Duration
dependency_resolution
() const Get the dependency resolution for generated plans.
Public Static Attributes
-
static constexpr Duration
DefaultMinHoldingTime
= std::chrono::seconds(1)
Class Planner::Result¶
Defined in File Planner.hpp
Nested Relationships¶
This class is a nested type of Class Planner.
Class Documentation¶
-
class
rmf_traffic::agv::Planner
::
Result
Public Functions
-
bool
success
() const True if a plan was found and this Result can be dereferenced to obtain a plan.
-
bool
disconnected
() const True if there is no feasible path that connects the start to the goal. In this case, a plan will never be found.
-
operator bool
() const Implicitly cast the result to a boolean. It will return true if a plan was found, otherwise it will return false.
-
Result
replan
(const Start &new_start) const Replan to the same goal from a new start location using the same options as before.
- Parameters
[in] new_start
: The starting conditions that should be used for replanning.
-
Result
replan
(const Start &new_start, Options new_options) const Replan to the same goal from a new start location using a new set of options.
- Parameters
[in] new_start
: The starting conditions that should be used for replanning.[in] new_options
: The options that should be used for replanning.
-
Result
replan
(const StartSet &new_starts) const Replan to the same goal from a new set of start locations using the same options.
- Parameters
[in] new_starts
: The set of starting conditions that should be used for replanning.
-
Result
replan
(const StartSet &new_starts, Options new_options) const Replan to the same goal from a new set of start locations using a new set of options.
- Parameters
[in] new_starts
: The set of starting conditions that should be used for replanning.[in] new_options
: The options that should be used for replanning.
-
Result
setup
(const Start &new_start) const Set up a new planning job to the same goal, but do not start iterating.
- See
replan(const Start&)
-
Result
setup
(const Start &new_start, Options new_options) const Set up a new planning job to the same goal, but do not start iterating.
- See
replan(const Start&, Options)
-
Result
setup
(const StartSet &new_starts) const Set up a new planning job to the same goal, but do not start iterating.
- See
replan(const StartSet&)
-
Result
setup
(const StartSet &new_starts, Options new_options) const Set up a new planning job to the same goal, but do not start iterating.
- See
replan(const StartSet&, Options)
-
bool
resume
() Resume planning if the planner was paused.
- Return
true if a plan has been found, false otherwise.
Resume planning if the planner was paused.
- Return
true if a plan has been found, false otherwise.
- Parameters
[in] interrupt_flag
: A new interrupt flag to listen to while planning.
-
Options &
options
() Get a mutable reference to the options that will be used by this planning task.
-
const Options &
options
() const Get the options that will be used by this planning task.
-
std::optional<double>
cost_estimate
() const Get the best cost estimate of the current state of this planner result. This is the value of the lowest f(n)=g(n)+h(n) in the planner’s queue. If the node queue of this planner result is empty, this will return a nullopt.
-
double
initial_cost_estimate
() const Get the cost estimate that was initially computed for this plan. If no valid starts were provided, then this will return infinity.
-
std::optional<double>
ideal_cost
() const Get the cost that this plan would have if there is no traffic. If the plan is impossible (e.g. the starts are disconnected from the goal) this will return a nullopt.
-
const std::vector<Start> &
get_starts
() const Get the start conditions that were given for this planning task.
-
const Goal &
get_goal
() const Get the goal for this planning task.
-
const Configuration &
get_configuration
() const If this Plan is valid, this will return the Planner::Configuration that was used to produce it.
If replan() is called, this Planner::Configuration will be used to produce the new Plan.
-
bool
interrupted
() const This will return true if the planning failed because it was interrupted. Otherwise it will return false.
-
bool
saturated
() const This will return true if the planner has reached its saturation limit.
-
std::vector<schedule::ParticipantId>
blockers
() const This is a list of schedule Participants who blocked the planning effort. Blockers do not necessarily prevent a solution from being found, but they do prevent the optimal solution from being available.
-
bool
Class Planner::Start¶
Defined in File Planner.hpp
Nested Relationships¶
This class is a nested type of Class Planner.
Class Documentation¶
-
class
rmf_traffic::agv::Planner
::
Start
Describe the starting conditions of a plan.
Public Functions
-
Start
(Time initial_time, std::size_t initial_waypoint, double initial_orientation, std::optional<Eigen::Vector2d> location = std::nullopt, std::optional<std::size_t> initial_lane = std::nullopt) Constructor
- Parameters
[in] inital_time
: The starting time of the plan.[in] initial_waypoint
: The waypoint index that the plan will begin from.[in] initial_orientation
: The orientation that the AGV will start with.[in] initial_location
: Optional field to specify if the robot is not starting directly on the initial_waypoint location. When planning from this initial_location to the initial_waypoint the planner will assume it has an unconstrained lane.[in] initial_lane
: Optional field to specify if the robot is starting in a certain lane. This will only be used if an initial_location is specified.
-
Time
time
() const Get the starting time.
-
Start &
waypoint
(std::size_t initial_waypoint) Set the starting waypoint of a plan.
-
std::size_t
waypoint
() const Get the starting waypoint.
-
Start &
orientation
(double initial_orientation) Set the starting orientation of a plan.
-
double
orientation
() const Get the starting orientation.
-
const std::optional<Eigen::Vector2d> &
location
() const Get the starting location, if one was specified.
-
Start &
location
(std::optional<Eigen::Vector2d> initial_location) Set the starting location, or remove it by using std::nullopt.
-
const std::optional<std::size_t> &
lane
() const Get the starting lane, if one was specified.
-
Start &
lane
(std::optional<std::size_t> initial_lane) Set the starting lane, or remove it by using std::nullopt.
-
Class Rollout¶
Defined in File Rollout.hpp
Class Documentation¶
-
class
rmf_traffic::agv
::
Rollout
¶ The Rollout class complements the Planner class. The Planner class may sometimes fail to find a feasible plan because of other traffic participants blocking the way. The rollout class can take a Planner::Result and expand sets of alternative routes that would be feasible in the absence of a blocker. Given these sets of alternatives,
Public Functions
-
Rollout
(Planner::Result result)¶ Constructor
- Parameters
[in] result
: The Planning Result that should be rolled out.
-
std::vector<schedule::Itinerary>
expand
(schedule::ParticipantId blocker, rmf_traffic::Duration span, const Planner::Options &options, rmf_utils::optional<std::size_t> max_rollouts = rmf_utils::nullopt) const¶ Expand the Planning Result through the specified blocker.
- Return
a collection of itineraries from the original Planning Result’s starts past the blockages that were caused by the specified blocker.
- Parameters
[in] blocker
: The blocking participant that should be expanded through. If this participant wasn’t actually blocking, then the returned vector will be empty.[in] span
: How far into the future the rollout should continue. Once a rollout extends this far, it will stop wherever it is.[in] options
: The options to use while expanding. NOTE: It is important to provide a RouteValidator that will ignore the blocker, otherwise the expansion might not give back any useful results.[in] max_rollouts
: The maximum number of rollouts to produce.
-
std::vector<schedule::Itinerary>
expand
(schedule::ParticipantId blocker, rmf_traffic::Duration span, rmf_utils::optional<std::size_t> max_rollouts = rmf_utils::nullopt) const¶ Expand the Planning Result through the specified behavior. Use the Options that are already tied to the Planning Result.
- Warning
It is critical to change the validator in the Planner Result Options before giving it to the Rollout if you want to use this method. Otherwise there will not be any expansion through the blocker.
- Return
a collection of itineraries from the original Planning Result’s starts past the blockages that were caused by the specified blocker.
- Parameters
[in] blocker
: The blocking participant that should be expanded through. If this participant wasn’t actually blocking, then the returned vector will be empty.[in] span
: How far into the future the rollout should continue. Once a rollout extends this far, it will stop wherever it is.[in] max_rollouts
: The maximum number of rollouts to produce.
-
Class RouteValidator¶
Defined in File RouteValidator.hpp
Nested Relationships¶
Inheritance Relationships¶
public rmf_traffic::agv::NegotiatingRouteValidator
(Class NegotiatingRouteValidator)public rmf_traffic::agv::ScheduleRouteValidator
(Class ScheduleRouteValidator)
Class Documentation¶
-
class
rmf_traffic::agv
::
RouteValidator
¶ The RouteValidator class provides an interface for identifying whether a given route can be considered valid.
Subclassed by rmf_traffic::agv::NegotiatingRouteValidator, rmf_traffic::agv::ScheduleRouteValidator
Public Functions
-
virtual std::optional<Conflict>
find_conflict
(const Route &route) const = 0¶ If the specified route has a conflict with another participant, this will return the participant ID for the first conflict that gets identified. Otherwise it will return a nullopt.
- Parameters
[in] route
: The route that is being checked.
-
virtual std::unique_ptr<RouteValidator>
clone
() const = 0¶ Create a clone of the underlying RouteValidator object.
-
virtual
~RouteValidator
() = default¶
-
struct
Conflict
¶
-
virtual std::optional<Conflict>
Class ScheduleRouteValidator¶
Defined in File RouteValidator.hpp
Inheritance Relationships¶
public rmf_traffic::agv::RouteValidator
(Class RouteValidator)
Class Documentation¶
-
class
rmf_traffic::agv
::
ScheduleRouteValidator
: public rmf_traffic::agv::RouteValidator¶ Public Functions
-
ScheduleRouteValidator
(const schedule::Viewer &viewer, schedule::ParticipantId participant_id, Profile profile)¶ Constructor
- Warning
You are expected to maintain the lifetime of the schedule viewer for as long as this ScheduleRouteValidator instance is alive. This object will only retain a reference to the viewer, not a copy of it.
- Parameters
[in] viewer
: The schedule viewer which will be used to check for conflicts[in] participant
: The ID of the participant whose route is being validated. Any routes for this participant on the schedule will be ignored while validating.[in] profile
: The profile for the participant. This is not inferred from the viewer because the viewer might not be synced with the schedule by the time this validator is being used.
Constructor
This constructor will use the profile given to it for the participant that is being planned for. This is safe to use, even if the participant is not registered in the schedule yet.
- Parameters
[in] viewer
: The schedule viewer which will be used ot check for conflicts. The reference to the viewer will be kept alive.[in] participant_id
: The ID for the participant that is being validated.[in] profile
: The profile for the participant.
-
ScheduleRouteValidator &
schedule_viewer
(const schedule::Viewer &viewer)¶ Change the schedule viewer to use for planning.
- Warning
The Options instance will store a reference to the viewer; it will not store a copy. Therefore you are responsible for keeping the schedule viewer alive while this Options class is being used.
-
const schedule::Viewer &
schedule_viewer
() const¶ Get a const reference to the schedule viewer that will be used for planning. It is undefined behavior to call this function is called after the schedule viewer has been destroyed.
-
ScheduleRouteValidator &
participant
(schedule::ParticipantId p)¶ Set the ID of the participant that is being validated.
-
schedule::ParticipantId
participant
() const¶ Get the ID of the participant that is being validated.
-
virtual std::optional<Conflict>
find_conflict
(const Route &route) const final¶ If the specified route has a conflict with another participant, this will return the participant ID for the first conflict that gets identified. Otherwise it will return a nullopt.
- Parameters
[in] route
: The route that is being checked.
-
virtual std::unique_ptr<RouteValidator>
clone
() const final¶ Create a clone of the underlying RouteValidator object.
Public Static Functions
-
template<typename ...
Args
>
static inline rmf_utils::clone_ptr<ScheduleRouteValidator>make
(Args&&... args)¶ Make the ScheduleRouteValidator as a clone_ptr.
-
Class SimpleNegotiator¶
Defined in File SimpleNegotiator.hpp
Nested Relationships¶
Inheritance Relationships¶
public rmf_traffic::schedule::Negotiator
(Class Negotiator)
Class Documentation¶
-
class
rmf_traffic::agv
::
SimpleNegotiator
: public rmf_traffic::schedule::Negotiator¶ A simple implementation of the schedule::Negotiator class. It uses an agv::Planner to try to find a solution that fits on the negotiation table.
Public Functions
-
SimpleNegotiator
(schedule::Participant::AssignIDPtr assign_id, Planner::Start start, Planner::Goal goal, Planner::Configuration planner_configuration, Options options = Options())¶ Constructor
- Parameters
[in] assign_id
: The ID assignment tool for the participant[in] start
: The desired start for the plan.[in] goal
: The desired goal for the plan.[in] planner_configuration
: The configuration that will be used by the planner underlying this Negotiator.[in] options
: Additional options that will be used by the Negotiator.
-
SimpleNegotiator
(schedule::Participant::AssignIDPtr assign_id, std::vector<Planner::Start> starts, Planner::Goal goal, Planner::Configuration planner_configuration, Options options = Options())¶ Constructor
- Parameters
[in] assign_id
: The ID assignment tool for the participant[in] start
: A set of starts that can be used.[in] goal
: The desired goal for the plan.[in] planner_configuration
: The configuration that will be used by the planner underlying this Negotiator.[in] options
: Additional options that will be used by the Negotiator.
Constructor
- Parameters
[in] assign_id
: The ID assignment tool for the participant[in] starts
: A set of starts that can be used.[in] goal
: The desired goal for the plan.[in] planner
: The planner to use[in] options
: Additional options that will be used by the negotiator
-
virtual void
respond
(const schedule::Negotiation::Table::ViewerPtr &table_viewer, const ResponderPtr &responder) final¶ Have the Negotiator respond to an attempt to negotiate.
- Parameters
[in] table
: The Negotiation::Table that is being used for the negotiation.[in] responder
: The Responder instance that the negotiator should use when a response is ready.[in] interrupt_flag
: A pointer to a flag that can be used to interrupt the negotiator if it has been running for too long. If the planner should run indefinitely, then pass a nullptr.
-
class
Debug
¶ Public Static Functions
-
static SimpleNegotiator &
enable_debug_print
(SimpleNegotiator &negotiator)¶
-
static SimpleNegotiator &
-
class
Options
¶ A class to specify user-defined options for the Negotiator.
Public Types
Public Functions
Constructor
- Parameters
[in] approval_cb
: The callback that will be triggered if the proposal is approved.[in] maximum_cost_leeway
: The initial cost estimate for each planning attempt will be multiplied by this factor to determine the maximum cost estimate that will be allowed for a plan before giving up.[in] maximum_alts
: The maximum number of alternatives to produce when rejecting a proposal from another negotiator.[in] min_hold_time
: The minimum amount of time that the planner should spend waiting at holding points. See Planner::Options for more information.
-
Options &
approval_callback
(ApprovalCallback cb)¶ Set the approval callback.
Set the interrupt flag.
-
const std::shared_ptr<const bool> &
interrupt_flag
() const¶ Get the interrupt flag.
-
std::optional<double>
maximum_cost_leeway
() const¶ Get the maximum cost leeway.
-
Options &
minimum_cost_threshold
(std::optional<double> cost)¶ Set the minimum cost threshold. When this and maximum_cost_leeway are both set, the maximum cost estimate will be chosen by std::max( minimum_cost_threshold, initial_cost_estimate * maximum_cost_leeway )
By default, this is DefaultMinCostThreshold.
-
std::optional<double>
minimum_cost_threshold
() const¶ Get the minimum cost threshold.
-
Options &
maximum_cost_threshold
(std::optional<double> cost)¶ Set the maximum cost threshold. When this is set, the cost will not be allowed to exceed it, even if the maximum cost leeway would allow it. By default, this is nullopt.
-
std::optional<double>
maximum_cost_threshold
() const¶ Get the maximum cost threshold.
-
std::optional<std::size_t>
maximum_alternatives
() const¶
-
Class SimpleNegotiator::Debug¶
Defined in File debug_Negotiator.hpp
Nested Relationships¶
This class is a nested type of Class SimpleNegotiator.
Class Documentation¶
-
class
rmf_traffic::agv::SimpleNegotiator
::
Debug
Public Static Functions
-
static SimpleNegotiator &
enable_debug_print
(SimpleNegotiator &negotiator)
-
static SimpleNegotiator &
Class SimpleNegotiator::Options¶
Defined in File SimpleNegotiator.hpp
Nested Relationships¶
This class is a nested type of Class SimpleNegotiator.
Class Documentation¶
-
class
rmf_traffic::agv::SimpleNegotiator
::
Options
A class to specify user-defined options for the Negotiator.
Public Types
-
using
ApprovalCallback
= std::function<Responder::UpdateVersion(rmf_traffic::agv::Plan)>
Public Functions
Constructor
- Parameters
[in] approval_cb
: The callback that will be triggered if the proposal is approved.[in] maximum_cost_leeway
: The initial cost estimate for each planning attempt will be multiplied by this factor to determine the maximum cost estimate that will be allowed for a plan before giving up.[in] maximum_alts
: The maximum number of alternatives to produce when rejecting a proposal from another negotiator.[in] min_hold_time
: The minimum amount of time that the planner should spend waiting at holding points. See Planner::Options for more information.
-
Options &
approval_callback
(ApprovalCallback cb) Set the approval callback.
Set the interrupt flag.
-
const std::shared_ptr<const bool> &
interrupt_flag
() const Get the interrupt flag.
-
Options &
maximum_cost_leeway
(std::optional<double> leeway) Set the maximum cost leeway.
-
std::optional<double>
maximum_cost_leeway
() const Get the maximum cost leeway.
-
Options &
minimum_cost_threshold
(std::optional<double> cost) Set the minimum cost threshold. When this and maximum_cost_leeway are both set, the maximum cost estimate will be chosen by std::max( minimum_cost_threshold, initial_cost_estimate * maximum_cost_leeway )
By default, this is DefaultMinCostThreshold.
-
std::optional<double>
minimum_cost_threshold
() const Get the minimum cost threshold.
-
Options &
maximum_cost_threshold
(std::optional<double> cost) Set the maximum cost threshold. When this is set, the cost will not be allowed to exceed it, even if the maximum cost leeway would allow it. By default, this is nullopt.
-
std::optional<double>
maximum_cost_threshold
() const Get the maximum cost threshold.
-
Options &
maximum_alternatives
(rmf_utils::optional<std::size_t> num)
-
std::optional<std::size_t>
maximum_alternatives
() const
-
Options &
minimum_holding_time
(Duration holding_time) Set the minimum amount of time to spend waiting at holding points.
-
Duration
minimum_holding_time
() const Get the minimum amount of time to spend waiting at holding points.
Public Static Attributes
-
static constexpr double
DefaultMaxCostLeeway
= 1.5
-
static constexpr double
DefaultMinCostThreshold
= 30.0
-
using
Class VehicleTraits¶
Defined in File VehicleTraits.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic::agv
::
VehicleTraits
¶ Public Types
Public Functions
-
VehicleTraits
(Limits linear, Limits angular, Profile profile, Differential steering = Differential())¶ Constructor.
-
Differential &
set_differential
(Differential parameters = Differential())¶
-
Differential *
get_differential
()¶
-
const Differential *
get_differential
() const¶
-
bool
valid
() const¶ Returns true if the values of the traits are valid. For example, this means that all velocity and acceleration values are greater than zero.
-
class
Differential
Public Functions
-
Differential
(Eigen::Vector2d forward = Eigen::Vector2d::UnitX(), bool reversible = true)¶
-
Differential &
set_forward
(Eigen::Vector2d forward)¶
-
const Eigen::Vector2d &
get_forward
() const¶
-
Differential &
set_reversible
(bool reversible)¶
-
bool
is_reversible
() const¶
-
bool
valid
() const¶ Returns true if the length of the forward vector is not too close to zero. If it is too close to zero, then the direction of the forward vector cannot be reliably interpreted. Ideally the forward vector should have unit length.
-
-
class
Holonomic
Public Functions
-
Holonomic
()¶
-
-
class
Limits
¶
-
Class VehicleTraits::Differential¶
Defined in File VehicleTraits.hpp
Nested Relationships¶
This class is a nested type of Class VehicleTraits.
Class Documentation¶
-
class
rmf_traffic::agv::VehicleTraits
::
Differential
Public Functions
-
Differential
(Eigen::Vector2d forward = Eigen::Vector2d::UnitX(), bool reversible = true)
-
Differential &
set_forward
(Eigen::Vector2d forward)
-
const Eigen::Vector2d &
get_forward
() const
-
Differential &
set_reversible
(bool reversible)
-
bool
is_reversible
() const
-
bool
valid
() const Returns true if the length of the forward vector is not too close to zero. If it is too close to zero, then the direction of the forward vector cannot be reliably interpreted. Ideally the forward vector should have unit length.
-
Class VehicleTraits::Holonomic¶
Defined in File VehicleTraits.hpp
Nested Relationships¶
This class is a nested type of Class VehicleTraits.
Class Documentation¶
-
class
rmf_traffic::agv::VehicleTraits
::
Holonomic
Public Functions
-
Holonomic
()
-
Class VehicleTraits::Limits¶
Defined in File VehicleTraits.hpp
Nested Relationships¶
This class is a nested type of Class VehicleTraits.
Class Documentation¶
-
class
rmf_traffic::agv::VehicleTraits
::
Limits
Public Functions
-
Limits
(double velocity = 0.0, double acceleration = 0.0)
-
Limits &
set_nominal_velocity
(double nom_vel)
-
double
get_nominal_velocity
() const
-
Limits &
set_nominal_acceleration
(double nom_accel)
-
double
get_nominal_acceleration
() const
-
bool
valid
() const Returns true if the values of these limits are valid, i.e. greater than zero.
-
Class Moderator¶
Defined in File Moderator.hpp
Nested Relationships¶
Inheritance Relationships¶
public rmf_traffic::blockade::Writer
(Class Writer)
Class Documentation¶
-
class
rmf_traffic::blockade
::
Moderator
: public rmf_traffic::blockade::Writer¶ Public Functions
-
virtual void
set
(ParticipantId participant_id, ReservationId reservation_id, const Reservation &reservation) final¶ Set the path reservation of a participant.
If reservation_id is (modularly) less than or equal to the last reservation_id value given for this participant_id, then this function call will be ignored.
Any previous path reservation will be considered canceled.
-
virtual void
ready
(ParticipantId participant_id, ReservationId reservation_id, CheckpointId checkpoint) final¶ Indicate when a participant is ready at a checkpoint.
If reservation_id is not equal to the last reservation_id value given to set() for this participant_id, then this function call will be ignored.
-
virtual void
release
(ParticipantId participant_id, ReservationId reservation_id, CheckpointId checkpoint) final¶ Release a checkpoint (and all checkpoints that come after it) from ready status if the participant has not departed from it yet.
-
virtual void
reached
(ParticipantId participant_id, ReservationId reservation_id, CheckpointId checkpoint) final¶ Indicate when a participant has reached a checkpoint.
If reservation_id is not equal to the last reservation_id value given to set() for this participant_id, then this function call will be ignored.
-
virtual void
cancel
(ParticipantId participant_id, ReservationId reservation_id) final¶ Indicate that a path reservation is canceled if reservation_id is (modularly) greater than or equal to the last reservation_id value given to set() for this participant_id.
-
virtual void
cancel
(ParticipantId participant_id) final¶ Indicate that all path reservations for this participant_id are canceled.
-
Moderator
(std::function<void(std::string)> info_logger = nullptr, std::function<void(std::string)> debug_logger = nullptr, double min_conflict_angle = 5.0 * M_PI / 180.0, )¶ Default constructor
- Parameters
[in] info_logger
: Provide a callback for logging informational updates about changes in the blockades, e.g. when a new path arrives, when a checkpoint is reached, or when one is ready.[in] debug_logger
: Provide a callback for logging debugging information, e.g. which constraints are blocking a participant from advancing.[in] min_conflict_angle
: If the angle between two path segments is greater than this value (radians), then the segments are considered to be in conflict. The default value for this parameter is 5-degrees. Something larger than 0 is recommended to help deal with numerical precision concerns.
-
double
minimum_conflict_angle
() const¶ Get the minimum angle that will trigger a conflict.
-
Moderator &
minimum_conflict_angle
(double new_value)¶ Set the minimum angle that will trigger a conflict.
-
Moderator &
info_logger
(std::function<void(std::string)> info)¶ Set the information logger for this Moderator. Pass in a nullptr to disable any information logging.
-
Moderator &
debug_logger
(std::function<void(std::string)> debug)¶ Set the debug logger for this Moderator. Pass in a nullptr to disable any debug logging.
-
const Assignments &
assignments
() const¶ Get the current set of assignments.
-
const std::unordered_map<ParticipantId, Status> &
statuses
() const¶ Get the current known statuses of each participant.
-
bool
has_gridlock
() const¶ Return true if the system is experiencing a gridlock.
-
class
Assignments
¶ This class indicates the range of each reservation that the blockade moderator has assigned as active. Each robot is allowed to move at will from the begin checkpoint to the end checkpoint in the range assigned for it.
Public Functions
-
std::size_t
version
() const¶ Get the version of the current assignment sets. The version number will increase by at least 1 each time the assignments change. This can be used to identify when new assignment notifications are necessary.
-
const std::unordered_map<ParticipantId, ReservedRange> &
ranges
() const¶ Get the ranges that are assigned to each participant.
-
std::size_t
-
virtual void
Class Moderator::Assignments¶
Defined in File Moderator.hpp
Nested Relationships¶
This class is a nested type of Class Moderator.
Class Documentation¶
-
class
rmf_traffic::blockade::Moderator
::
Assignments
This class indicates the range of each reservation that the blockade moderator has assigned as active. Each robot is allowed to move at will from the begin checkpoint to the end checkpoint in the range assigned for it.
Public Functions
-
std::size_t
version
() const Get the version of the current assignment sets. The version number will increase by at least 1 each time the assignments change. This can be used to identify when new assignment notifications are necessary.
-
const std::unordered_map<ParticipantId, ReservedRange> &
ranges
() const Get the ranges that are assigned to each participant.
-
std::size_t
Class ModeratorRectificationRequesterFactory¶
Defined in File Rectifier.hpp
Inheritance Relationships¶
public rmf_traffic::blockade::RectificationRequesterFactory
(Class RectificationRequesterFactory)
Class Documentation¶
-
class
rmf_traffic::blockade
::
ModeratorRectificationRequesterFactory
: public rmf_traffic::blockade::RectificationRequesterFactory¶ This class provides a simple implementation of a RectificationRequesterFactory that just hooks directly into a Moderator instance and issues rectification requests when told to based on the current inconsistencies in the Database.
Public Functions
Constructor
- Parameters
[in] moderator
: The moderator object that this will rectify for.
-
virtual std::unique_ptr<RectificationRequester>
make
(Rectifier rectifier, ParticipantId participant_id) final¶ Create a RectificationRequester to be held by a Participant
- Parameters
[in] rectifier
: This rectifier can be used by the RectificationRequester to ask the participant to check its status.[in] participant_id
: The ID of the participant that will hold onto this RectificationRequester. This is the same participant that the rectifier will request for checks.
-
void
rectify
()¶ Call this function to instruct all the RectificationRequesters produced by this factory to perform their rectifications.
Class Participant¶
Defined in File Participant.hpp
Class Documentation¶
-
class
rmf_traffic::blockade
::
Participant
¶ Public Functions
-
void
radius
(double new_radius)¶ Change the radius for this participant. This will only take effect when a new path is set using the set() function.
-
double
radius
() const¶ Get the radius that’s being used for this participant.
-
void
set
(std::vector<Writer::Checkpoint> path)¶ Set the path for this participant.
- Parameters
[in] path
: The path that this participant intends to follow.
-
const std::vector<Writer::Checkpoint> &
path
() const¶ Get the current path for this participant.
-
void
ready
(CheckpointId checkpoint)¶ Tell the blockade writer that the participant is ready to depart from the given checkpoint.
-
void
release
(CheckpointId checkpoint)¶ Tell the blockade writer that the participant is releasing its departure from the given checkpoint.
-
std::optional<CheckpointId>
last_ready
() const¶ Get the last checkpoint that this participant said it is ready to depart from.
-
void
reached
(CheckpointId checkpoint)¶ Tell the blockade writer that the participant has reached the given checkpoint.
-
void
cancel
()¶ Cancel the current path entirely. Note that if a path is canceled while the robot is in space that it needs to share with other robots, a permanent deadlock could result.
-
CheckpointId
last_reached
() const¶ Get the last checkpoint that this participant said it has reached.
-
ParticipantId
id
() const¶ Get the ID that was assigned to this participant.
-
std::optional<ReservationId>
reservation_id
() const¶ Get the current reservation ID.
-
void
Class RectificationRequester¶
Defined in File Rectifier.hpp
Class Documentation¶
-
class
rmf_traffic::blockade
::
RectificationRequester
¶ RectificationRequester is a pure abstract class which should be implemented for any middlewares that intend to act as transport layers for the scheduling system.
Classes that derive from RectificationRequester do not need to implement any interfaces, but they should practice RAII. The lifecycle of the RectificationRequester will be tied to the Participant that it was created for.
When a schedule database reports an inconsistency for the participant tied to a RectificationRequester instance, the instance should call Rectifier::check() on the Rectifier that was assigned to it.
Public Functions
-
virtual
~RectificationRequester
() = 0¶ This destructor is pure virtual to ensure that a derived class is instantiated.
-
virtual
Class RectificationRequesterFactory¶
Defined in File Rectifier.hpp
Inheritance Relationships¶
public rmf_traffic::blockade::ModeratorRectificationRequesterFactory
(Class ModeratorRectificationRequesterFactory)
Class Documentation¶
-
class
rmf_traffic::blockade
::
RectificationRequesterFactory
¶ The RectificationRequesterFactory is a pure abstract interface class which should be implemented for any middlewares that intend to act as transport layers for the blockade system.
Subclassed by rmf_traffic::blockade::ModeratorRectificationRequesterFactory
Public Functions
-
virtual std::unique_ptr<RectificationRequester>
make
(Rectifier rectifier, ParticipantId participant_id) = 0¶ Create a RectificationRequester to be held by a Participant
- Parameters
[in] rectifier
: This rectifier can be used by the RectificationRequester to ask the participant to check its status.[in] participant_id
: The ID of the participant that will hold onto this RectificationRequester. This is the same participant that the rectifier will request for checks.
-
virtual
~RectificationRequesterFactory
() = default¶
-
virtual std::unique_ptr<RectificationRequester>
Class Rectifier¶
Defined in File Rectifier.hpp
Class Documentation¶
-
class
rmf_traffic::blockade
::
Rectifier
¶ The Rectifier class provides an interface for telling a Participant to rectify an inconsistency in the information received by a moderator. This rectification protocol is important when the blockades are being managed over an unreliable network.
The Rectifier class can be used by a RectifierRequester to ask a participant to retransmit a range of its past status changes.
Only the Participant class is able to create a Rectifier instance. Users of rmf_traffic cannot instantiate a Rectifier.
Public Functions
-
void
check
(const Status &status)¶ Check that the given status is up to date, and retransmit if any information is out of sync.
-
void
check
()¶ Check that there should not be a status for this participant. If that is a mistake and this participant should have a status, then retransmit the necessary information.
-
void
Class Writer¶
Defined in File Writer.hpp
Nested Relationships¶
Inheritance Relationships¶
public rmf_traffic::blockade::Moderator
(Class Moderator)
Class Documentation¶
-
class
rmf_traffic::blockade
::
Writer
¶ Subclassed by rmf_traffic::blockade::Moderator
Public Functions
-
virtual void
set
(ParticipantId participant_id, ReservationId reservation_id, const Reservation &reservation) = 0¶ Set the path reservation of a participant.
If reservation_id is (modularly) less than or equal to the last reservation_id value given for this participant_id, then this function call will be ignored.
Any previous path reservation will be considered canceled.
-
virtual void
ready
(ParticipantId participant_id, ReservationId reservation_id, CheckpointId checkpoint) = 0¶ Indicate when a participant is ready at a checkpoint.
If reservation_id is not equal to the last reservation_id value given to set() for this participant_id, then this function call will be ignored.
-
virtual void
release
(ParticipantId participant_id, ReservationId reservation_id, CheckpointId checkpoint) = 0¶ Release a checkpoint (and all checkpoints that come after it) from ready status if the participant has not departed from it yet.
-
virtual void
reached
(ParticipantId participant_id, ReservationId reservation_id, CheckpointId checkpoint) = 0¶ Indicate when a participant has reached a checkpoint.
If reservation_id is not equal to the last reservation_id value given to set() for this participant_id, then this function call will be ignored.
-
virtual void
cancel
(ParticipantId participant_id, ReservationId reservation_id) = 0¶ Indicate that a path reservation is canceled if reservation_id is (modularly) greater than or equal to the last reservation_id value given to set() for this participant_id.
-
virtual void
cancel
(ParticipantId participant_id) = 0¶ Indicate that all path reservations for this participant_id are canceled.
-
virtual
~Writer
() = default¶
-
struct
Checkpoint
¶
-
struct
Reservation
¶
-
virtual void
Class Plumber¶
Defined in File Plumber.hpp
Class Documentation¶
-
class
rmf_traffic::debug
::
Plumber
¶
Class DependsOnPlan¶
Defined in File Route.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic
::
DependsOnPlan
¶ Express a dependency on the plan of another traffic participant.
Public Functions
-
DependsOnPlan
()¶ Default constructor. There will be no dependency.
-
DependsOnPlan
(PlanId plan, DependsOnRoute routes)¶ There will be a dependency on the specified plan.
-
DependsOnPlan &
plan
(std::optional<PlanId> plan)¶ Set the plan that there is a dependency on.
-
DependsOnPlan &
routes
(DependsOnRoute routes)¶ Set the routes that there is a dependency on.
-
DependsOnRoute &
routes
()¶ Get the routes that there is a dependency on.
-
const DependsOnRoute &
routes
() const¶ Get the routes that there is a dependency on.
-
DependsOnPlan &
add_dependency
(CheckpointId dependent_checkpoint, Dependency dependency)¶ Add a dependency.
-
struct
Dependency
¶
-
Template Class bidirectional_iterator¶
Defined in File bidirectional_iterator.hpp
Class Documentation¶
-
template<typename
ElementType
, typenameImplementationType
, typenameFriend
>
classrmf_traffic::detail
::
bidirectional_iterator
¶ This class is used so we can provide iterators for various container classes without exposing any implementation details about what kind of STL container we are using inside of our container class. This allows us to guarantee ABI stability, even if we decide to change what STL container we use inside of our implementation.
This class is designed to offer only the most basic features of a bidirectional iterator.
Public Functions
-
bidirectional_iterator &
operator++
()¶ Pre-increment operator: ++it
- Note
This is more efficient than the post-increment operator.
- Return
a reference to the iterator that was operated on
-
bidirectional_iterator &
operator--
()¶ Pre-decrement operator: it
- Note
This is more efficient than the post-decrement operator
- Return
a reference to the iterator that was operated on
-
bidirectional_iterator
operator++
(int)¶ Post-increment operator: it++
- Return
a copy of the iterator before it was incremented
-
bidirectional_iterator
operator--
(int)¶ Post-decrement operator: it
- Return
a copy of the iterator before it was decremented
-
bool
operator==
(const bidirectional_iterator &other) const¶ Equality comparison operator.
-
bool
operator!=
(const bidirectional_iterator &other) const¶ Inequality comparison operator.
-
operator bidirectional_iterator<const Element, Implementation, Friend>
() const¶
-
bidirectional_iterator
(const bidirectional_iterator&) = default¶
-
bidirectional_iterator
(bidirectional_iterator&&) = default¶
-
bidirectional_iterator &
operator=
(const bidirectional_iterator&) = default¶
-
bidirectional_iterator &
operator=
(bidirectional_iterator&&) = default¶
-
bidirectional_iterator
()¶
-
bidirectional_iterator &
Template Class forward_iterator¶
Defined in File forward_iterator.hpp
Class Documentation¶
-
template<typename
ElementType
, typenameImplementationType
, typenameFriend
>
classrmf_traffic::detail
::
forward_iterator
¶ This class is used so we can provide iterators for various container classes without exposing any implementation details about what kind of STL container we are using inside of our container class. This allows us to guarantee ABI stability, even if we decide to change what STL container we use inside of our implementation.
This class is designed to offer only the most basic features of a forward iterator.
Public Functions
-
forward_iterator &
operator++
()¶ Pre-increment operator: ++it
- Note
This is more efficient than the post-increment operator.
- Return
a reference to the iterator that was operated on
-
forward_iterator
operator++
(int)¶ Post-increment operator: it++
- Return
a copy of the iterator before it was incremented
-
bool
operator==
(const forward_iterator &other) const¶ Equality comparison operator.
-
bool
operator!=
(const forward_iterator &other) const¶ Inequality comparison operator.
-
operator forward_iterator<const Element, Implementation, Friend>
() const¶
-
forward_iterator
(const forward_iterator&) = default¶
-
forward_iterator
(forward_iterator&&) = default¶
-
forward_iterator &
operator=
(const forward_iterator&) = default¶
-
forward_iterator &
operator=
(forward_iterator&&) = default¶
-
forward_iterator
()¶
-
forward_iterator &
Class DetectConflict¶
Defined in File DetectConflict.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic
::
DetectConflict
¶ -
Public Static Functions
-
static std::optional<Conflict>
between
(const Profile &profile_a, const Trajectory &trajectory_a, const DependsOnCheckpoint *dependencies_of_a_on_b, const Profile &profile_b, const Trajectory &trajectory_b, const DependsOnCheckpoint *dependencies_of_b_on_a, Interpolate interpolation = Interpolate::CubicSpline)¶ Checks if there are any conflicts between the two trajectories.
- Return
true if a conflict exists between the trajectories, false otherwise.
- Parameters
[in] profile_a
: The profile of agent A[in] trajectory_a
: The trajectory of agent A[in] dependencies_of_a_on_b
: The dependencies that agent A has on the given trajectory of agent B[in] profile_b
: The profile of agent B[in] trajectory_b
: The trajectory of agent B[in] dependencies_of_b_on_a
: The dependencies that agent B has on the given trajectory of agent A
-
struct
Conflict
¶
-
static std::optional<Conflict>
Class Circle¶
Defined in File Circle.hpp
Inheritance Relationships¶
public rmf_traffic::geometry::ConvexShape
(Class ConvexShape)
Class Documentation¶
-
class
rmf_traffic::geometry
::
Circle
: public rmf_traffic::geometry::ConvexShape¶ This class represent a circle shape which can be added into a Zone or Trajectory.
Public Functions
-
Circle
(double radius)¶
-
void
set_radius
(double r)¶
-
double
get_radius
() const¶
-
virtual FinalShape
finalize
() const final¶ Finalize the shape so that it can be given to a Trajectory::Profile or a Zone.
-
virtual FinalConvexShape
finalize_convex
() const final¶ Finalize the shape more specifically as a ConvexShape.
-
Class ConvexShape¶
Defined in File ConvexShape.hpp
Inheritance Relationships¶
public rmf_traffic::geometry::Shape
(Class Shape)
public rmf_traffic::geometry::Circle
(Class Circle)
Class Documentation¶
-
class
rmf_traffic::geometry
::
ConvexShape
: public rmf_traffic::geometry::Shape¶ This class is a more specific type of Shape. The Zone class can consume any kind of Shape, but the Trajectory class can only consume ConvexShape types.
- See
Box, Circle
Subclassed by rmf_traffic::geometry::Circle
Public Functions
-
virtual FinalConvexShape
finalize_convex
() const = 0¶ Finalize the shape more specifically as a ConvexShape.
Class FinalConvexShape¶
Defined in File ConvexShape.hpp
Inheritance Relationships¶
public rmf_traffic::geometry::FinalShape
(Class FinalShape)
Class Documentation¶
-
class
rmf_traffic::geometry
::
FinalConvexShape
: public rmf_traffic::geometry::FinalShape¶ This is a finalized ConvexShape whose parameters can no longer be mutated.
Protected Functions
-
FinalConvexShape
()¶
-
Class FinalShape¶
Defined in File Shape.hpp
Inheritance Relationships¶
public rmf_traffic::geometry::FinalConvexShape
(Class FinalConvexShape)
Class Documentation¶
-
class
rmf_traffic::geometry
::
FinalShape
¶ This is a finalized shape whose parameters can no longer be mutated.
Subclassed by rmf_traffic::geometry::FinalConvexShape
Public Functions
-
const Shape &
source
() const¶ Look at the source of this FinalShape to inspect its parameters.
-
double
get_characteristic_length
() const¶ Get the characteristic length of this FinalShape.
-
virtual
~FinalShape
() = default¶
-
bool
operator==
(const FinalShape &other) const¶ Equality operator.
-
bool
operator!=
(const FinalShape &other) const¶ Non-equality operator.
Protected Functions
-
FinalShape
()¶
Protected Attributes
-
rmf_utils::impl_ptr<Implementation>
_pimpl
¶
-
const Shape &
Class Shape¶
Defined in File Shape.hpp
Inheritance Relationships¶
public rmf_traffic::geometry::ConvexShape
(Class ConvexShape)
Class Documentation¶
-
class
rmf_traffic::geometry
::
Shape
¶ This is the base class of different shape classes that can be used by the rmf_traffic library. This cannot (currently) be extended by downstream libraries; instead, users must choose one of the pre-defined shape types belonging to this library.
- See
Box, Circle, Polygon
Subclassed by rmf_traffic::geometry::ConvexShape
Public Functions
-
virtual FinalShape
finalize
() const = 0¶ Finalize the shape so that it can be given to a Trajectory::Profile or a Zone.
-
virtual
~Shape
()¶
Class Space¶
Defined in File Space.hpp
Class Documentation¶
-
class
rmf_traffic::geometry
::
Space
¶ Public Functions
-
Space
(geometry::ConstFinalShapePtr shape, Eigen::Isometry2d tf)¶
-
const geometry::ConstFinalShapePtr &
get_shape
() const¶
-
Space &
set_shape
(geometry::ConstFinalShapePtr shape)¶
-
const Eigen::Isometry2d &
get_pose
() const¶
-
Class invalid_trajectory_error¶
Defined in File DetectConflict.hpp
Inheritance Relationships¶
public exception
Class Documentation¶
Class Motion¶
Defined in File Motion.hpp
Class Documentation¶
-
class
rmf_traffic
::
Motion
¶ Pure abstract interface for describing a continuous motion.
Public Functions
-
virtual Time
start_time
() const = 0¶ Get the lower bound on the time range where this motion is valid.
-
virtual Time
finish_time
() const = 0¶ Get the upper bound on the time range where this motion is valid.
-
virtual Eigen::Vector3d
compute_position
(Time t) const = 0¶ Get the position of this motion at a point in time.
- Parameters
[in] t
: The time of interest. This time must be in the range [start_time(), finish_time()], or else the output is undefined and may result in an exception.
-
virtual Eigen::Vector3d
compute_velocity
(Time t) const = 0¶ Get the velocity of this motion at a point in time.
- Parameters
[in] t
: The time of interest. This time must be in the range [start_time(), finish_time()], or else the output is undefined and may result in an exception.
-
virtual Eigen::Vector3d
compute_acceleration
(Time t) const = 0¶ Get the acceleration of this motion at a point in time.
- Parameters
[in] t
: The time of interest. This time must be in the range [start_time(), finish_time()], or else the output is undefined and may result in an exception.
-
virtual
~Motion
() = default¶
Public Static Functions
-
static std::unique_ptr<Motion>
compute_cubic_splines
(const Trajectory::const_iterator &begin, const Trajectory::const_iterator &end)¶ Compute a piecewise cubic spline motion object for a Trajectory from the begin iterator up to (but not including) the end iterator.
- Parameters
[in] begin
: The iterator of the first waypoint to include in the motion. It is undefined behavior to pass in Trajectory::end() for this argument.[in] end
: The iterator of the first waypoint to exclude from the motion. To include all the way to the end of the trajectory, pass in Trajectory::end(). An exception will be thrown if begin == end.
-
static std::unique_ptr<Motion>
compute_cubic_splines
(const Trajectory &trajectory)¶ Compute a piecewise cubic spline motion object for an entire Trajectory.
-
virtual Time
Class Profile¶
Defined in File Profile.hpp
Class Documentation¶
-
class
rmf_traffic
::
Profile
¶ Public Functions
-
Profile
(geometry::ConstFinalConvexShapePtr footprint, geometry::ConstFinalConvexShapePtr vicinity = nullptr)¶ Constructor
- Parameters
[in] footprint
: An estimate of the space that this participant occupies.[in] vicinity
: An estimate of the vicinity around the participant in which the presence of other traffic would disrupt its operations. If a nullptr is used for this, the footprint shape will be used as the vicinity.
-
Profile &
footprint
(geometry::ConstFinalConvexShapePtr shape)¶ Set the footprint of the participant.
-
const geometry::ConstFinalConvexShapePtr &
footprint
() const¶ Get the footprint of the participant.
-
Profile &
vicinity
(geometry::ConstFinalConvexShapePtr shape)¶ Set the vicinity of this participant.
-
const geometry::ConstFinalConvexShapePtr &
vicinity
() const¶ Get the vicinity of this participant.
-
Class Region¶
Defined in File Region.hpp
Class Documentation¶
-
class
rmf_traffic
::
Region
¶ A class to describe a region within spacetime.
This specifies the map whose coordinates should be used, a lower and upper bound to define a time range, and a set of geometry::Space objects to define regions with space.
For the geometry::Space objects, this class acts like an STL container and provides an iterator interface to specify, access, and modify them.
Public Types
-
using
base_iterator
= rmf_traffic::detail::bidirectional_iterator<E, I, F>¶
-
using
iterator
= base_iterator<Space, IterImpl, Region>¶
-
using
const_iterator
= base_iterator<const Space, IterImpl, Region>¶
Public Functions
-
Region
(std::string map, Time lower_bound, Time upper_bound, std::vector<Space> spaces)¶ Construct a region given the parameters.
- Parameters
[in] map
: The map whose coordinates will be used to define the regions in space.[in] lower_bound
: The lower bound for the time range.[in] upper_bound
: The upper bound for the time range.[in] spaces
: A vector of geometry::Space objects to define the desired regions in space.
-
Region
(std::string map, std::vector<Space> spaces)¶ Construct a region with no time constraints.
- Parameters
[in] map
: The map whose coordinates will be used to define the regions in space.[in] spaces
: A vector of geometry::Space objects to define the desired regions in space.
-
const std::string &
get_map
() const¶ Get the name of the map that this Spacetime refers to.
-
const Time *
get_lower_time_bound
() const¶ Get the lower bound for the time range.
If there is no lower bound for the time range, then this returns a nullptr.
-
const Time *
get_upper_time_bound
() const¶ Get the upper bound for the time range.
If there is no upper bound for the time range, then this returns a nullptr.
-
void
pop_back
()¶ Remove the last region of space that was added.
-
iterator
erase
(iterator first, iterator last)¶ Erase a specific sets of regions of space based on their iterators.
-
const_iterator
begin
() const¶ const-qualified begin()
-
const_iterator
cbegin
() const¶ Explicitly const-qualified alternative for begin()
-
const_iterator
end
() const¶ const-qualified end()
-
const_iterator
cend
() const¶ Explicitly const-qualified alternative for end()
-
std::size_t
num_spaces
() const¶ Get the number of Space regions in this Spacetime region.
-
using
Class Route¶
Defined in File Route.hpp
Class Documentation¶
-
class
rmf_traffic
::
Route
¶ A route on the schedule. This is used as a component of a schedule participant’s itinerary.
Public Functions
-
Route
(std::string map, Trajectory trajectory)¶ Constructor
- Parameters
[in] map
: The map that the trajectory is on[in] trajectory
: The scheduled trajectory
-
const std::string &
map
() const¶ Get the map for this route.
-
Route &
trajectory
(Trajectory value)¶ Set the trajectory for this route.
-
Trajectory &
trajectory
()¶ Get the trajectory for this route.
-
const Trajectory &
trajectory
() const¶ Get the trajectory for this immutable route.
-
Route &
checkpoints
(std::set<uint64_t> value)¶ Set the checkpoints for this route. A checkpoint is a waypoint within this route which will explicitly trigger an traffic event update when it is reached.
-
std::set<uint64_t> &
checkpoints
()¶ Get the checkpoints for this route.
-
const std::set<uint64_t> &
checkpoints
() const¶ Get the checkpoints for this immutable route.
-
Route &
dependencies
(DependsOnParticipant value)¶ Set the dependencies of the route.
-
DependsOnParticipant &
dependencies
()¶ Get the dependencies of the route.
-
const DependsOnParticipant &
dependencies
() const¶ Get the dependencies of the immutable route.
-
Route &
add_dependency
(CheckpointId dependent_checkpoint, Dependency dependency)¶ Tell this route that it has a dependency on the checkpoint of another participant’s route.
- Parameters
[in] dependent_checkpoint
: The checkpoint inside of this route which has a dependency on the other participant’s route.[in] on_participant
: The other participant which this route is depending on.[in] on_plan
: The ID of the other participant’s plan that this route is depending on.[in] on_route
: The ID of the other participant’s route that this robot is depending on.[in] on_checkpoint
: The ID of the checkpoint
-
bool
should_ignore
(ParticipantId participant, PlanId plan) const¶ True if this route should ignore information about the given (participant, plan) pair. If this route has a dependency on a plan from this participant with a higher ID value, then this will return true. Otherwise it returns false.
-
const DependsOnCheckpoint *
check_dependencies
(ParticipantId on_participant, PlanId on_plan, RouteId on_route) const¶ Get any dependencies that this route has on the given route of another participant.
- Return
A pointer to the relevant dependencies, if any exist. If there is no dependency relevant to the specified route of the participant, then this will be a nullptr.
- Parameters
[in] on_participant
: The ID of the other participant of interest[in] on_plan
: The ID of the other participant’s current plan[in] on_route
: The ID of the other participant’s route that is being considered
-
Class Change¶
Defined in File Change.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic::schedule
::
Change
¶ A class that describes a change within the schedule.
-
class
Add
¶ The API for an Add change.
Public Functions
-
const std::vector<Item> &
items
() const¶ A reference to the Trajectory that was inserted.
-
struct
Item
¶ A description of an addition.
-
const std::vector<Item> &
-
class
Cull
¶ A class that describes a culling.
-
class
Erase
¶ A class that describes an erasing change.
-
class
Progress
¶ A class that provides an update on itinerary progression.
Public Functions
-
Progress
(ProgressVersion version, std::vector<CheckpointId> checkpoints)¶ Constructor.
-
ProgressVersion
version
() const¶
-
const std::vector<CheckpointId> &
checkpoints
() const¶
-
-
class
RegisterParticipant
¶ A class that describes a participant registration.
Public Functions
-
RegisterParticipant
(ParticipantId id, ParticipantDescription description)¶ Constructor
- Parameters
[in] id
: The ID of the participant[in] description
: The description of the participant
-
ParticipantId
id
() const¶ The ID for the participant.
-
const ParticipantDescription &
description
() const¶ The description of the participant.
-
-
class
UnregisterParticipant
¶ A class that specifies a participant to unregister.
Public Functions
-
UnregisterParticipant
(ParticipantId id)¶ Constructor
- Parameters
[in] id
: The ID of the participant that is being unregistered.
-
ParticipantId
id
() const¶ The ID for the participant.
-
-
class
UpdateParticipantInfo
¶ A class that describes update in the participant info.
Public Functions
-
UpdateParticipantInfo
(ParticipantId id, ParticipantDescription desc)¶ Constructor
- Parameters
[in] id
: The ID of the participant that is being unregistered.
-
ParticipantId
id
() const¶ The ID for the participant.
-
ParticipantDescription
description
() const¶ Description for participants.
-
-
class
Class Change::Add¶
Defined in File Change.hpp
Nested Relationships¶
This class is a nested type of Class Change.
Class Documentation¶
-
class
rmf_traffic::schedule::Change
::
Add
The API for an Add change.
Public Functions
-
const std::vector<Item> &
items
() const A reference to the Trajectory that was inserted.
-
PlanId
plan_id
() const The plan ID that these routes are being added for.
-
struct
Item
A description of an addition.
Public Members
-
RouteId
route_id
The ID of the route being added, relative to the plan it belongs to.
-
StorageId
storage_id
The storage ID of the route.
-
ConstRoutePtr
route
The information for the route being added.
-
RouteId
-
const std::vector<Item> &
Class Change::Cull¶
Defined in File Change.hpp
Nested Relationships¶
This class is a nested type of Class Change.
Class Documentation¶
-
class
rmf_traffic::schedule::Change
::
Cull
A class that describes a culling.
Class Change::Delay¶
Defined in File Change.hpp
Nested Relationships¶
This class is a nested type of Class Change.
Class Documentation¶
Class Change::Erase¶
Defined in File Change.hpp
Nested Relationships¶
This class is a nested type of Class Change.
Class Documentation¶
-
class
rmf_traffic::schedule::Change
::
Erase
A class that describes an erasing change.
Class Change::Progress¶
Defined in File Change.hpp
Nested Relationships¶
This class is a nested type of Class Change.
Class Documentation¶
-
class
rmf_traffic::schedule::Change
::
Progress
A class that provides an update on itinerary progression.
Public Functions
-
Progress
(ProgressVersion version, std::vector<CheckpointId> checkpoints) Constructor.
-
ProgressVersion
version
() const
-
const std::vector<CheckpointId> &
checkpoints
() const
-
Class Change::RegisterParticipant¶
Defined in File Change.hpp
Nested Relationships¶
This class is a nested type of Class Change.
Class Documentation¶
-
class
rmf_traffic::schedule::Change
::
RegisterParticipant
A class that describes a participant registration.
Public Functions
-
RegisterParticipant
(ParticipantId id, ParticipantDescription description) Constructor
- Parameters
[in] id
: The ID of the participant[in] description
: The description of the participant
-
ParticipantId
id
() const The ID for the participant.
-
const ParticipantDescription &
description
() const The description of the participant.
-
Class Change::UnregisterParticipant¶
Defined in File Change.hpp
Nested Relationships¶
This class is a nested type of Class Change.
Class Documentation¶
-
class
rmf_traffic::schedule::Change
::
UnregisterParticipant
A class that specifies a participant to unregister.
Public Functions
-
UnregisterParticipant
(ParticipantId id) Constructor
- Parameters
[in] id
: The ID of the participant that is being unregistered.
-
ParticipantId
id
() const The ID for the participant.
-
Class Change::UpdateParticipantInfo¶
Defined in File Change.hpp
Nested Relationships¶
This class is a nested type of Class Change.
Class Documentation¶
-
class
rmf_traffic::schedule::Change
::
UpdateParticipantInfo
A class that describes update in the participant info.
Public Functions
-
UpdateParticipantInfo
(ParticipantId id, ParticipantDescription desc) Constructor
- Parameters
[in] id
: The ID of the participant that is being unregistered.
-
ParticipantId
id
() const The ID for the participant.
-
ParticipantDescription
description
() const Description for participants.
-
Class Database¶
Defined in File Database.hpp
Inheritance Relationships¶
public rmf_traffic::schedule::ItineraryViewer
(Class ItineraryViewer)public rmf_traffic::schedule::Writer
(Class Writer)public rmf_traffic::schedule::Snappable
(Class Snappable)
Class Documentation¶
-
class
rmf_traffic::schedule
::
Database
: public rmf_traffic::schedule::ItineraryViewer, public rmf_traffic::schedule::Writer, public rmf_traffic::schedule::Snappable¶ A class that maintains a database of scheduled Trajectories. This class is intended to be used only for the canonical RMF traffic schedule database.
The Viewer API can be queried to find Trajectories that match certain criteria.
You can also retrieve update patches from a database. To apply those patches to a downstream Viewer, it is strongly advised to use the rmf_traffic::schedule::Mirror class.
Public Functions
-
virtual void
set
(ParticipantId participant, PlanId plan, const Itinerary &itinerary, StorageId storage_base, ItineraryVersion version) final¶ Set a brand new itinerary for a participant. This will replace any itinerary that is already in the schedule for the participant.
- Parameters
[in] participant
: The ID of the participant whose itinerary is being updated.[in] plan
: The ID of the plan that this new itinerary belongs to.[in] itinerary
: The new itinerary of the participant.[in] storage_base
: The storage index offset that the database should use for this plan. This should generally be the integer number of total routes that the participant has ever given to the writer prior to setting this new itinerary. This value helps ensure consistent unique IDs for every route, even after a database has failed over or restarted.[in] version
: The version for this itinerary change.
-
virtual void
extend
(ParticipantId participant, const Itinerary &routes, ItineraryVersion version) final¶ Add a set of routes to the itinerary of this participant.
- Parameters
[in] participant
: The ID of the participant whose itinerary is being updated.[in] routes
: The set of routes that should be added to the itinerary.[in] version
: The version for this itinerary change
-
virtual void
delay
(ParticipantId participant, Duration delay, ItineraryVersion version) final¶ Add a delay to the itinerary from the specified Time.
Nothing about the routes in the itinerary will be changed except that waypoints will shifted through time.
- Parameters
[in] participant
: The ID of the participant whose itinerary is being delayed.[in] delay
: This is the duration of time to delay all qualifying Trajectory Waypoints.[in] version
: The version for this itinerary change
-
virtual void
reached
(ParticipantId participant, PlanId plan, const std::vector<CheckpointId> &reached_checkpoints, ProgressVersion version) final¶ Indicate that a participant has reached certain checkpoints.
- Parameters
[in] participant
: The ID of the participant whose progress is being set.[in] plan
: The ID of the plan which progress has been made for.[in] reached_checkpoints
: The set of checkpoints that have been reached. The indices in the vector must correspond to the RouteIds of the plan.[in] version
: The version number for this progress.
-
virtual void
clear
(ParticipantId participant, ItineraryVersion version) final¶ Erase an itinerary from this database.
- Parameters
[in] participant
: The ID of the participant whose itinerary is being erased.[in] version
: The version for this itinerary change
-
virtual Registration
register_participant
(ParticipantDescription participant_info) final¶ Register a new participant.
- Return
result of registering the new participant.
- Parameters
[in] participant_info
: Information about the new participant.[in] time
: The time at which the registration is being requested.
-
virtual void
update_description
(ParticipantId participant, ParticipantDescription desc) final¶ Updates a participants footprint
- Parameters
[in] participant
: The ID of the participant to update[in] desc
: The participant description
-
virtual void
unregister_participant
(ParticipantId participant) final¶ Before calling this function on a Database, you should set the current time for the database by calling set_current_time(). This will allow the database to cull this participant after a reasonable amount of time has passed.
-
virtual View
query
(const Query ¶meters) const final¶ Query this Viewer to get a View of the Trajectories inside of it that match the Query parameters.
-
virtual View
query
(const Query::Spacetime &spacetime, const Query::Participants &participants) const final¶ Alternative signature for query()
-
virtual const std::unordered_set<ParticipantId> &
participant_ids
() const final¶ Get the set of active participant IDs.
-
std::shared_ptr<const ParticipantDescription>
get_participant
(std::size_t participant_id) const final¶
-
std::optional<ItineraryView>
get_itinerary
(std::size_t participant_id) const final¶
-
virtual const std::vector<CheckpointId> *
get_current_progress
(ParticipantId participant_id) const final¶ Get the current progress of a specific participant. If a participant with the specified ID is not registered with the schedule or has never made progress, then this will return a nullptr.
-
virtual ProgressVersion
get_current_progress_version
(ParticipantId participant_id) const final¶ Get the current known progress of a specific participant along its current plan. If no progress has been made, this will have a value of 0.
-
virtual DependencySubscription
watch_dependency
(Dependency dependency, std::function<void()> on_reachedstd::function<void()> on_deprecated) const final¶ Watch a traffic dependency. When a relevant event happens for the dependency, the on_reached or on_deprecated will be triggered. If the event had already come to pass before this function is called, then the relevant callback will be triggered right away, within the scope of this function.
Only one of the callbacks will ever be triggered, and it will only be triggered at most once.
- Return
an object that maintains the dependency for the viewer.
- Parameters
[in] on_reached
: If the dependency is reached, this will be triggered. on_changed will never be triggered afterwards.[in] on_deprecated
: If the plan of the participant changed before it reached this dependency then the dependency is deprecated and this callback will be triggered. on_reached will never be triggered afterwards.
-
const Inconsistencies &
inconsistencies
() const¶ A description of all inconsistencies currently present in the database. Inconsistencies are isolated between Participants.
To fix the inconsistency, the Participant should resend every Itinerary change that was missing from every range, or else send a change that nullifies all previous changes, such as a set(~) or erase(ParticipantId).
-
Patch
changes
(const Query ¶meters, std::optional<Version> after) const¶ Get the changes in this Database that match the given Query parameters. If a version number is specified, then the returned Patch will reflect the changes that occurred from the specified version to the current version of the schedule.
To get a consistent reflection of the schedule when specifying a base version, it is important that the query parameters are not changed in between calls.
- Return
A Patch of schedule changes that are relevant to the specified query parameters.
- Parameters
[in] parameters
: The parameters describing what types of schedule entries the mirror cares about.[in] after
: Specify that only changes which come after this version number are desired. If you give a nullopt for this argument, then all changes will be provided.
-
View
query
(const Query ¶meters, Version after) const¶ View the routes that match the parameters and have changed (been added or delayed) since the specified version. This is useful for viewing incremental changes.
- Return
a view of the routes that are different since the specified version.
- Parameters
[in] parameters
: The parameters describing what types of schedule entries are relevant.[in] after
: Specify that only routes which changed after this version number are desired.
-
void
set_current_time
(Time time)¶ Set the current time on the database. This should be used immediately before calling unregister_participant() so that the database can cull the existence of the participant at an appropriate time. There’s no need to call this function for any other purpose.
-
ItineraryVersion
itinerary_version
(ParticipantId participant) const¶ Get the current itinerary version for the specified participant.
-
PlanId
latest_plan_id
(ParticipantId participant) const¶ Get the last Plan ID used by this participant.
This provides the same information as get_current_plan_id, except it throws an exception instead of returning an optional if the participant does not exist.
-
StorageId
next_storage_base
(ParticipantId participant) const¶ Get the last Storage ID used by this participant.
-
virtual void
Class DatabaseRectificationRequesterFactory¶
Defined in File Rectifier.hpp
Inheritance Relationships¶
public rmf_traffic::schedule::RectificationRequesterFactory
(Class RectificationRequesterFactory)
Class Documentation¶
-
class
rmf_traffic::schedule
::
DatabaseRectificationRequesterFactory
: public rmf_traffic::schedule::RectificationRequesterFactory¶ This class provides a simple implementation of a RectificationRequesterFactory that just hooks directly into a Database instance and issues rectification requests when told to based on the current inconsistencies in the Database.
Public Functions
This accepts a const-reference to a Database instance. Note that this class will store a reference to this Database, so its lifecycle is implicitly dependent on the Database’s lifecycle.
-
virtual std::unique_ptr<RectificationRequester>
make
(Rectifier rectifier, ParticipantId participant_id) final¶ Create a RectificationRequester to be held by a Participant
- Parameters
[in] rectifier
: This rectifier can be used by the RectificationRequester to ask the participant to retransmit some of its changes.[in] participant_id
: The ID of the participant that will hold onto this RectificationRequester. This is the same participant that the rectifier will request retransmissions to.
-
void
rectify
()¶ Call this function to instruct all the RectificationRequestors produced by this factory to perform their rectifications.
Change the database that will be getting rectified. This can be used to switch to rectifying a new database fork.
Class Inconsistencies¶
Defined in File Inconsistencies.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic::schedule
::
Inconsistencies
¶ An Inconsistency occurs when one or more ItineraryVersion values get skipped by the inputs into the database. This container expresses the ranges of which ItineraryVersions were skipped for a single Participant.
Iterators
Public Types
-
using
base_iter
= rmf_traffic::detail::forward_iterator<E, I, F>¶
-
using
const_iterator
= base_iter<const Element, IterImpl, Inconsistencies>¶
Public Functions
-
const_iterator
begin
() const¶ Get the beginning iterator.
-
const_iterator
cbegin
() const¶ Explicitly const-qualified alternative for begin()
-
const_iterator
end
() const¶ Get the one-past-the-end iterator.
-
const_iterator
cend
() const¶ Explicitly const-qualified alternative for end()
-
const_iterator
find
(ParticipantId id) const¶ Get the iterator for this ParticipantId.
-
std::size_t
size
() const¶ Get the number of participants with inconsistencies.
-
struct
Element
¶ An element of the Inconsistencies container. This tells the ranges of inconsistencies that are present for the specified Participant.
-
class
Ranges
¶ A container of the ranges of inconsistencies for a single participant.
Public Functions
-
const_iterator
begin
() const¶ Get the beginning iterator.
-
const_iterator
cbegin
() const¶ Explicitly const-qualified alternative for begin()
-
const_iterator
end
() const¶ Get the one-past-the-end iterator.
-
const_iterator
cend
() const¶ Explicitly const-qualified alternative for end()
-
std::size_t
size
() const¶ Get the number of ranges in this container.
-
ItineraryVersion
last_known_version
() const¶ Get the value of the last itinerary version that has been received.
-
const_iterator
-
using
Class Inconsistencies::Ranges¶
Defined in File Inconsistencies.hpp
Nested Relationships¶
This class is a nested type of Class Inconsistencies.
Class Documentation¶
-
class
rmf_traffic::schedule::Inconsistencies
::
Ranges
A container of the ranges of inconsistencies for a single participant.
Public Functions
-
const_iterator
begin
() const Get the beginning iterator.
-
const_iterator
cbegin
() const Explicitly const-qualified alternative for begin()
-
const_iterator
end
() const Get the one-past-the-end iterator.
-
const_iterator
cend
() const Explicitly const-qualified alternative for end()
-
std::size_t
size
() const Get the number of ranges in this container.
-
ItineraryVersion
last_known_version
() const Get the value of the last itinerary version that has been received.
-
struct
Range
A single range of inconsistencies within a participant.
Every version between (and including) the lower and upper versions have not been received by the Database.
-
const_iterator
Class ItineraryViewer¶
Defined in File Viewer.hpp
Nested Relationships¶
Inheritance Relationships¶
public rmf_traffic::schedule::Viewer
(Class Viewer)
public rmf_traffic::schedule::Database
(Class Database)public rmf_traffic::schedule::Mirror
(Class Mirror)
Class Documentation¶
-
class
rmf_traffic::schedule
::
ItineraryViewer
: public virtual rmf_traffic::schedule::Viewer¶ A pure abstract interface class that extends Viewer to allow users to explicitly request the itinerary of a specific participant.
- Note
This interface class is separate from Viewer because it is not generally needed by the traffic planning or negotiation systems, and the Snapshot class can perform better if it does not need to provide this function.
Subclassed by rmf_traffic::schedule::Database, rmf_traffic::schedule::Mirror
Public Functions
-
virtual std::optional<ItineraryView>
get_itinerary
(ParticipantId participant_id) const = 0¶ Get the itinerary of a specific participant if it is available. If a participant with the specified ID is not registered with the schedule or has never submitted an itinerary, then this will return a nullopt.
-
virtual std::optional<PlanId>
get_current_plan_id
(ParticipantId participant_id) const = 0¶ Get the current plan ID of a specific participant if it is available. If a participant with the specified ID is not registered with the schedule, then this will return a nullopt.
-
virtual const std::vector<CheckpointId> *
get_current_progress
(ParticipantId participant_id) const = 0¶ Get the current progress of a specific participant. If a participant with the specified ID is not registered with the schedule or has never made progress, then this will return a nullptr.
-
virtual ProgressVersion
get_current_progress_version
(ParticipantId participant_id) const = 0¶ Get the current known progress of a specific participant along its current plan. If no progress has been made, this will have a value of 0.
-
virtual DependencySubscription
watch_dependency
(Dependency dependency, std::function<void()> on_reachedstd::function<void()> on_deprecated) const = 0¶ Watch a traffic dependency. When a relevant event happens for the dependency, the on_reached or on_deprecated will be triggered. If the event had already come to pass before this function is called, then the relevant callback will be triggered right away, within the scope of this function.
Only one of the callbacks will ever be triggered, and it will only be triggered at most once.
- Return
an object that maintains the dependency for the viewer.
- Parameters
[in] on_reached
: If the dependency is reached, this will be triggered. on_changed will never be triggered afterwards.[in] on_deprecated
: If the plan of the participant changed before it reached this dependency then the dependency is deprecated and this callback will be triggered. on_reached will never be triggered afterwards.
-
virtual
~ItineraryViewer
() = default¶
-
class
DependencySubscription
¶ A handle for maintaining a dependency on the progress of an itinerary.
Public Functions
-
bool
reached
() const¶ The dependency was reached by the participant.
-
bool
deprecated
() const¶ The plan of the participant changed before it ever reached the dependency
-
bool
finished
() const¶ Equivalent to reached() || deprecated()
-
Dependency
dependency
() const¶ Check what dependency this is subscribed to.
-
bool
Class ItineraryViewer::DependencySubscription¶
Defined in File Viewer.hpp
Nested Relationships¶
This class is a nested type of Class ItineraryViewer.
Class Documentation¶
-
class
rmf_traffic::schedule::ItineraryViewer
::
DependencySubscription
A handle for maintaining a dependency on the progress of an itinerary.
Public Functions
-
bool
reached
() const The dependency was reached by the participant.
-
bool
deprecated
() const The plan of the participant changed before it ever reached the dependency
-
bool
finished
() const Equivalent to reached() || deprecated()
-
Dependency
dependency
() const Check what dependency this is subscribed to.
-
bool
Class Mirror¶
Defined in File Mirror.hpp
Inheritance Relationships¶
public rmf_traffic::schedule::ItineraryViewer
(Class ItineraryViewer)public rmf_traffic::schedule::Snappable
(Class Snappable)
Class Documentation¶
-
class
rmf_traffic::schedule
::
Mirror
: public rmf_traffic::schedule::ItineraryViewer, public rmf_traffic::schedule::Snappable¶ A class that maintains a mirror of a Database of scheduled Trajectories. This class is intended to provide a cache of the scheduled Trajectories to processes or threads that do not contain the original upstream copy of the rmf_traffic::schedule::Database.
The Mirror is designed to mirror a relevant subset of the schedule database.
Public Functions
-
virtual View
query
(const Query ¶meters) const final¶ Query this Viewer to get a View of the Trajectories inside of it that match the Query parameters.
-
virtual View
query
(const Query::Spacetime &spacetime, const Query::Participants &participants) const final¶ Alternative signature for query()
-
virtual const std::unordered_set<ParticipantId> &
participant_ids
() const final¶ Get the set of active participant IDs.
-
std::shared_ptr<const ParticipantDescription>
get_participant
(std::size_t participant_id) const final¶
-
std::optional<ItineraryView>
get_itinerary
(std::size_t participant_id) const final¶
-
virtual std::optional<PlanId>
get_current_plan_id
(ParticipantId participant_id) const final¶ Get the current plan ID of a specific participant if it is available. If a participant with the specified ID is not registered with the schedule, then this will return a nullopt.
-
virtual const std::vector<CheckpointId> *
get_current_progress
(ParticipantId participant_id) const final¶ Get the current progress of a specific participant. If a participant with the specified ID is not registered with the schedule or has never made progress, then this will return a nullptr.
-
virtual ProgressVersion
get_current_progress_version
(ParticipantId participant_id) const final¶ Get the current known progress of a specific participant along its current plan. If no progress has been made, this will have a value of 0.
-
virtual DependencySubscription
watch_dependency
(Dependency dependency, std::function<void()> on_reachedstd::function<void()> on_deprecated) const final¶ Watch a traffic dependency. When a relevant event happens for the dependency, the on_reached or on_deprecated will be triggered. If the event had already come to pass before this function is called, then the relevant callback will be triggered right away, within the scope of this function.
Only one of the callbacks will ever be triggered, and it will only be triggered at most once.
- Return
an object that maintains the dependency for the viewer.
- Parameters
[in] on_reached
: If the dependency is reached, this will be triggered. on_changed will never be triggered afterwards.[in] on_deprecated
: If the plan of the participant changed before it reached this dependency then the dependency is deprecated and this callback will be triggered. on_reached will never be triggered afterwards.
-
Mirror
()¶ Create a database mirror.
-
void
update_participants_info
(const ParticipantDescriptionsMap &participants)¶ Update the known participants and their descriptions.
-
virtual View
Class Negotiation¶
Defined in File Negotiation.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic::schedule
::
Negotiation
¶ Public Types
-
enum
SearchStatus
¶ This enumeration describes the status of a search attempt.
Values:
-
enumerator
Absent
¶ The requested version of this Table has never been seen by this Negotiation.
-
enumerator
-
using
VersionedKeySequence
= std::vector<VersionedKey>¶ The versioned key sequence can be used to select tables while demanding specific versions for those tables.
-
using
Proposal
= std::vector<Submission>¶
Public Functions
-
const std::unordered_set<ParticipantId> &
participants
() const¶ Get the participants that are currently involved in this negotiation.
-
void
add_participant
(ParticipantId p)¶ Add a new participant to the negotiation. This participant will become involved in the negotiation, and must give its consent for any agreement to be finalized.
-
bool
ready
() const¶ Returns true if at least one proposal is available that has the consent of every participant.
-
bool
complete
() const¶ Returns true if all possible proposals have been received and are ready to be evaluated.
Note that ready() may still be false if complete() is true, in the event that all proposals have been rejected.
-
TablePtr
table
(ParticipantId for_participant, const std::vector<ParticipantId> &to_accommodate)¶ Get a Negotiation::Table that provides a view into what participants are proposing.
This function does not care about table versioning.
- See
- Parameters
[in] for_participant
: The participant that is supposed to be viewing this Table. The itineraries of this participant will be left off of the Table.[in] to_accommodate
: The set of participants who are being accommodated at this Table. The ordering of the participants in this set is hierarchical where each participant is accommodating all of the participants that come before it.
-
ConstTablePtr
table
(ParticipantId for_participant, const std::vector<ParticipantId> &to_accommodate) const¶
-
TablePtr
table
(const std::vector<ParticipantId> &sequence)¶ Get a Negotiation::Table that corresponds to the given participant sequence. For a table in terms of for_participant and to_accomodate, you would call: table([to_accommodate…, for_participant])
This function does not care about table versioning.
- See
- Parameters
[in] sequence
: The participant sequence that corresponds to the desired table. This is equivalent to [to_accommodate…, for_participant]
-
ConstTablePtr
table
(const std::vector<ParticipantId> &sequence) const¶
-
SearchResult<TablePtr>
find
(ParticipantId for_participant, const VersionedKeySequence &to_accommodate)¶ Find a table, requesting specific versions
- See
-
SearchResult<ConstTablePtr>
find
(ParticipantId for_participant, const VersionedKeySequence &to_accommodate) const¶ const-qualified find()
-
SearchResult<TablePtr>
find
(const VersionedKeySequence &sequence)¶ Find a table, requesting specific versions
- See
-
SearchResult<ConstTablePtr>
find
(const VersionedKeySequence &sequence) const¶ const-qualified find()
-
ConstTablePtr
evaluate
(const Evaluator &evaluator) const¶ Evaluate the proposals that are available.
- Return
the negotiation table that was considered the best. Call Table::proposal() on this return value to see the full proposal. If there was no
Public Static Functions
Begin a negotiation.
- Return
a negotiation between the given participants. If the Viewer is missing a description of any of the participants, then a nullopt will be returned instead.
- See
- Parameters
[in] viewer
: A reference to the schedule viewer that represents the most up-to-date schedule.[in] participants
: The participants who are involved in the schedule negotiation.
Begin a negotiation.
- Return
a negotiation between the given participants. If the Viewer is missing a description of any of the participants, then a nullptr will be returned instead.
- See
- Parameters
[in] viewer
: A reference to the schedule viewer that represents the most up-to-date schedule.[in] participants
: The participants who are involved in the schedule negotiation.
-
class
Evaluator
¶ A pure abstract interface class for choosing the best proposal.
Subclassed by rmf_traffic::schedule::QuickestFinishEvaluator
-
template<typename
Ptr
>
structSearchResult
¶ Public Functions
-
inline bool
deprecated
() const¶
-
inline bool
absent
() const¶
-
inline bool
found
() const¶
-
inline
operator bool
() const¶
Public Members
-
SearchStatus
status
¶ The status of the search.
-
inline bool
-
struct
Submission
¶
-
class
Table
: public std::enable_shared_from_this<Table>¶ The Negotiation::Table class gives a view of what the other negotiation participants have proposed.
A Table instance is meant to be viewed by a specific participant and displays the proposals of other participants for a specific hierarchies of accommodations. See the documentation of Negotiation::table().
Alongside the views of the other Negotiation participants, the View provided by the Table instance will show the itineraries of schedule participants that are not part of the Negotiation. That way the external itineraries can also be accounted for when planning a submission based on this Table.
Public Functions
-
ViewerPtr
viewer
() const¶ Get a viewer for this Table. The Viewer can be safely used across multiple threads.
-
const Itinerary *
submission
() const¶ Return the submission on this Negotiation Table if it has one.
-
Version
version
() const¶ The a pointer to the latest itinerary version that was submitted to this table, if one was submitted at all.
-
const Proposal &
proposal
() const¶ The proposal on this table so far. This will include the latest itinerary that has been submitted to this Table if anything has been submitted. Otherwise it will only include the submissions that underlie this table.
-
ParticipantId
participant
() const¶ The participant that is meant to submit to this Table.
-
const VersionedKeySequence &
sequence
() const¶ The sequence key that refers to this table. This is equivalent to [to_accommodate…, for_participant]
-
std::vector<ParticipantId>
unversioned_sequence
() const¶ The versioned sequence key that refers to this table.
-
bool
submit
(PlanId plan_id, std::vector<Route> itinerary, Version version)¶ Submit a proposal for a participant that accommodates some of the other participants in the negotiation (or none if an empty vector is given for the to_accommodate argument).
- Return
True if the submission was accepted. False if the version was out of date and nothing changed in the negotiation.
- Parameters
[in] plan_id
: A unique identifier for this plan. If this plan is selected by the negotiation, then this ID will be submitted to the traffic schedule as the PlanId for this participant.[in] itinerary
: The itinerary that is being submitted by this participant.[in] version
: A version number assigned to the submission. If this is less or equal to the last version number given, then nothing will change.
-
bool
reject
(Version version, ParticipantId rejected_by, Alternatives alternatives)¶ Reject the submission of this Negotiation::Table. This indicates that the underlying proposals are infeasible for the Participant of this Table to accommodate. The rejecter should give a set of alternative rollouts that it is capable of. That way the proposer for this Table can submit an itinerary that accommodates it.
- Return
True if the rejection was accepted. False if the version was out of date and nothing changed in the negotiation.
- Parameters
[in] version
: A version number assigned to the submission. If this is equal to or greater than the last version number given, then this table will be put into a rejected state until a higher proposal version is submitted.[in] rejected_by
: The participant who is rejecting this proposal[in] alternatives
: A set of rollouts that could be used by the participant that is rejecting this proposal. The proposer should use this information to offer a proposal that can accommodate at least one of these rollouts.
-
void
forfeit
(Version version)¶ Give up on this Negotiation Table. This should be called when the participant that is supposed to submit to this Table is unable to find a feasible proposal.
-
bool
defunct
() const¶ Returns true if any of this table’s ancestors were rejected or forfeited. When that happens, this Table will no longer have any effect on the Negotiation.
-
TablePtr
respond
(ParticipantId by_participant)¶ If by_participant can respond to this table, then this will return a TablePtr that by_participant can submit a proposal to.
If this function is called before anything has been submitted to this Table, then it will certainly return a nullptr.
-
ConstTablePtr
respond
(ParticipantId by_participant) const¶
-
ConstTablePtr
parent
() const¶
-
std::vector<ConstTablePtr>
children
() const¶
-
bool
ongoing
() const¶ Return true if the negotiation is ongoing (i.e. the Negotiation instance that created this table is still alive). When the Negotiation instance that this Table belongs to has destructed, this will begin to return false.
-
class
Viewer
¶ Public Types
-
using
AlternativeMap
= std::unordered_map<ParticipantId, std::shared_ptr<Alternatives>>¶
Public Functions
-
View
query
(const Query::Spacetime ¶meters, const VersionedKeySequence &alternatives) const¶ View this table with the given parameters.
- Parameters
[in] parameters
: The spacetime parameters to filter irrelevant routes out of the view[in] rollouts
: The selection of which rollout alternatives should be viewed for the participants who have rejected this proposal in the past.
-
std::unordered_map<ParticipantId, Endpoint>
initial_endpoints
(const VersionedKeySequence &alternatives) const¶ Get the set of initial waypoints for the negotiation participants.
-
std::unordered_map<ParticipantId, Endpoint>
final_endpoints
(const VersionedKeySequence &alterantives) const¶ Get the set of final waypoints for the negotiation participants.
-
const AlternativeMap &
alternatives
() const¶ When a Negotiation::Table is rejected by one of the participants who is supposed to respond, they can offer a set of rollout alternatives. If the proposer can accommodate one of the alternatives for each responding participant, then the negotiation might be able to proceed. This map gives the alternatives for each participant that has provided them.
-
std::shared_ptr<const ParticipantDescription>
get_description
(ParticipantId participant_id) const¶ Get the description of a participant in this Viewer.
-
ParticipantId
participant_id
() const¶ Get the Participant ID of the participant who should submit to this table.
-
rmf_utils::optional<ParticipantId>
parent_id
() const¶ If the Table has a parent, get its Participant ID.
-
const VersionedKeySequence &
sequence
() const¶ The sequence of the table that is being viewed.
-
bool
defunct
() const¶ Returns true if the table of this viewer is no longer relevant. Unlike the other fields of the Viewer, this is not a snapshot of the table’s state when the Viewer was created; instead this defunct status will remain in sync with the state of the source Table.
-
const Itinerary *
submission
() const¶ Return the submission on this Negotiation Table if it has one.
-
class
Endpoint
¶ View the first or last (depending on context) waypoint in a negotiation participant’s itinerary or alternative.
Public Functions
-
ParticipantId
participant
() const¶ The ID of the participant.
-
const rmf_traffic::Trajectory::Waypoint &
waypoint
() const¶ The first or last (depending on context) waypoint.
-
const std::string &
map
() const¶ The map that the endpoint is on.
-
const ParticipantDescription &
description
() const¶ The description of the participant.
-
ParticipantId
-
using
-
ViewerPtr
-
struct
VersionedKey
¶ This struct is used to select a child table, demaning a specific version.
Public Functions
-
inline bool
operator==
(const VersionedKey &other) const¶
-
inline bool
operator!=
(const VersionedKey &other) const¶
-
inline bool
-
enum
Class Negotiation::Evaluator¶
Defined in File Negotiation.hpp
Nested Relationships¶
This class is a nested type of Class Negotiation.
Inheritance Relationships¶
public rmf_traffic::schedule::QuickestFinishEvaluator
(Class QuickestFinishEvaluator)
Class Documentation¶
-
class
rmf_traffic::schedule::Negotiation
::
Evaluator
A pure abstract interface class for choosing the best proposal.
Subclassed by rmf_traffic::schedule::QuickestFinishEvaluator
Class Negotiation::Table¶
Defined in File Negotiation.hpp
Nested Relationships¶
This class is a nested type of Class Negotiation.
Inheritance Relationships¶
public std::enable_shared_from_this< Table >
Class Documentation¶
-
class
rmf_traffic::schedule::Negotiation
::
Table
: public std::enable_shared_from_this<Table> The Negotiation::Table class gives a view of what the other negotiation participants have proposed.
A Table instance is meant to be viewed by a specific participant and displays the proposals of other participants for a specific hierarchies of accommodations. See the documentation of Negotiation::table().
Alongside the views of the other Negotiation participants, the View provided by the Table instance will show the itineraries of schedule participants that are not part of the Negotiation. That way the external itineraries can also be accounted for when planning a submission based on this Table.
Public Types
-
using
ViewerPtr
= std::shared_ptr<const Viewer>
Public Functions
-
ViewerPtr
viewer
() const Get a viewer for this Table. The Viewer can be safely used across multiple threads.
-
const Itinerary *
submission
() const Return the submission on this Negotiation Table if it has one.
-
Version
version
() const The a pointer to the latest itinerary version that was submitted to this table, if one was submitted at all.
-
const Proposal &
proposal
() const The proposal on this table so far. This will include the latest itinerary that has been submitted to this Table if anything has been submitted. Otherwise it will only include the submissions that underlie this table.
-
ParticipantId
participant
() const The participant that is meant to submit to this Table.
-
const VersionedKeySequence &
sequence
() const The sequence key that refers to this table. This is equivalent to [to_accommodate…, for_participant]
-
std::vector<ParticipantId>
unversioned_sequence
() const The versioned sequence key that refers to this table.
-
bool
submit
(PlanId plan_id, std::vector<Route> itinerary, Version version) Submit a proposal for a participant that accommodates some of the other participants in the negotiation (or none if an empty vector is given for the to_accommodate argument).
- Return
True if the submission was accepted. False if the version was out of date and nothing changed in the negotiation.
- Parameters
[in] plan_id
: A unique identifier for this plan. If this plan is selected by the negotiation, then this ID will be submitted to the traffic schedule as the PlanId for this participant.[in] itinerary
: The itinerary that is being submitted by this participant.[in] version
: A version number assigned to the submission. If this is less or equal to the last version number given, then nothing will change.
-
bool
reject
(Version version, ParticipantId rejected_by, Alternatives alternatives) Reject the submission of this Negotiation::Table. This indicates that the underlying proposals are infeasible for the Participant of this Table to accommodate. The rejecter should give a set of alternative rollouts that it is capable of. That way the proposer for this Table can submit an itinerary that accommodates it.
- Return
True if the rejection was accepted. False if the version was out of date and nothing changed in the negotiation.
- Parameters
[in] version
: A version number assigned to the submission. If this is equal to or greater than the last version number given, then this table will be put into a rejected state until a higher proposal version is submitted.[in] rejected_by
: The participant who is rejecting this proposal[in] alternatives
: A set of rollouts that could be used by the participant that is rejecting this proposal. The proposer should use this information to offer a proposal that can accommodate at least one of these rollouts.
-
bool
rejected
() const Returns true if the proposal put on this Table has been rejected.
-
void
forfeit
(Version version) Give up on this Negotiation Table. This should be called when the participant that is supposed to submit to this Table is unable to find a feasible proposal.
-
bool
forfeited
() const Returns true if the proposer for this Table has forfeited.
-
bool
defunct
() const Returns true if any of this table’s ancestors were rejected or forfeited. When that happens, this Table will no longer have any effect on the Negotiation.
-
TablePtr
respond
(ParticipantId by_participant) If by_participant can respond to this table, then this will return a TablePtr that by_participant can submit a proposal to.
If this function is called before anything has been submitted to this Table, then it will certainly return a nullptr.
-
ConstTablePtr
respond
(ParticipantId by_participant) const
-
ConstTablePtr
parent
() const
-
std::vector<ConstTablePtr>
children
() const
-
bool
ongoing
() const Return true if the negotiation is ongoing (i.e. the Negotiation instance that created this table is still alive). When the Negotiation instance that this Table belongs to has destructed, this will begin to return false.
-
class
Viewer
Public Types
-
using
AlternativeMap
= std::unordered_map<ParticipantId, std::shared_ptr<Alternatives>>
Public Functions
-
View
query
(const Query::Spacetime ¶meters, const VersionedKeySequence &alternatives) const View this table with the given parameters.
- Parameters
[in] parameters
: The spacetime parameters to filter irrelevant routes out of the view[in] rollouts
: The selection of which rollout alternatives should be viewed for the participants who have rejected this proposal in the past.
-
std::unordered_map<ParticipantId, Endpoint>
initial_endpoints
(const VersionedKeySequence &alternatives) const Get the set of initial waypoints for the negotiation participants.
-
std::unordered_map<ParticipantId, Endpoint>
final_endpoints
(const VersionedKeySequence &alterantives) const Get the set of final waypoints for the negotiation participants.
-
const AlternativeMap &
alternatives
() const When a Negotiation::Table is rejected by one of the participants who is supposed to respond, they can offer a set of rollout alternatives. If the proposer can accommodate one of the alternatives for each responding participant, then the negotiation might be able to proceed. This map gives the alternatives for each participant that has provided them.
-
const Proposal &
base_proposals
() const The proposals submitted to the predecessor tables.
-
std::shared_ptr<const ParticipantDescription>
get_description
(ParticipantId participant_id) const Get the description of a participant in this Viewer.
-
ParticipantId
participant_id
() const Get the Participant ID of the participant who should submit to this table.
-
rmf_utils::optional<ParticipantId>
parent_id
() const If the Table has a parent, get its Participant ID.
-
const VersionedKeySequence &
sequence
() const The sequence of the table that is being viewed.
-
bool
defunct
() const Returns true if the table of this viewer is no longer relevant. Unlike the other fields of the Viewer, this is not a snapshot of the table’s state when the Viewer was created; instead this defunct status will remain in sync with the state of the source Table.
-
bool
rejected
() const Returns true if the proposal put on this Table has been rejected.
-
bool
forfeited
() const Returns true if the proposer for this Table has forfeited.
-
const Itinerary *
submission
() const Return the submission on this Negotiation Table if it has one.
-
std::optional<rmf_traffic::Time>
earliest_base_proposal_time
() const The earliest start time of any of the proposals in the table.
-
std::optional<rmf_traffic::Time>
latest_base_proposal_time
() const The latest finish time of any of the proposals in the table.
-
class
Endpoint
View the first or last (depending on context) waypoint in a negotiation participant’s itinerary or alternative.
Public Functions
-
ParticipantId
participant
() const The ID of the participant.
-
PlanId
plan_id
() const The ID of the plan for this endpoint.
-
RouteId
route_id
() const The ID of the route for this endpoint.
-
const rmf_traffic::Trajectory::Waypoint &
waypoint
() const The first or last (depending on context) waypoint.
-
const std::string &
map
() const The map that the endpoint is on.
-
const ParticipantDescription &
description
() const The description of the participant.
-
ParticipantId
-
using
-
using
Class Table::Viewer¶
Defined in File Negotiation.hpp
Nested Relationships¶
This class is a nested type of Class Negotiation::Table.
Class Documentation¶
-
class
rmf_traffic::schedule::Negotiation::Table
::
Viewer
Public Types
-
using
AlternativeMap
= std::unordered_map<ParticipantId, std::shared_ptr<Alternatives>>
Public Functions
-
View
query
(const Query::Spacetime ¶meters, const VersionedKeySequence &alternatives) const View this table with the given parameters.
- Parameters
[in] parameters
: The spacetime parameters to filter irrelevant routes out of the view[in] rollouts
: The selection of which rollout alternatives should be viewed for the participants who have rejected this proposal in the past.
-
std::unordered_map<ParticipantId, Endpoint>
initial_endpoints
(const VersionedKeySequence &alternatives) const Get the set of initial waypoints for the negotiation participants.
-
std::unordered_map<ParticipantId, Endpoint>
final_endpoints
(const VersionedKeySequence &alterantives) const Get the set of final waypoints for the negotiation participants.
-
const AlternativeMap &
alternatives
() const When a Negotiation::Table is rejected by one of the participants who is supposed to respond, they can offer a set of rollout alternatives. If the proposer can accommodate one of the alternatives for each responding participant, then the negotiation might be able to proceed. This map gives the alternatives for each participant that has provided them.
-
const Proposal &
base_proposals
() const The proposals submitted to the predecessor tables.
-
std::shared_ptr<const ParticipantDescription>
get_description
(ParticipantId participant_id) const Get the description of a participant in this Viewer.
-
ParticipantId
participant_id
() const Get the Participant ID of the participant who should submit to this table.
-
rmf_utils::optional<ParticipantId>
parent_id
() const If the Table has a parent, get its Participant ID.
-
const VersionedKeySequence &
sequence
() const The sequence of the table that is being viewed.
-
bool
defunct
() const Returns true if the table of this viewer is no longer relevant. Unlike the other fields of the Viewer, this is not a snapshot of the table’s state when the Viewer was created; instead this defunct status will remain in sync with the state of the source Table.
-
bool
rejected
() const Returns true if the proposal put on this Table has been rejected.
-
bool
forfeited
() const Returns true if the proposer for this Table has forfeited.
-
const Itinerary *
submission
() const Return the submission on this Negotiation Table if it has one.
-
std::optional<rmf_traffic::Time>
earliest_base_proposal_time
() const The earliest start time of any of the proposals in the table.
-
std::optional<rmf_traffic::Time>
latest_base_proposal_time
() const The latest finish time of any of the proposals in the table.
-
class
Endpoint
View the first or last (depending on context) waypoint in a negotiation participant’s itinerary or alternative.
Public Functions
-
ParticipantId
participant
() const The ID of the participant.
-
PlanId
plan_id
() const The ID of the plan for this endpoint.
-
RouteId
route_id
() const The ID of the route for this endpoint.
-
const rmf_traffic::Trajectory::Waypoint &
waypoint
() const The first or last (depending on context) waypoint.
-
const std::string &
map
() const The map that the endpoint is on.
-
const ParticipantDescription &
description
() const The description of the participant.
-
ParticipantId
-
using
Class Viewer::Endpoint¶
Defined in File Negotiation.hpp
Nested Relationships¶
This class is a nested type of Class Table::Viewer.
Class Documentation¶
-
class
rmf_traffic::schedule::Negotiation::Table::Viewer
::
Endpoint
View the first or last (depending on context) waypoint in a negotiation participant’s itinerary or alternative.
Public Functions
-
ParticipantId
participant
() const The ID of the participant.
-
PlanId
plan_id
() const The ID of the plan for this endpoint.
-
RouteId
route_id
() const The ID of the route for this endpoint.
-
const rmf_traffic::Trajectory::Waypoint &
waypoint
() const The first or last (depending on context) waypoint.
-
const std::string &
map
() const The map that the endpoint is on.
-
const ParticipantDescription &
description
() const The description of the participant.
-
ParticipantId
Class Negotiator¶
Defined in File Negotiator.hpp
Nested Relationships¶
Inheritance Relationships¶
public rmf_traffic::agv::SimpleNegotiator
(Class SimpleNegotiator)public rmf_traffic::schedule::StubbornNegotiator
(Class StubbornNegotiator)
Class Documentation¶
-
class
rmf_traffic::schedule
::
Negotiator
¶ A pure abstract interface class that facilitates negotiating a resolution to a schedule conflict. An example implementation of this class can be found as rmf_traffic::agv::Negotiator.
Subclassed by rmf_traffic::agv::SimpleNegotiator, rmf_traffic::schedule::StubbornNegotiator
Public Types
-
using
TableViewerPtr
= Negotiation::Table::ViewerPtr¶
Public Functions
-
virtual void
respond
(const TableViewerPtr &table_viewer, const ResponderPtr &responder) = 0¶ Have the Negotiator respond to an attempt to negotiate.
- Parameters
[in] table
: The Negotiation::Table that is being used for the negotiation.[in] responder
: The Responder instance that the negotiator should use when a response is ready.[in] interrupt_flag
: A pointer to a flag that can be used to interrupt the negotiator if it has been running for too long. If the planner should run indefinitely, then pass a nullptr.
-
virtual
~Negotiator
() = default¶
-
class
Responder
¶ A pure abstract interface class that allows the Negotiator to respond to other Negotiators.
Subclassed by rmf_traffic::schedule::SimpleResponder
Public Types
-
using
ParticipantId
= rmf_traffic::schedule::ParticipantId¶
-
using
ItineraryVersion
= rmf_traffic::schedule::ItineraryVersion¶
-
using
UpdateVersion
= rmf_utils::optional<ItineraryVersion>¶
-
using
ApprovalCallback
= std::function<UpdateVersion()>¶
-
using
Alternatives
= Negotiation::Alternatives¶
Public Functions
-
virtual void
submit
(PlanId plan_id, std::vector<Route> itinerary, ApprovalCallback approval_callback = nullptr) const = 0¶ The negotiator will call this function when it has an itinerary to submit in response to a negotiation.
- Parameters
[in] plan_id
: A unique ID that refers to the plan that is being submitted.[in] itinerary
: The itinerary that is being proposed[in] approval_callback
: This callback will get triggered if this submission gets approved. The return value of the callback should be the itinerary version of the participant update that will follow the resolution of this negotiation (or a nullopt if no update will be performed). Pass in a nullptr if an approval callback is not necessary.
-
virtual void
reject
(const Alternatives &alternatives) const = 0¶ The negotiator will call this function if it has decided to reject an attempt to negotiate. It must supply a set of alternatives for the parent negotiator to consider for its next proposal.
-
virtual void
forfeit
(const std::vector<ParticipantId> &blockers) const = 0¶ The negotiator will call this function if it cannot find any feasible proposal or alternative that can be accommodated by the parent.
- Parameters
[in] blockers
: Give the set of schedule participants that are blocking a solution from being found.
-
virtual
~Responder
() = default¶
-
using
-
using
Class Negotiator::Responder¶
Defined in File Negotiator.hpp
Nested Relationships¶
This class is a nested type of Class Negotiator.
Inheritance Relationships¶
public rmf_traffic::schedule::SimpleResponder
(Class SimpleResponder)
Class Documentation¶
-
class
rmf_traffic::schedule::Negotiator
::
Responder
A pure abstract interface class that allows the Negotiator to respond to other Negotiators.
Subclassed by rmf_traffic::schedule::SimpleResponder
Public Types
-
using
ParticipantId
= rmf_traffic::schedule::ParticipantId
-
using
ItineraryVersion
= rmf_traffic::schedule::ItineraryVersion
-
using
UpdateVersion
= rmf_utils::optional<ItineraryVersion>
-
using
ApprovalCallback
= std::function<UpdateVersion()>
-
using
Alternatives
= Negotiation::Alternatives
Public Functions
-
virtual void
submit
(PlanId plan_id, std::vector<Route> itinerary, ApprovalCallback approval_callback = nullptr) const = 0 The negotiator will call this function when it has an itinerary to submit in response to a negotiation.
- Parameters
[in] plan_id
: A unique ID that refers to the plan that is being submitted.[in] itinerary
: The itinerary that is being proposed[in] approval_callback
: This callback will get triggered if this submission gets approved. The return value of the callback should be the itinerary version of the participant update that will follow the resolution of this negotiation (or a nullopt if no update will be performed). Pass in a nullptr if an approval callback is not necessary.
-
virtual void
reject
(const Alternatives &alternatives) const = 0 The negotiator will call this function if it has decided to reject an attempt to negotiate. It must supply a set of alternatives for the parent negotiator to consider for its next proposal.
-
virtual void
forfeit
(const std::vector<ParticipantId> &blockers) const = 0 The negotiator will call this function if it cannot find any feasible proposal or alternative that can be accommodated by the parent.
- Parameters
[in] blockers
: Give the set of schedule participants that are blocking a solution from being found.
-
virtual
~Responder
() = default
-
using
Class ParticipantDescription¶
Defined in File ParticipantDescription.hpp
Class Documentation¶
-
class
rmf_traffic::schedule
::
ParticipantDescription
¶ Public Types
-
enum
Rx
¶ Enumeration for responsiveness.
Values:
-
enumerator
Invalid
¶ This responsiveness type is illegal and will always be rejected by the schedule verifier. Having this movement type implies a major bug in the code and should be reported immediately.
-
enumerator
Unresponsive
¶ The participant will not respond to any conflicts.
-
enumerator
Responsive
¶ The participant will try to respond to conflicts.
-
enumerator
Public Functions
-
ParticipantDescription
(std::string name, std::string owner, Rx responsiveness, Profile profile)¶ Constructor
- Parameters
[in] name
: The name of the object participating in the schedule.[in] owner
: The name of the “owner” of this participant. This does not currently have a formal definition, but for most vehicles it should be the name of the fleet that the vehicle belongs to.[in] responsiveness
: What category of responsiveness this participant has. A Responsive participant might be able to react to a conflict or a request for accommodations.
-
bool
operator==
(const ParticipantDescription &rhs) const¶ Equality operator.
-
bool
operator!=
(const ParticipantDescription &rhs) const¶ Inequality operator.
-
ParticipantDescription &
name
(std::string value)¶ Set the name of the participant.
-
const std::string &
name
() const¶ Get the name of the participant.
-
ParticipantDescription &
owner
(std::string value)¶ Set the name of the “owner” of the participant.
-
const std::string &
owner
() const¶ Get the name of the “owner” of the participant.
-
ParticipantDescription &
responsiveness
(Rx value)¶ Set the responsiveness of the participant.
-
ParticipantDescription &
profile
(Profile new_profile)¶ Set the profile of the participant.
-
enum
Class Patch¶
Defined in File Patch.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic::schedule
::
Patch
¶ A container of Database changes.
Public Types
-
using
base_iterator
= rmf_traffic::detail::bidirectional_iterator<E, I, F>¶
-
using
const_iterator
= base_iterator<const Participant, IterImpl, Patch>¶
Public Functions
-
Patch
(std::vector<Participant> changes, rmf_utils::optional<Change::Cull> cull, std::optional<Version> base_version, Version latest_version)¶ Constructor. Mirrors should evaluate the fields of the Patch class in the order of these constructor arguments.
- Parameters
[in] changes
: Information about how the participants have changed since the last update.[in] cull
: Information about how the database has culled old data since the last update.[in] base_version
: The base version of the database that this Patch builds on top of.[in] latest_version
: The lastest version of the database that this Patch represents.
-
const_iterator
begin
() const¶ Returns an iterator to the first element of the Patch.
-
const_iterator
end
() const¶ Returns an iterator to the element following the last element of the Patch. This iterator acts as a placeholder; attempting to dereference it results in undefined behavior.
-
class
Participant
¶ Public Functions
-
Participant
(ParticipantId id, ItineraryVersion itinerary_version, Change::Erase erasures, std::vector<Change::Delay> delays, Change::Add additions, std::optional<Change::Progress> progress)¶ Constructor
- Parameters
[in] id
: The ID of the participant that is being changed[in] itinerary_version
: The version of this participant’s itinerary that results from applying this patch[in] erasures
: The information about which routes to erase[in] delays
: The information about what delays have occurred[in] additions
: The information about which routes to add[in] progress
: Information about progress that the participant has made since the last change, if any.
-
ParticipantId
participant_id
() const¶ The ID of the participant that this set of changes will patch.
-
ItineraryVersion
itinerary_version
() const¶ The itinerary version that results from this patch.
-
const Change::Erase &
erasures
() const¶ The route erasures to perform.
These erasures should be performed before any other changes.
-
const std::vector<Change::Delay> &
delays
() const¶ The sequence of delays to apply.
These delays should be applied in sequential order after the erasures are performed, and before any additions are performed.
-
-
using
Class Patch::Participant¶
Defined in File Patch.hpp
Nested Relationships¶
This class is a nested type of Class Patch.
Class Documentation¶
-
class
rmf_traffic::schedule::Patch
::
Participant
Public Functions
-
Participant
(ParticipantId id, ItineraryVersion itinerary_version, Change::Erase erasures, std::vector<Change::Delay> delays, Change::Add additions, std::optional<Change::Progress> progress) Constructor
- Parameters
[in] id
: The ID of the participant that is being changed[in] itinerary_version
: The version of this participant’s itinerary that results from applying this patch[in] erasures
: The information about which routes to erase[in] delays
: The information about what delays have occurred[in] additions
: The information about which routes to add[in] progress
: Information about progress that the participant has made since the last change, if any.
-
ParticipantId
participant_id
() const The ID of the participant that this set of changes will patch.
-
ItineraryVersion
itinerary_version
() const The itinerary version that results from this patch.
-
const Change::Erase &
erasures
() const The route erasures to perform.
These erasures should be performed before any other changes.
-
const std::vector<Change::Delay> &
delays
() const The sequence of delays to apply.
These delays should be applied in sequential order after the erasures are performed, and before any additions are performed.
-
Class Query¶
Defined in File Query.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic::schedule
::
Query
¶ A class to define a query into a schedule database.
Public Types
-
using
base_iterator
= rmf_traffic::detail::bidirectional_iterator<E, I, F>¶
Public Functions
-
const Spacetime &
spacetime
() const¶ const-qualified spacetime()
-
Participants &
participants
()¶ Get the Participants component of this Query.
-
const Participants &
participants
() const¶ const-qualified participants()
-
class
Participants
¶ A class to describe a filter on which schedule participants to pay attention to.
Public Types
Public Functions
-
Mode
get_mode
() const¶ Get the mode for this Participants filter.
-
All *
all
()¶ Get the All interface if this Participants filter is in All mode, otherwise get a nullptr.
-
Include *
include
()¶ Get the Include interface if this Participants filter is in Include mode, otherwise get a nullptr.
-
Participants &
include
(std::vector<ParticipantId> ids)¶ Change this filter to Include mode, and include the specified participant IDs.
-
Exclude *
exclude
()¶ Get the Exclude interface if this Participants filter is in Exclude mode, otherwise get a nullptr.
-
Participants &
exclude
(std::vector<ParticipantId> ids)¶ Change this filter to Exclude mode, and exclude the specified participant IDs.
Public Static Functions
-
static const Participants &
make_all
()¶ Constructor to use All mode.
-
static Participants
make_only
(std::vector<ParticipantId> ids)¶ Constructor to use Include mode.
- Parameters
[in] ids
: The IDs of the participants that should be included in the query.
-
static Participants
make_all_except
(std::vector<ParticipantId> ids)¶ Constructor to use Exclude mode.
- Parameters
[in] ids
: The IDs of the participants that should be excluded from the query.
-
class
All
This is a placeholder class in case we ever want to extend the features of the
All
mode.
-
class
Exclude
The interface for the Participants::Exclude mode.
Public Functions
-
Exclude
(std::vector<ParticipantId> ids)¶ Constructor.
-
const std::vector<ParticipantId> &
get_ids
() const¶ Get the IDs of the participants that should be excluded.
-
Exclude &
set_ids
(std::vector<ParticipantId> ids)¶ Set the IDs of the participants that should be excluded.
-
-
class
Include
The interface for the Participants::Include mode.
Public Functions
-
Include
(std::vector<ParticipantId> ids)¶ Constructor.
-
const std::vector<ParticipantId> &
get_ids
() const¶ Get the IDs of the participants that should be included.
-
Include &
set_ids
(std::vector<ParticipantId> ids)¶ Set the IDs of the participants that should be included.
-
-
Mode
-
class
Spacetime
¶ A class to describe spacetime filters for a schedule Query.
Public Types
-
enum
Mode
¶ This enumerator determines what Spacetime mode the query will be in.
Values:
-
enumerator
Invalid
¶ Invalid mode, behavior is undefined.
-
enumerator
All
¶ Request trajectories throughout all of space and time. This will still be constrained by the version field.
-
enumerator
Regions
¶ Request trajectories in specific regions spacetime regions.
-
enumerator
Timespan
¶ Request trajectories that are active in a specified timespan.
-
enumerator
Public Functions
-
Spacetime
(std::vector<Region> regions)¶ Regions mode constructor.
- Parameters
[in] regions
: The regions to use
-
Spacetime
(std::vector<std::string> maps)¶ Timespan mode constructor.
This will query all trajectories across all time for the specified maps.
- Parameters
[in] maps
: The maps to query from
-
Spacetime
(std::vector<std::string> maps, Time lower_bound)¶ Timespan mode constructor.
This will query all trajectories that have at least one waypoint active after the lower bound on the specified maps.
- Parameters
[in] maps
: The maps to query from[in] lower_bound
: The lower bound on time
-
Spacetime
(std::vector<std::string> maps, Time lower_bound, Time upper_bound)¶ Timespan mode constructor.
This will query all trajectories that have at least one waypoint active after the lower bound and before the upper bound on the specified maps.
- Parameters
[in] maps
: The maps to query from[in] lower_bound
: The lower bound on time[in] upper_bound
: The upper bound on time
-
All &
query_all
()¶ Set the mode of this Spacetime to query for All Trajectories throughout Spacetime.
-
Regions &
query_regions
(std::vector<Region> regions = {})¶ Set the mode of this Spacetime to query for specific Regions.
- Parameters
[in] regions
: Specify the regions of Spacetime to use.
-
Regions *
regions
()¶ Get the Regions of Spacetime to use for this Query. If this Spacetime is not in Regions mode, then this will return a nullptr.
-
Timespan &
query_timespan
(std::vector<std::string> maps, Time lower_bound, Time upper_bound)¶ Query a timespan between two bounds for a set of maps.
-
Timespan &
query_timespan
(std::vector<std::string> maps, Time lower_bound)¶ Query from a lower bound in time for a set of maps.
-
Timespan &
query_timespan
(std::vector<std::string> maps)¶ Query for all trajectories on a set of maps.
-
Timespan &
query_timespan
(bool query_all_maps = true)¶ Switch to timespan mode, and specify whether or not to use all maps.
-
Timespan *
timespan
()¶ Get the Timespan of Spacetime to use for this Query. If this Spacetime is not in Timespan mode, then this will return a nullptr.
-
const Timespan *
timespan
() const¶ const-qualified timespan()
-
class
All
This is a placeholder class in case we ever want to extend the features of the
All
mode.
-
class
Regions
A container class for rmf_traffic::Region instances. Using Regions mode will query for Trajectories that intersect the specified regions.
Public Types
-
using
iterator
= base_iterator<Region, IterImpl, Regions>¶
-
using
const_iterator
= base_iterator<const Region, IterImpl, Regions>¶
Public Functions
-
const_iterator
begin
() const¶ const-qualified begin()
-
const_iterator
cbegin
() const¶ Explicitly const-qualified alternative to begin()
-
const_iterator
end
() const¶ const-qualified end()
-
const_iterator
cend
() const¶ Explicitly const-qualified alternative to end()
-
using
-
class
Timespan
A class for specifying a timespan.
Public Functions
-
const std::unordered_set<std::string> &
maps
() const¶ Get the maps that will be queried.
-
bool
all_maps
() const¶ Returns true if all maps should be queried. If true, the set of maps mentioned above will be ignored.
-
Timespan &
all_maps
(bool query_all_maps)¶ Set whether all maps should be queried. When true, the set of maps above will be ignored. When false, only the maps in the set above will be included in the query.
-
const Time *
get_lower_time_bound
() const¶ Get the lower bound for the time range.
If there is no lower bound for the time range, then this returns a nullptr.
-
const std::unordered_set<std::string> &
-
enum
-
using
Class Query::Participants¶
Defined in File Query.hpp
Nested Relationships¶
This class is a nested type of Class Query.
Class Documentation¶
-
class
rmf_traffic::schedule::Query
::
Participants
A class to describe a filter on which schedule participants to pay attention to.
Public Types
-
enum
Mode
Values:
-
enumerator
Invalid
Invalid mode, behavior is undefined.
-
enumerator
All
Get all participants.
-
enumerator
Include
Get only the participants listed.
-
enumerator
Exclude
Get all participants except the ones listed.
-
enumerator
Public Functions
-
Participants
() Default constructor, uses All mode.
-
Mode
get_mode
() const Get the mode for this Participants filter.
-
All *
all
() Get the All interface if this Participants filter is in All mode, otherwise get a nullptr.
-
Include *
include
() Get the Include interface if this Participants filter is in Include mode, otherwise get a nullptr.
-
Participants &
include
(std::vector<ParticipantId> ids) Change this filter to Include mode, and include the specified participant IDs.
-
Exclude *
exclude
() Get the Exclude interface if this Participants filter is in Exclude mode, otherwise get a nullptr.
-
Participants &
exclude
(std::vector<ParticipantId> ids) Change this filter to Exclude mode, and exclude the specified participant IDs.
Public Static Functions
-
static const Participants &
make_all
() Constructor to use All mode.
-
static Participants
make_only
(std::vector<ParticipantId> ids) Constructor to use Include mode.
- Parameters
[in] ids
: The IDs of the participants that should be included in the query.
-
static Participants
make_all_except
(std::vector<ParticipantId> ids) Constructor to use Exclude mode.
- Parameters
[in] ids
: The IDs of the participants that should be excluded from the query.
-
class
All
This is a placeholder class in case we ever want to extend the features of the
All
mode.
-
class
Exclude
The interface for the Participants::Exclude mode.
Public Functions
-
Exclude
(std::vector<ParticipantId> ids) Constructor.
-
const std::vector<ParticipantId> &
get_ids
() const Get the IDs of the participants that should be excluded.
-
Exclude &
set_ids
(std::vector<ParticipantId> ids) Set the IDs of the participants that should be excluded.
-
-
class
Include
The interface for the Participants::Include mode.
Public Functions
-
Include
(std::vector<ParticipantId> ids) Constructor.
-
const std::vector<ParticipantId> &
get_ids
() const Get the IDs of the participants that should be included.
-
Include &
set_ids
(std::vector<ParticipantId> ids) Set the IDs of the participants that should be included.
-
-
enum
Class Participants::All¶
Defined in File Query.hpp
Nested Relationships¶
This class is a nested type of Class Query::Participants.
Class Documentation¶
-
class
All
This is a placeholder class in case we ever want to extend the features of the
All
mode.
Class Participants::Exclude¶
Defined in File Query.hpp
Nested Relationships¶
This class is a nested type of Class Query::Participants.
Class Documentation¶
-
class
rmf_traffic::schedule::Query::Participants
::
Exclude
The interface for the Participants::Exclude mode.
Public Functions
-
Exclude
(std::vector<ParticipantId> ids) Constructor.
-
const std::vector<ParticipantId> &
get_ids
() const Get the IDs of the participants that should be excluded.
-
Exclude &
set_ids
(std::vector<ParticipantId> ids) Set the IDs of the participants that should be excluded.
-
Class Participants::Include¶
Defined in File Query.hpp
Nested Relationships¶
This class is a nested type of Class Query::Participants.
Class Documentation¶
-
class
rmf_traffic::schedule::Query::Participants
::
Include
The interface for the Participants::Include mode.
Public Functions
-
Include
(std::vector<ParticipantId> ids) Constructor.
-
const std::vector<ParticipantId> &
get_ids
() const Get the IDs of the participants that should be included.
-
Include &
set_ids
(std::vector<ParticipantId> ids) Set the IDs of the participants that should be included.
-
Class Query::Spacetime¶
Defined in File Query.hpp
Nested Relationships¶
This class is a nested type of Class Query.
Class Documentation¶
-
class
rmf_traffic::schedule::Query
::
Spacetime
A class to describe spacetime filters for a schedule Query.
Public Types
-
enum
Mode
This enumerator determines what Spacetime mode the query will be in.
Values:
-
enumerator
Invalid
Invalid mode, behavior is undefined.
-
enumerator
All
Request trajectories throughout all of space and time. This will still be constrained by the version field.
-
enumerator
Regions
Request trajectories in specific regions spacetime regions.
-
enumerator
Timespan
Request trajectories that are active in a specified timespan.
-
enumerator
-
using
Space
= geometry::Space
Public Functions
-
Spacetime
() Default constructor, uses All mode.
-
Spacetime
(std::vector<Region> regions) Regions mode constructor.
- Parameters
[in] regions
: The regions to use
-
Spacetime
(std::vector<std::string> maps) Timespan mode constructor.
This will query all trajectories across all time for the specified maps.
- Parameters
[in] maps
: The maps to query from
-
Spacetime
(std::vector<std::string> maps, Time lower_bound) Timespan mode constructor.
This will query all trajectories that have at least one waypoint active after the lower bound on the specified maps.
- Parameters
[in] maps
: The maps to query from[in] lower_bound
: The lower bound on time
-
Spacetime
(std::vector<std::string> maps, Time lower_bound, Time upper_bound) Timespan mode constructor.
This will query all trajectories that have at least one waypoint active after the lower bound and before the upper bound on the specified maps.
- Parameters
[in] maps
: The maps to query from[in] lower_bound
: The lower bound on time[in] upper_bound
: The upper bound on time
-
Regions &
query_regions
(std::vector<Region> regions = {}) Set the mode of this Spacetime to query for specific Regions.
- Parameters
[in] regions
: Specify the regions of Spacetime to use.
-
Regions *
regions
() Get the Regions of Spacetime to use for this Query. If this Spacetime is not in Regions mode, then this will return a nullptr.
-
Timespan &
query_timespan
(std::vector<std::string> maps, Time lower_bound, Time upper_bound) Query a timespan between two bounds for a set of maps.
-
Timespan &
query_timespan
(std::vector<std::string> maps, Time lower_bound) Query from a lower bound in time for a set of maps.
-
Timespan &
query_timespan
(std::vector<std::string> maps) Query for all trajectories on a set of maps.
-
Timespan &
query_timespan
(bool query_all_maps = true) Switch to timespan mode, and specify whether or not to use all maps.
-
Timespan *
timespan
() Get the Timespan of Spacetime to use for this Query. If this Spacetime is not in Timespan mode, then this will return a nullptr.
-
const Timespan *
timespan
() const const-qualified timespan()
-
class
All
This is a placeholder class in case we ever want to extend the features of the
All
mode.
-
class
Regions
A container class for rmf_traffic::Region instances. Using Regions mode will query for Trajectories that intersect the specified regions.
Public Types
-
using
iterator
= base_iterator<Region, IterImpl, Regions>
-
using
const_iterator
= base_iterator<const Region, IterImpl, Regions>
Public Functions
-
void
pop_back
() Remove the last Region that was added to this container.
-
iterator
begin
() Get the beginning iterator of this container.
-
const_iterator
begin
() const const-qualified begin()
-
const_iterator
cbegin
() const Explicitly const-qualified alternative to begin()
-
iterator
end
() Get the one-past-the-end iterator of this container.
-
const_iterator
end
() const const-qualified end()
-
const_iterator
cend
() const Explicitly const-qualified alternative to end()
-
using
-
class
Timespan
A class for specifying a timespan.
Public Functions
-
const std::unordered_set<std::string> &
maps
() const Get the maps that will be queried.
-
Timespan &
add_map
(std::string map_name) Add a map to the query.
-
Timespan &
remove_map
(const std::string &map_name) Remove a map from the query.
-
Timespan &
clear_maps
() Remove all maps from the query.
-
bool
all_maps
() const Returns true if all maps should be queried. If true, the set of maps mentioned above will be ignored.
-
Timespan &
all_maps
(bool query_all_maps) Set whether all maps should be queried. When true, the set of maps above will be ignored. When false, only the maps in the set above will be included in the query.
-
const Time *
get_lower_time_bound
() const Get the lower bound for the time range.
If there is no lower bound for the time range, then this returns a nullptr.
-
Timespan &
remove_lower_time_bound
() Remove the lower bound for the time range.
-
const Time *
get_upper_time_bound
() const Get the upper bound for the time range.
If there is no upper bound for the time range, then this returns a nullptr.
-
Timespan &
remove_upper_time_bound
() Remove the upper bound for the time range.
-
const std::unordered_set<std::string> &
-
enum
Class Spacetime::All¶
Defined in File Query.hpp
Nested Relationships¶
This class is a nested type of Class Query::Spacetime.
Class Documentation¶
-
class
All
This is a placeholder class in case we ever want to extend the features of the
All
mode.
Class Spacetime::Regions¶
Defined in File Query.hpp
Nested Relationships¶
This class is a nested type of Class Query::Spacetime.
Class Documentation¶
-
class
rmf_traffic::schedule::Query::Spacetime
::
Regions
A container class for rmf_traffic::Region instances. Using Regions mode will query for Trajectories that intersect the specified regions.
Public Types
-
using
iterator
= base_iterator<Region, IterImpl, Regions>
-
using
const_iterator
= base_iterator<const Region, IterImpl, Regions>
Public Functions
-
void
pop_back
() Remove the last Region that was added to this container.
-
iterator
begin
() Get the beginning iterator of this container.
-
const_iterator
begin
() const const-qualified begin()
-
const_iterator
cbegin
() const Explicitly const-qualified alternative to begin()
-
iterator
end
() Get the one-past-the-end iterator of this container.
-
const_iterator
end
() const const-qualified end()
-
const_iterator
cend
() const Explicitly const-qualified alternative to end()
-
using
Class Spacetime::Timespan¶
Defined in File Query.hpp
Nested Relationships¶
This class is a nested type of Class Query::Spacetime.
Class Documentation¶
-
class
rmf_traffic::schedule::Query::Spacetime
::
Timespan
A class for specifying a timespan.
Public Functions
-
const std::unordered_set<std::string> &
maps
() const Get the maps that will be queried.
-
Timespan &
add_map
(std::string map_name) Add a map to the query.
-
Timespan &
remove_map
(const std::string &map_name) Remove a map from the query.
-
Timespan &
clear_maps
() Remove all maps from the query.
-
bool
all_maps
() const Returns true if all maps should be queried. If true, the set of maps mentioned above will be ignored.
-
Timespan &
all_maps
(bool query_all_maps) Set whether all maps should be queried. When true, the set of maps above will be ignored. When false, only the maps in the set above will be included in the query.
-
const Time *
get_lower_time_bound
() const Get the lower bound for the time range.
If there is no lower bound for the time range, then this returns a nullptr.
-
Timespan &
remove_lower_time_bound
() Remove the lower bound for the time range.
-
const Time *
get_upper_time_bound
() const Get the upper bound for the time range.
If there is no upper bound for the time range, then this returns a nullptr.
-
Timespan &
remove_upper_time_bound
() Remove the upper bound for the time range.
-
const std::unordered_set<std::string> &
Class QuickestFinishEvaluator¶
Defined in File Negotiation.hpp
Inheritance Relationships¶
public rmf_traffic::schedule::Negotiation::Evaluator
(Class Negotiation::Evaluator)
Class Documentation¶
-
class
rmf_traffic::schedule
::
QuickestFinishEvaluator
: public rmf_traffic::schedule::Negotiation::Evaluator¶ An implementation of an evaluator that chooses the proposal that minimizes net delays in completing the itineraries.
Public Functions
-
std::size_t
choose
(const std::vector<const Negotiation::Proposal*> &proposals) const final¶
-
std::size_t
Class RectificationRequester¶
Defined in File Rectifier.hpp
Class Documentation¶
-
class
rmf_traffic::schedule
::
RectificationRequester
¶ RectificationRequester is a pure abstract class which should be implemented for any middlewares that intend to act as transport layers for the scheduling system.
Classes that derive from RectificationRequester do not need to implement any interfaces, but they should practice RAII. The lifecycle of the RectificationRequester will be tied to the Participant that it was created for.
When a schedule database reports an inconsistency for the participant tied to a RectificationRequester instance, the instance should call Rectifier::retransmit() on the Rectifier that was assigned to it.
Public Functions
-
virtual
~RectificationRequester
() = 0¶ This destructor is pure virtual to ensure that a derived class is instantiated.
-
virtual
Class RectificationRequesterFactory¶
Defined in File Rectifier.hpp
Inheritance Relationships¶
public rmf_traffic::schedule::DatabaseRectificationRequesterFactory
(Class DatabaseRectificationRequesterFactory)
Class Documentation¶
-
class
rmf_traffic::schedule
::
RectificationRequesterFactory
¶ The RectificationRequesterFactory is a pure abstract interface class which should be implemented for any middlewares that intend to act as transport layers for the scheduling system.
Subclassed by rmf_traffic::schedule::DatabaseRectificationRequesterFactory
Public Functions
-
virtual std::unique_ptr<RectificationRequester>
make
(Rectifier rectifier, ParticipantId participant_id) = 0¶ Create a RectificationRequester to be held by a Participant
- Parameters
[in] rectifier
: This rectifier can be used by the RectificationRequester to ask the participant to retransmit some of its changes.[in] participant_id
: The ID of the participant that will hold onto this RectificationRequester. This is the same participant that the rectifier will request retransmissions to.
-
virtual
~RectificationRequesterFactory
() = default¶
-
virtual std::unique_ptr<RectificationRequester>
Class Rectifier¶
Defined in File Rectifier.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic::schedule
::
Rectifier
¶ The Rectifier class provides an interface for telling a Participant to rectify an inconsistency in the information received by a database. This rectification protocol is important when the schedule is being managed over an unreliable network.
The Rectifier class can be used by a RectifierRequester to ask a participant to retransmit a range of its past itinerary changes.
Only the Participant class is able to create a Rectifier instance. Users of rmf_traffic cannot instantiate a Rectifier.
Public Functions
-
void
retransmit
(const std::vector<Range> &ranges, ItineraryVersion last_known_itinerary, ProgressVersion last_known_progress)¶ Ask the participant to retransmit the specified range of its itinerary changes.
- Parameters
[in] ranges
: The ranges of missing Itinerary IDs[in] last_known_itinerary
: The last ItineraryVersion known upstream.[in] last_known_progress
: The last ProgressVersion known upstream.
-
void
correct_id
(ParticipantId new_id)¶ Correct the ID of the participant.
-
std::optional<ItineraryVersion>
current_version
() const¶ Get the current ItineraryVersion of the Participant.
-
std::optional<ParticipantId>
get_id
() const¶ Get the ID of the Participant.
-
std::optional<ParticipantDescription>
get_description
() const¶ Get the description of the Participant.
-
struct
Range
¶ A range of itinerary change IDs that is currently missing from a database. All IDs from lower to upper are missing, including lower and upper themselves.
It is undefined behavior if the value given to upper is less than the value given to upper.
Public Members
-
ItineraryVersion
lower
¶ The ID of the first itinerary change in this range that is missing.
-
ItineraryVersion
upper
¶ The ID of the last itinerary change in this range that is missing.
-
ItineraryVersion
-
void
Class SimpleResponder¶
Defined in File Negotiator.hpp
Inheritance Relationships¶
public rmf_traffic::schedule::Negotiator::Responder
(Class Negotiator::Responder)
Class Documentation¶
-
class
rmf_traffic::schedule
::
SimpleResponder
: public rmf_traffic::schedule::Negotiator::Responder¶ A simple implementation of a Negotiator::Responder. It simply passes the result along to the Negotiation.
Public Types
-
using
ApprovalMap
= std::unordered_map<Negotiation::ConstTablePtr, std::function<UpdateVersion()>>¶
-
using
BlockerSet
= std::unordered_set<schedule::ParticipantId>¶
Public Functions
-
SimpleResponder
(const Negotiation::TablePtr &table, std::vector<schedule::ParticipantId> *report_blockers = nullptr)¶ Constructor
- Parameters
[in] table
: The negotiation table that this SimpleResponder is tied to[in] report_blockers
: If the blockers should be reported when a forfeit is given, provide a pointer to a vector of ParticipantIds.
Constructor
- Parameters
[in] table
: The negotiation table that this SimpleResponder is tied to[in] approval_map
: If provided, the responder will store the approval callback in this map[in] blockers
: If provided, the responder will store any solution blockers in this set
-
void
submit
(PlanId plan_id, std::vector<Route> itinerary, std::function<UpdateVersion()> approval_callback = nullptr) const final¶
-
virtual void
reject
(const Negotiation::Alternatives &alternatives) const final¶ The negotiator will call this function if it has decided to reject an attempt to negotiate. It must supply a set of alternatives for the parent negotiator to consider for its next proposal.
-
virtual void
forfeit
(const std::vector<ParticipantId> &blockers) const final¶ The negotiator will call this function if it cannot find any feasible proposal or alternative that can be accommodated by the parent.
- Parameters
[in] blockers
: Give the set of schedule participants that are blocking a solution from being found.
-
const std::vector<ParticipantId> &
blockers
() const¶ Get the blockers that were reported by the Negotiator, if a forfeit was given.
Public Static Functions
-
using
Class Snappable¶
Defined in File Snapshot.hpp
Inheritance Relationships¶
public rmf_traffic::schedule::Database
(Class Database)public rmf_traffic::schedule::Mirror
(Class Mirror)
Class Documentation¶
-
class
rmf_traffic::schedule
::
Snappable
¶ This is a pure abstract interface class that can be inherited by any schedule Viewer that wants to be able to provide a frozen snapshot of its schedule.
Subclassed by rmf_traffic::schedule::Database, rmf_traffic::schedule::Mirror
Class Snapshot¶
Defined in File Snapshot.hpp
Inheritance Relationships¶
public rmf_traffic::schedule::Viewer
(Class Viewer)
Class Documentation¶
Class StubbornNegotiator¶
Defined in File StubbornNegotiator.hpp
Inheritance Relationships¶
public rmf_traffic::schedule::Negotiator
(Class Negotiator)
Class Documentation¶
-
class
rmf_traffic::schedule
::
StubbornNegotiator
: public rmf_traffic::schedule::Negotiator¶ A StubbornNegotiator will only accept plans that accommodate the current itinerary of the
Public Types
-
using
UpdateVersion
= rmf_utils::optional<ItineraryVersion>¶
Public Functions
-
StubbornNegotiator
(const Participant &participant)¶ Constructor
StubbornNegotiator(participant).respond(table_view, responder);
- Note
We take a const-reference to the Participant with the expectation that the Participant instance will outlive this StubbornNegotiator instance. The StubbornNegotiator costs very little to construct, so it is okay to use a pattern like
- Parameters
[in] participant
: The Participant who wants to be stubborn.
Owning Constructor
The StubbornNegotiator instance will now hold a shared reference to the participant to ensure it maintains its lifetime. This constructor should be used in cases where the StubbornNegotiator instance has a prolonged lifecycle.
- Parameters
[in] participant
: The Participant who wants to be stubborn.
-
StubbornNegotiator &
acceptable_waits
(std::vector<Duration> wait_times, std::function<UpdateVersion(Duration wait_time)> approval_cb = nullptr)¶ Add a set of acceptable wait times.
- Parameters
[in] wait_times
: A list of the wait times that would be accepted for negotiation[in] approval_cb
: A callback that will be triggered when the negotiator decides that you need to wait for another participant. The callback will receive the chosen wait duration, and is expected to return the schedule version that will incorporate the given wait time.
-
StubbornNegotiator &
additional_margins
(std::vector<rmf_traffic::Duration> margins)¶ Add some timing margins that will be put into the negotiation submission. This effectively asks other robots to back off somewhat.
- Parameters
[in] margins
: The margins to put into the proposal.
-
virtual void
respond
(const schedule::Negotiation::Table::ViewerPtr &table_viewer, const ResponderPtr &responder) final¶ Have the Negotiator respond to an attempt to negotiate.
- Parameters
[in] table
: The Negotiation::Table that is being used for the negotiation.[in] responder
: The Responder instance that the negotiator should use when a response is ready.[in] interrupt_flag
: A pointer to a flag that can be used to interrupt the negotiator if it has been running for too long. If the planner should run indefinitely, then pass a nullptr.
-
using
Class Viewer¶
Defined in File Viewer.hpp
Nested Relationships¶
Inheritance Relationships¶
public rmf_traffic::schedule::ItineraryViewer
(Class ItineraryViewer)public rmf_traffic::schedule::Snapshot
(Class Snapshot)
Class Documentation¶
-
class
rmf_traffic::schedule
::
Viewer
¶ A pure abstract interface class that allows users to query for itineraries that are in a schedule.
This class cannot be instantiated directly. To get a Viewer, you must instantiate an rmf_traffic::schedule::Database or an rmf_traffic::schedule::Mirror object.
Subclassed by rmf_traffic::schedule::ItineraryViewer, rmf_traffic::schedule::Snapshot
Public Functions
-
virtual View
query
(const Query ¶meters) const = 0¶ Query this Viewer to get a View of the Trajectories inside of it that match the Query parameters.
-
virtual View
query
(const Query::Spacetime &spacetime, const Query::Participants &participants) const = 0¶ Alternative signature for query()
-
virtual const std::unordered_set<ParticipantId> &
participant_ids
() const = 0¶ Get the set of active participant IDs.
-
virtual std::shared_ptr<const ParticipantDescription>
get_participant
(ParticipantId participant_id) const = 0¶ Get the information of the specified participant if it is available. If a participant with the specified ID is not registered with the schedule, then this will return a nullptr.
-
virtual
~Viewer
() = default¶
-
class
View
¶ A read-only view of some Trajectories in a Database or Mirror.
It is undefined behavior to modify a Database or patch a Mirror while reading Trajectories from this view. The user of this class is responsible for managing access to reads vs access to writes.
Public Types
-
using
base_iterator
= rmf_traffic::detail::bidirectional_iterator<E, I, F>¶
-
using
const_iterator
= base_iterator<const Element, IterImpl, View>¶
-
using
iterator
= const_iterator¶
Public Functions
-
const_iterator
begin
() const¶ Returns an iterator to the first element of the View.
-
const_iterator
end
() const¶ Returns an iterator to the element following the last element of the View.
-
using
-
virtual View
Class Viewer::View¶
Defined in File Viewer.hpp
Nested Relationships¶
This class is a nested type of Class Viewer.
Class Documentation¶
-
class
rmf_traffic::schedule::Viewer
::
View
A read-only view of some Trajectories in a Database or Mirror.
It is undefined behavior to modify a Database or patch a Mirror while reading Trajectories from this view. The user of this class is responsible for managing access to reads vs access to writes.
Public Types
-
using
base_iterator
= rmf_traffic::detail::bidirectional_iterator<E, I, F>
-
using
const_iterator
= base_iterator<const Element, IterImpl, View>
-
using
iterator
= const_iterator
Public Functions
-
const_iterator
begin
() const Returns an iterator to the first element of the View.
-
const_iterator
end
() const Returns an iterator to the element following the last element of the View.
-
std::size_t
size
() const Returns the number of elements in this View.
-
struct
Element
Public Members
-
const ParticipantId
participant
-
const PlanId
plan_id
-
const RouteId
route_id
-
const std::shared_ptr<const Route>
route
-
const ParticipantDescription &
description
-
const ParticipantId
-
using
Class Writer¶
Defined in File Writer.hpp
Nested Relationships¶
Inheritance Relationships¶
public rmf_traffic::schedule::Database
(Class Database)
Class Documentation¶
-
class
rmf_traffic::schedule
::
Writer
¶ A pure abstract interface class that defines an API for writing to the schedule database. This API is implemented by the Database class, but it should also be implemented for any middleware that intends to have a schedule participant write changes to a remote database.
Subclassed by rmf_traffic::schedule::Database
Public Types
-
using
ParticipantId
= rmf_traffic::schedule::ParticipantId¶
-
using
ParticipantDescription
= rmf_traffic::schedule::ParticipantDescription¶
-
using
ItineraryVersion
= rmf_traffic::schedule::ItineraryVersion¶
-
using
ProgressVersion
= rmf_traffic::schedule::ProgressVersion¶
-
using
CheckpointId
= rmf_traffic::CheckpointId¶
-
using
StorageId
= uint64_t¶
Public Functions
-
virtual void
set
(ParticipantId participant, PlanId plan, const Itinerary &itinerary, StorageId storage_base, ItineraryVersion version) = 0¶ Set a brand new itinerary for a participant. This will replace any itinerary that is already in the schedule for the participant.
- Parameters
[in] participant
: The ID of the participant whose itinerary is being updated.[in] plan
: The ID of the plan that this new itinerary belongs to.[in] itinerary
: The new itinerary of the participant.[in] storage_base
: The storage index offset that the database should use for this plan. This should generally be the integer number of total routes that the participant has ever given to the writer prior to setting this new itinerary. This value helps ensure consistent unique IDs for every route, even after a database has failed over or restarted.[in] version
: The version for this itinerary change.
-
virtual void
extend
(ParticipantId participant, const Itinerary &routes, ItineraryVersion version) = 0¶ Add a set of routes to the itinerary of this participant.
- Parameters
[in] participant
: The ID of the participant whose itinerary is being updated.[in] routes
: The set of routes that should be added to the itinerary.[in] version
: The version for this itinerary change
-
virtual void
delay
(ParticipantId participant, Duration delay, ItineraryVersion version) = 0¶ Add a delay to the itinerary from the specified Time.
Nothing about the routes in the itinerary will be changed except that waypoints will shifted through time.
- Parameters
[in] participant
: The ID of the participant whose itinerary is being delayed.[in] delay
: This is the duration of time to delay all qualifying Trajectory Waypoints.[in] version
: The version for this itinerary change
-
virtual void
reached
(ParticipantId participant, PlanId plan, const std::vector<CheckpointId> &reached_checkpoints, ProgressVersion version) = 0¶ Indicate that a participant has reached certain checkpoints.
- Parameters
[in] participant
: The ID of the participant whose progress is being set.[in] plan
: The ID of the plan which progress has been made for.[in] reached_checkpoints
: The set of checkpoints that have been reached. The indices in the vector must correspond to the RouteIds of the plan.[in] version
: The version number for this progress.
-
virtual void
clear
(ParticipantId participant, ItineraryVersion version) = 0¶ Erase an itinerary from this database.
- Parameters
[in] participant
: The ID of the participant whose itinerary is being erased.[in] version
: The version for this itinerary change
-
virtual Registration
register_participant
(ParticipantDescription participant_info) = 0¶ Register a new participant.
- Return
result of registering the new participant.
- Parameters
[in] participant_info
: Information about the new participant.[in] time
: The time at which the registration is being requested.
-
virtual void
unregister_participant
(ParticipantId participant) = 0¶ Unregister an existing participant.
- Return
the new version of the schedule.
- Parameters
[in] participant
: The ID of the participant to unregister.
-
virtual void
update_description
(ParticipantId participant, ParticipantDescription desc) = 0¶ Updates a participants footprint
- Parameters
[in] participant
: The ID of the participant to update[in] desc
: The participant description
-
virtual
~Writer
() = default¶
-
class
Registration
¶ Information resulting from registering a participant.
Public Functions
-
Registration
(ParticipantId id, ItineraryVersion version, PlanId plan_id, StorageId storage_base)¶ Constructor
- Parameters
[in] id
: The ID for the registered participant[in] version
: The last itinerary version for the registered participant[in] plan_id
: The last plan_id for the registered participant[in] storage_base
: The next storage base that the registered participant should use
-
ParticipantId
id
() const¶ The ID of the registered participant.
-
ItineraryVersion
last_itinerary_version
() const¶ The last itinerary version of the registered participant. New Participants will begin by adding up from this version when issuing schedule updates.
This value might vary for systems that enforce participant uniqueness. If this participant was registered in the past and is now being re-registered, then the version number will pick up where it previously left off.
-
-
using
Class Writer::Registration¶
Defined in File Writer.hpp
Nested Relationships¶
This class is a nested type of Class Writer.
Class Documentation¶
-
class
rmf_traffic::schedule::Writer
::
Registration
Information resulting from registering a participant.
Public Functions
-
Registration
(ParticipantId id, ItineraryVersion version, PlanId plan_id, StorageId storage_base) Constructor
- Parameters
[in] id
: The ID for the registered participant[in] version
: The last itinerary version for the registered participant[in] plan_id
: The last plan_id for the registered participant[in] storage_base
: The next storage base that the registered participant should use
-
ParticipantId
id
() const The ID of the registered participant.
-
ItineraryVersion
last_itinerary_version
() const The last itinerary version of the registered participant. New Participants will begin by adding up from this version when issuing schedule updates.
This value might vary for systems that enforce participant uniqueness. If this participant was registered in the past and is now being re-registered, then the version number will pick up where it previously left off.
-
PlanId
last_plan_id
() const The last Route ID of the registered participant. New Participants will begin by adding up from this Route ID when issuing new schedule updates.
Similar to last_itinerary_version, this value might vary for systems that enforce participant uniqueness.
-
StorageId
next_storage_base
() const The next storage base that the participant should use.
-
Class Trajectory¶
Defined in File Trajectory.hpp
Nested Relationships¶
Class Documentation¶
-
class
rmf_traffic
::
Trajectory
¶ Public Types
-
using
iterator
= base_iterator<Waypoint>¶
-
using
const_iterator
= base_iterator<const Waypoint>¶
Public Functions
-
Trajectory
()¶ Create an empty Trajectory.
-
Trajectory
(const Trajectory &other)¶
-
Trajectory &
operator=
(const Trajectory &other)¶
-
Trajectory
(Trajectory&&) = default¶ - Warning
After using the move constructor or move assignment operator, the Trajectory that was moved from will be unusable until a fresh Trajectory instance is assigned to it (using either the copy or move constructor). Attempting to use a Trajectory that was moved from will result in a segfault if you do not assign it a new instance.
-
Trajectory &
operator=
(Trajectory&&) = default¶
-
InsertionResult
insert
(Time time, Eigen::Vector3d position, Eigen::Vector3d velocity)¶ Add a Waypoint to this Trajectory.
The Waypoint will be inserted into the Trajectory according to its time, ensuring correct ordering of all Waypoints.
-
InsertionResult
insert
(const Waypoint &other)¶ Insert a copy of another Trajectory’s Waypoint into this one.
-
iterator
find
(Time time)¶ Find the Waypoint of this Trajectory that comes after or exactly on the given time.
- Note
This will return Trajectory::end() if the time is before the Trajectory starts or after the Trajectory finishes.
- Return
an iterator to the Waypoint that is active during the given time, or Trajectory::end() if the time falls outside the range of the Trajectory
- Parameters
[in] time
: The time of interest.
-
const_iterator
find
(Time time) const¶ const-qualified version of find()
-
Waypoint &
operator[]
(std::size_t index)¶ Get a reference to the Waypoint at the specified index. No bounds checking is performed, so there will be undefined behavior if the index is out of bounds.
-
Waypoint &
at
(std::size_t index)¶ Get a reference to the Waypoint at the specified index. Bound checking will be performed, and an exception will be thrown if index is out of bounds.
-
iterator
lower_bound
(Time time)¶ Get the first waypoint of this Trajectory that occurs at a time greater than or equal to the specified time. This is effectively the same as find(Time), except it will return Trajectory::begin() if the time comes before the start of the Trajectory.
- Return
an iterator to the first Waypoint that occurs at a time on or after the given time, or Trajectory::end() if the time is after the end of the Trajectory.
- Parameters
[in] time
: The inclusive lower bound on the time of interest.
-
const_iterator
lower_bound
(Time time) const¶ const-qualified version of lower_bound()
-
std::size_t
index_after
(Time time) const¶ Get the index of first waypoint that comes after the specified time. If the last waypoint in the trajectory comes before the specified time then size() will be returned.
-
iterator
erase
(iterator waypoint)¶ Erase the specified waypoint.
- Return
an iterator following the last removed element
-
iterator
erase
(iterator first, iterator last)¶ Erase the range of elements: [first, last).
- Note
The
last
element is not included in the range.- Return
an iterator following the last removed element
-
iterator
begin
()¶ Returns an iterator to the fist Waypoint of the Trajectory.
If the Trajectory is empty, the returned iterator will be equal to end().
-
const_iterator
begin
() const¶ const-qualified version of begin()
-
const_iterator
cbegin
() const¶ Explicitly call the const-qualified version of begin()
-
iterator
end
()¶ Returns an iterator to the element following the last Waypoint of the Trajectory. This iterator acts as a placeholder; attempting to dereference it results in undefined behavior.
- Note
In compliance with C++ standards, this is really a one-past-the-end iterator and must not be dereferenced. It should only be used to identify when an iteration must end. See: https://en.cppreference.com/w/cpp/container/list/end
-
const_iterator
end
() const¶ const-qualified version of end()
-
const_iterator
cend
() const¶ Explicitly call the const-qualified version of end()
-
Waypoint &
front
()¶ Get a mutable reference to the first Waypoint in this Trajectory.
- Warning
Calling this function on an empty trajectory is undefined.
-
const Waypoint &
front
() const¶ Get a const reference to the first Waypoint in this Trajectory.
- Warning
Calling this function on an empty trajectory is undefined.
-
Waypoint &
back
()¶ Get a mutable reference to the last Waypoint in this Trajectory.
- Warning
Calling this function on an empty trajectory is undefined.
-
const Waypoint &
back
() const¶ Get a const reference to the last Waypoint in this Trajectory.
- Warning
Calling this function on an empty trajectory is undefined.
-
const Time *
start_time
() const¶ Get the start time, if available. This will return a nullptr if the Trajectory is empty.
-
const Time *
finish_time
() const¶ Get the finish time of the Trajectory, if available. This will return a nullptr if the Trajectory is empty.
-
Duration
duration
() const¶ Get the duration of the Trajectory. This will be 0 if the Trajectory is empty or if it has only one Waypoint.
-
std::size_t
size
() const¶ Get the number of Waypoints in the Trajectory. To be used in conflict detection, the Trajectory must have a size of at least 2.
-
bool
empty
() const¶ Return true if the trajectory has no waypoints, false otherwise.
Friends
- friend class internal::TrajectoryIteratorImplementation
-
template<typename
W
>
classbase_iterator
¶ Public Functions
-
base_iterator &
operator++
()¶ Pre-increment operator: ++it
- Note
This is more efficient than the post-increment operator.
- Return
a reference to the iterator that was operated on
-
base_iterator &
operator--
()¶ Pre-decrement operator: it
- Note
This is more efficient than the post-decrement operator
- Return
a reference to the iterator that was operated on
-
base_iterator
operator++
(int)¶ Post-increment operator: it++
- Return
a copy of the iterator before it was incremented
-
base_iterator
operator--
(int)¶ Post-decrement operator: it
- Return
a copy of the iterator before it was decremented
-
bool
operator==
(const base_iterator &other) const¶ Equality comparison operator.
-
bool
operator!=
(const base_iterator &other) const¶ Inequality comparison operator.
-
bool
operator<
(const base_iterator &other) const¶ Less-than comparison operator (the left-hand side is earlier in the trajectory than the right-hand side)
-
bool
operator>
(const base_iterator &other) const¶ Greater-than comparison operator (the left-hand side is later in the trajectory than the right-hand side)
-
bool
operator<=
(const base_iterator &other) const¶ Less-than-or-equal comparison operator.
-
bool
operator>=
(const base_iterator &other) const¶ Greater-than-or-equal comparison operator.
-
operator const_iterator
() const¶
-
base_iterator
(const base_iterator &other) = default¶
-
base_iterator
(base_iterator &&other) = default¶
-
base_iterator &
operator=
(const base_iterator &other) = default¶
-
base_iterator &
operator=
(base_iterator &&other) = default¶
-
base_iterator
()¶
Friends
- friend class internal::TrajectoryIteratorImplementation
-
base_iterator &
-
struct
InsertionResult
¶
-
class
Waypoint
¶ Public Functions
-
Eigen::Vector3d
position
() const¶ Get the intended physical location of the robot at the end of this Trajectory Waypoint.
This is a 2D homogeneous position. The first two values in the vector are x and y coordinates, while the third is rotation about the z-axis.
-
Waypoint &
position
(Eigen::Vector3d new_position)¶ Set the intended physical location of the robot at the end of this Trajectory Waypoint.
This is a 2D homogeneous position. The first two values in the vector are x and y coordinates, while the third is rotation about the z-axis.
- Parameters
[in] new_position
: The new position for this Trajectory Waypoint.
-
Eigen::Vector3d
velocity
() const¶ Get the intended velocity of the robot at the end of this Trajectory Waypoint.
This is a 2D homogeneous position. The first two values in the vector are x and y velocities, while the third is rotational velocity about the z-axis.
-
Waypoint &
velocity
(Eigen::Vector3d new_velocity)¶ Set the intended velocity of the robot at the end of this Trajectory Waypoint.
This is a 2D homogeneous position. The first two values in the vector are x and y coordinates, while the third is rotation about the z-axis.
- Parameters
[in] new_velocity
: The new velocity at this Trajectory Waypoint.
-
std::size_t
index
() const¶ The index of this waypoint within its trajectory. Waypoints are indexed according to their chronological order. Adjusting the time of any waypoint in a trajectory could change its index and/or the index of other waypoints.
-
Waypoint &
change_time
(Time new_time)¶ Change the timing of this Trajectory Waypoint. Note that this function will only affect this waypoint, and may cause this waypoint to be reordered within the Trajectory.
To change the timing for this waypoint while preserving the relative times of all subsequent Trajectory Waypoints, use adjust_times() instead.
- Warning
If you change the time value of this Waypoint such that it falls directly on another Waypoint’s time, you will get a std::invalid_argument exception, because discontinuous jumps are not supported, and indicate a significant mishandling of trajectory data, which is most likely a serious bug that should be remedied.
- Note
If this Waypoint’s time crosses over another Waypoint’s time, that signficantly changes the topology of the Trajectory, because it will change the order in which the positions are traversed.
- See
adjust_times(Time new_time)
- Parameters
[in] new_time
: The new timing for this Trajectory Waypoint.
-
void
adjust_times
(Duration delta_t)¶ Adjust the timing of this waypoint and all subsequent waypoints by the given duration. This is guaranteed to maintain the ordering of the Trajectory Waypoints, and is more efficient than changing all the times directly.
- Warning
If a negative delta_t is given, it must not cause this Waypoint’s time to be less than or equal to the time of its preceding Waypoint, or else a std::invalid_argument exception will be thrown.
- See
- Parameters
[in] delta_t
: How much to change the timing of this waypoint and all later waypoints. If negative, it must not cross over the time of the previous waypoint, or else a std::invalid_argument will be thrown.
-
Eigen::Vector3d
-
using
Template Class Trajectory::base_iterator¶
Defined in File Trajectory.hpp
Nested Relationships¶
This class is a nested type of Class Trajectory.
Class Documentation¶
-
template<typename
W
>
classrmf_traffic::Trajectory
::
base_iterator
Public Functions
-
W &
operator*
() const Dereference operator.
-
W *
operator->
() const Drill-down operator.
-
base_iterator &
operator++
() Pre-increment operator: ++it
- Note
This is more efficient than the post-increment operator.
- Return
a reference to the iterator that was operated on
-
base_iterator &
operator--
() Pre-decrement operator: it
- Note
This is more efficient than the post-decrement operator
- Return
a reference to the iterator that was operated on
-
base_iterator
operator++
(int) Post-increment operator: it++
- Return
a copy of the iterator before it was incremented
-
base_iterator
operator--
(int) Post-decrement operator: it
- Return
a copy of the iterator before it was decremented
-
bool
operator==
(const base_iterator &other) const Equality comparison operator.
-
bool
operator!=
(const base_iterator &other) const Inequality comparison operator.
-
bool
operator<
(const base_iterator &other) const Less-than comparison operator (the left-hand side is earlier in the trajectory than the right-hand side)
-
bool
operator>
(const base_iterator &other) const Greater-than comparison operator (the left-hand side is later in the trajectory than the right-hand side)
-
bool
operator<=
(const base_iterator &other) const Less-than-or-equal comparison operator.
-
bool
operator>=
(const base_iterator &other) const Greater-than-or-equal comparison operator.
-
operator const_iterator
() const
-
base_iterator
(const base_iterator &other) = default
-
base_iterator
(base_iterator &&other) = default
-
base_iterator &
operator=
(const base_iterator &other) = default
-
base_iterator &
operator=
(base_iterator &&other) = default
-
base_iterator
()
Friends
- friend class internal::TrajectoryIteratorImplementation
-
W &
Class Trajectory::Waypoint¶
Defined in File Trajectory.hpp
Nested Relationships¶
This class is a nested type of Class Trajectory.
Class Documentation¶
-
class
rmf_traffic::Trajectory
::
Waypoint
Public Functions
-
Eigen::Vector3d
position
() const Get the intended physical location of the robot at the end of this Trajectory Waypoint.
This is a 2D homogeneous position. The first two values in the vector are x and y coordinates, while the third is rotation about the z-axis.
-
Waypoint &
position
(Eigen::Vector3d new_position) Set the intended physical location of the robot at the end of this Trajectory Waypoint.
This is a 2D homogeneous position. The first two values in the vector are x and y coordinates, while the third is rotation about the z-axis.
- Parameters
[in] new_position
: The new position for this Trajectory Waypoint.
-
Eigen::Vector3d
velocity
() const Get the intended velocity of the robot at the end of this Trajectory Waypoint.
This is a 2D homogeneous position. The first two values in the vector are x and y velocities, while the third is rotational velocity about the z-axis.
-
Waypoint &
velocity
(Eigen::Vector3d new_velocity) Set the intended velocity of the robot at the end of this Trajectory Waypoint.
This is a 2D homogeneous position. The first two values in the vector are x and y coordinates, while the third is rotation about the z-axis.
- Parameters
[in] new_velocity
: The new velocity at this Trajectory Waypoint.
-
std::size_t
index
() const The index of this waypoint within its trajectory. Waypoints are indexed according to their chronological order. Adjusting the time of any waypoint in a trajectory could change its index and/or the index of other waypoints.
-
Waypoint &
change_time
(Time new_time) Change the timing of this Trajectory Waypoint. Note that this function will only affect this waypoint, and may cause this waypoint to be reordered within the Trajectory.
To change the timing for this waypoint while preserving the relative times of all subsequent Trajectory Waypoints, use adjust_times() instead.
- Warning
If you change the time value of this Waypoint such that it falls directly on another Waypoint’s time, you will get a std::invalid_argument exception, because discontinuous jumps are not supported, and indicate a significant mishandling of trajectory data, which is most likely a serious bug that should be remedied.
- Note
If this Waypoint’s time crosses over another Waypoint’s time, that signficantly changes the topology of the Trajectory, because it will change the order in which the positions are traversed.
- See
adjust_times(Time new_time)
- Parameters
[in] new_time
: The new timing for this Trajectory Waypoint.
-
void
adjust_times
(Duration delta_t) Adjust the timing of this waypoint and all subsequent waypoints by the given duration. This is guaranteed to maintain the ordering of the Trajectory Waypoints, and is more efficient than changing all the times directly.
- Warning
If a negative delta_t is given, it must not cause this Waypoint’s time to be less than or equal to the time of its preceding Waypoint, or else a std::invalid_argument exception will be thrown.
- See
- Parameters
[in] delta_t
: How much to change the timing of this waypoint and all later waypoints. If negative, it must not cross over the time of the previous waypoint, or else a std::invalid_argument will be thrown.
-
Eigen::Vector3d
Functions¶
Function rmf_traffic::agv::compute_plan_starts¶
Defined in File Planner.hpp
Function Documentation¶
-
std::vector<Plan::Start>
rmf_traffic::agv
::
compute_plan_starts
(const rmf_traffic::agv::Graph &graph, const std::string &map_name, const Eigen::Vector3d pose, const rmf_traffic::Time start_time, const double max_merge_waypoint_distance = 0.1, const double max_merge_lane_distance = 1.0, const double min_lane_length = 1e-8)¶ Produces a set of possible starting waypoints and lanes in order to start planning. This method attempts to find the most suitable starting nodes within the provided graph for merging, planning and execution of plans, from the provided pose. If none of the waypoints in the graph fulfils the requirements, an empty vector will be returned.
- Parameters
[in] graph
: Graph which the starting waypoints and lanes will be derived from.[in] pose
: Current pose in terms of 2D coordinates, x and y, being the first and second element respectively, while the third element being the yaw.[in] start_time
: The starting time that will be attributed to all the generated starts to compute a new plan. In some occasions, users will want to add small delays to the current time, in order to account for computation time or network delays.[in] max_merge_waypoint_distance
: The maximum distance allowed to automatically merge onto a waypoint in the graph. Default value as 0.1 meters.[in] max_merge_lane_distance
: The maximum distance allowed to automatically merge onto a lane, i.e. adding the lane’s entry and exit waypoints as potential starts. Default value as 1.0 meters.[in] min_lane_length
: The minimum length of a lane in the provided graph to be considered valid, any lanes shorter than this value will not be evaluated. Default value as 1e-8 meters.
Function rmf_traffic::agv::interpolate_time_along_quadratic_straight_line¶
Defined in File Interpolate.hpp
Function Documentation¶
-
TimeVelocity
rmf_traffic::agv
::
interpolate_time_along_quadratic_straight_line
(const Trajectory &trajectory, const Eigen::Vector2d &position, double holding_point_tolerance = 0.05)¶ This function only works correctly if the trajectory follows a straight line trajectory with zero jerk (cubic coefficient) and the position lies along the trajectory.
Function rmf_traffic::blockade::make_participant¶
Defined in File Participant.hpp
Function Documentation¶
Make a blockade participant.
- Parameters
[in] participant_id
: Every blockade participant must also be a schedule participant. Pass in the schedule participant ID here.[in] radius
: The initial default radius to use for this participant’s blockade.[in] writer
: The writer that this participant should interact with.[in] rectifier_factory
: The factory that this participant should use to create a rectifier for itself. If no factory is provided, we will assume the writer is always perfectly reliable.
Template Function rmf_traffic::geometry::make_final(Args&&…)¶
Defined in File Shape.hpp
Function Documentation¶
-
template<typename
T
, typename ...Args
>
FinalShapePtrrmf_traffic::geometry
::
make_final
(Args&&... args)¶
Template Function rmf_traffic::geometry::make_final(const T&)¶
Defined in File Shape.hpp
Function Documentation¶
-
template<typename
T
>
FinalShapePtrrmf_traffic::geometry
::
make_final
(const T &shape)¶
Template Function rmf_traffic::geometry::make_final_convex(Args&&…)¶
Defined in File ConvexShape.hpp
Function Documentation¶
-
template<typename
T
, typename ...Args
>
FinalConvexShapePtrrmf_traffic::geometry
::
make_final_convex
(Args&&... args)¶
Template Function rmf_traffic::geometry::make_final_convex(const T&)¶
Defined in File ConvexShape.hpp
Function Documentation¶
-
template<typename
T
>
FinalConvexShapePtrrmf_traffic::geometry
::
make_final_convex
(const T &convex)¶
Function rmf_traffic::geometry::operator!=(const Circle&, const Circle&)¶
Defined in File Circle.hpp
Function Documentation¶
Function rmf_traffic::geometry::operator!=(const Space&, const Space&)¶
Defined in File Space.hpp
Function Documentation¶
Function rmf_traffic::geometry::operator==(const Circle&, const Circle&)¶
Defined in File Circle.hpp
Function Documentation¶
Function rmf_traffic::geometry::operator==(const Space&, const Space&)¶
Defined in File Space.hpp
Function Documentation¶
Function rmf_traffic::operator!=¶
Defined in File Region.hpp
Function Documentation¶
Function rmf_traffic::operator==¶
Defined in File Region.hpp
Function Documentation¶
Function rmf_traffic::schedule::make_query(std::vector<Region>)¶
Defined in File Query.hpp
Function Documentation¶
Function rmf_traffic::schedule::make_query(std::vector<std::string>, const Time *, const Time *)¶
Defined in File Query.hpp
Function Documentation¶
-
Query
rmf_traffic::schedule
::
make_query
(std::vector<std::string> maps, const Time *start_time, const Time *finish_time)¶ Query for all Trajectories that fall within a time range.
- Parameters
[in] start_time
: A pointer to the lower bound for the time range. Pass in a nullptr to indicate that there is no lower bound.[in] finish_time
: A pointer to the upper bound for the time range. Pass in a nullptr to indicate that there is no upper bound.
Function rmf_traffic::schedule::operator!=¶
Defined in File Query.hpp
Function Documentation¶
Function rmf_traffic::schedule::operator==¶
Defined in File Query.hpp
Function Documentation¶
Function rmf_traffic::schedule::query_all¶
Defined in File Query.hpp
Function Documentation¶
Function rmf_traffic::time::apply_offset¶
Defined in File Time.hpp
Function Documentation¶
Function rmf_traffic::time::from_seconds¶
Defined in File Time.hpp
Function Documentation¶
Function rmf_traffic::time::to_seconds¶
Defined in File Time.hpp
Function Documentation¶
Defines¶
Define CAPTURE_LEAK¶
Defined in File Plumber.hpp
Define Documentation¶
-
CAPTURE_LEAK
(X)¶
Define CAPTURE_LEAK_HERE¶
Defined in File Plumber.hpp
Define Documentation¶
-
CAPTURE_LEAK_HERE
¶
Define CHECK_LEAK¶
Defined in File Plumber.hpp
Define Documentation¶
-
CHECK_LEAK
(X)¶
Typedefs¶
Typedef rmf_traffic::blockade::CheckpointId¶
Defined in File Status.hpp
Typedef Documentation¶
-
using
rmf_traffic::blockade
::
CheckpointId
= uint64_t¶
Typedef rmf_traffic::blockade::ParticipantId¶
Defined in File Status.hpp
Typedef Documentation¶
-
using
rmf_traffic::blockade
::
ParticipantId
= uint64_t¶
Typedef rmf_traffic::blockade::ReservationId¶
Defined in File Status.hpp
Typedef Documentation¶
-
using
rmf_traffic::blockade
::
ReservationId
= uint64_t¶
Typedef rmf_traffic::blockade::Version¶
Defined in File Status.hpp
Typedef Documentation¶
-
using
rmf_traffic::blockade
::
Version
= uint64_t¶
Typedef rmf_traffic::CheckpointId¶
Defined in File Route.hpp
Typedef Documentation¶
-
using
rmf_traffic
::
CheckpointId
= uint64_t¶
Typedef rmf_traffic::ConstRoutePtr¶
Defined in File Route.hpp
Typedef Documentation¶
Typedef rmf_traffic::Dependencies¶
Defined in File Route.hpp
Typedef Documentation¶
-
using
rmf_traffic
::
Dependencies
= std::vector<Dependency>¶
Typedef rmf_traffic::DependsOnCheckpoint¶
Defined in File Route.hpp
Typedef Documentation¶
-
using
rmf_traffic
::
DependsOnCheckpoint
= std::map<CheckpointId, CheckpointId>¶ The checkpoint in the value waits for the checkpoint in the key.
Typedef rmf_traffic::DependsOnParticipant¶
Defined in File Route.hpp
Typedef Documentation¶
-
using
rmf_traffic
::
DependsOnParticipant
= std::unordered_map<ParticipantId, DependsOnPlan>¶ Express a dependency on a participant.
Typedef rmf_traffic::DependsOnRoute¶
Defined in File Route.hpp
Typedef Documentation¶
-
using
rmf_traffic
::
DependsOnRoute
= std::unordered_map<RouteId, DependsOnCheckpoint>¶ The checkpoint dependencies relate to the route ID of the key.
Typedef rmf_traffic::Duration¶
Defined in File Time.hpp
Typedef Documentation¶
-
using
rmf_traffic
::
Duration
= std::chrono::steady_clock::duration¶ Specifies a change in time, with nanosecond precision.
Typedef rmf_traffic::geometry::ConstConvexShapePtr¶
Defined in File ConvexShape.hpp
Typedef Documentation¶
-
using
rmf_traffic::geometry
::
ConstConvexShapePtr
= std::shared_ptr<const ConvexShape>¶
Typedef rmf_traffic::geometry::ConstFinalConvexShapePtr¶
Defined in File ConvexShape.hpp
Typedef Documentation¶
-
using
rmf_traffic::geometry
::
ConstFinalConvexShapePtr
= std::shared_ptr<const FinalConvexShape>¶
Typedef rmf_traffic::geometry::ConstFinalShapePtr¶
Defined in File Shape.hpp
Typedef Documentation¶
-
using
rmf_traffic::geometry
::
ConstFinalShapePtr
= std::shared_ptr<const FinalShape>¶
Typedef rmf_traffic::geometry::ConstShapePtr¶
Defined in File Shape.hpp
Typedef Documentation¶
Typedef rmf_traffic::geometry::ConvexShapePtr¶
Defined in File ConvexShape.hpp
Typedef Documentation¶
-
using
rmf_traffic::geometry
::
ConvexShapePtr
= std::shared_ptr<ConvexShape>¶
Typedef rmf_traffic::geometry::FinalConvexShapePtr¶
Defined in File ConvexShape.hpp
Typedef Documentation¶
-
using
rmf_traffic::geometry
::
FinalConvexShapePtr
= std::shared_ptr<FinalConvexShape>¶
Typedef rmf_traffic::geometry::FinalShapePtr¶
Defined in File Shape.hpp
Typedef Documentation¶
-
using
rmf_traffic::geometry
::
FinalShapePtr
= std::shared_ptr<FinalShape>¶
Typedef rmf_traffic::geometry::ShapePtr¶
Defined in File Shape.hpp
Typedef Documentation¶
Typedef rmf_traffic::ParticipantId¶
Defined in File Route.hpp
Typedef Documentation¶
-
using
rmf_traffic
::
ParticipantId
= uint64_t¶
Typedef rmf_traffic::PlanId¶
Defined in File Route.hpp
Typedef Documentation¶
-
using
rmf_traffic
::
PlanId
= uint64_t¶
Typedef rmf_traffic::RouteId¶
Defined in File Route.hpp
Typedef Documentation¶
-
using
rmf_traffic
::
RouteId
= uint64_t¶
Typedef rmf_traffic::RoutePtr¶
Defined in File Route.hpp
Typedef Documentation¶
Typedef rmf_traffic::schedule::Itinerary¶
Defined in File Itinerary.hpp
Typedef Documentation¶
Typedef rmf_traffic::schedule::ItineraryVersion¶
Defined in File Itinerary.hpp
Typedef Documentation¶
-
using
rmf_traffic::schedule
::
ItineraryVersion
= uint64_t¶
Typedef rmf_traffic::schedule::ItineraryView¶
Defined in File Itinerary.hpp
Typedef Documentation¶
Typedef rmf_traffic::schedule::ParticipantDescriptionsMap¶
Defined in File ParticipantDescription.hpp
Typedef Documentation¶
-
using
rmf_traffic::schedule
::
ParticipantDescriptionsMap
= std::unordered_map<ParticipantId, ParticipantDescription>¶
Typedef rmf_traffic::schedule::ParticipantId¶
Defined in File ParticipantDescription.hpp
Typedef Documentation¶
-
using
rmf_traffic::schedule
::
ParticipantId
= uint64_t¶
Typedef rmf_traffic::schedule::ProgressVersion¶
Defined in File Itinerary.hpp
Typedef Documentation¶
-
using
rmf_traffic::schedule
::
ProgressVersion
= uint64_t¶
Typedef rmf_traffic::schedule::StorageId¶
Defined in File Change.hpp
Typedef Documentation¶
-
using
rmf_traffic::schedule
::
StorageId
= uint64_t¶
Typedef rmf_traffic::schedule::Version¶
Defined in File Version.hpp
Typedef Documentation¶
-
using
rmf_traffic::schedule
::
Version
= uint64_t¶ The schedule version is represented by an unsigned 64-bit integer. This means that the schedule can identify over 9 quintillion database entries at any single moment in time (which is more than a server is likely to have enough RAM to store).
The Version number is used to identify the current version of a database.
As database entries become irrelevant (e.g. they refer to events that have already finished taking place) they will be culled from the database. The database will keep track of what its “oldest” known version number is. After a very long period of continuous operation, the version numbers could eventually wrap around and overflow the 64-bit unsigned integer. This is okay because modular arithmetic will be used to ensure that version values which are lower than the “oldest” version number will be evaluated as greater than any version numbers that are greater than the “oldest” version number.
Typedef rmf_traffic::Time¶
Defined in File Time.hpp
Typedef Documentation¶
-
using
rmf_traffic
::
Time
= std::chrono::steady_clock::time_point¶ Specifies a specific point in time, with nanosecond precision.
Conventionally this will be represented relative to the Unix Epoch.