This module tracks resource request state transitions, which occur as scheduler_msgs/Request messages flow between schedulers and requesters.
As individual Request messages are passed back and forth between the original requester and the scheduler, their status passes through several state transitions. Gray states are created by the scheduler via solid transitions. The dashed cancel transitions may be initiated by either the requester or the scheduler.
Base class for tracking the status of a single resource request.
Not for general use.
Parameters: | msg (scheduler_msgs/Request) – ROCON scheduler request message. |
---|
Requesters and schedulers will use one of the following derived classes, with higher-level interfaces creating it automatically:
Returns : | String representation of this resource request. |
---|
Corresponding scheduler_msgs/Request message.
This represents a single resource request created by and for its original requester.
Parameters: | msg (scheduler_msgs/Request) – ROCON scheduler request message. |
---|
Provides all attributes defined for RequestBase.
Reconcile scheduler updates with requester status for a merge operation.
Parameters: | update (ResourceRequest or None) – Latest information for this request, or None if no longer present. |
---|
Only the requester creates new requests. If something is missing from the scheduler feedback, that just means the scheduler has not gotten to it yet.
This represents a single active resource known to the scheduler.
Parameters: | msg (scheduler_msgs/Request) – ROCON scheduler request message. |
---|
Provides all attributes defined for RequestBase.
List of resources actually allocated for this request (not just those requested).
Close resource request.
Raises : | TransitionError |
---|
Grant some specific requested resources.
Parameters: | resources (list of scheduler_msgs/Resource) – Exact resources granted. |
---|---|
Raises : | TransitionError |
The caller is responsible for ensuring that the granted resources really do fully satisfy this request.
Reconcile updated request with current scheduler status for a merge operation.
Parameters: | update (ActiveRequest or None) – Latest information for this request, or None if no longer present. |
---|
Preempt a previously granted request.
Parameters: | reason (int) – Reason for preemption. |
---|
Always valid for the scheduler, but has no effect unless the request was previously granted.
Put request in wait status until a suitable resource is available.
Parameters: | reason (int) – Reason for waiting. |
---|---|
Raises : | TransitionError |
This class is a container for all the resource requests or responses for a single requester. It acts like a dictionary.
Parameters: |
|
---|---|
Raises : | TypeError if the requester_id is not specified explicitly or as part of a SchedulerRequests message. |
RequestSet supports these standard container operations:
Returns : | The number of requests in the set. |
---|
Returns : | The item corresponding to uuid. |
---|---|
Raises : | KeyError if no such request. |
Assign a Request message for this uuid.
Param uuid: | (uuid.UUID) UUID of the request. |
---|---|
Param msg: | (scheduler_msgs/Request) message to add. |
Returns : | True if rset and other have the same contents. Ignores the difference between request and reply messages. |
---|
Returns : | True if rset and other have different contents. Ignores the difference between request and reply messages. |
---|
Returns : | String representation of RequestSet. |
---|
Returns : | True if rset has a key uuid, else False. |
---|
Equivalent to not uuid in rset.
These attributes are also provided:
Type of objects this request set contains.
ROS time (rospy.Time) of last update, or time zero.
Dictionary of active requests.
Cancel every active request in this set.
Parameters: | reason – Reason code for mass cancellation, or None. |
---|
Cancel every out-of-date request in this set.
Only requests in a starting state are preserved. This is done whenever a requester first connects to the scheduler. If it presents requests that had previously been granted or preempted, they will be canceled and then closed.
Parameters: | reason – Reason code for mass cancellation, or None. |
---|
Get request, if known.
Parameters: |
|
---|---|
Returns: | named item, if successful; else default. |
Returns: | all (key, value) pairs for this RequestSet. |
---|---|
Return type: | list (Python2) or dictionary view (Python3) |
Returns: | all UUIDs for this RequestSet. |
---|---|
Return type: | list (Python2) or dictionary view (Python3) |
Merge new request information into this RequestSet.
Parameters: | updates (RequestSet) – Request set containing updated information. |
---|
This is not a set.update() or set.union() operation:
Convert to ROS scheduler_msgs/SchedulerRequest message.
Parameters: | stamp (rospy.Time) – Time stamp for message header. If None, use current time. |
---|---|
Returns: | corresponding scheduler_msgs/SchedulerRequests |
Returns: | all requests for this RequestSet. |
---|---|
Return type: | list (Python2) or dictionary view (Python3) |