This is the top-level namespace of the concert_schedulers ROS package. It contains various requester-scheduler implementations and a library of scheduler launchers.
Common modules for the concert_schedulers package.
This module wraps the concert_msgs data structure for a concert client in a python class for convenient handling inside a scheduler node.
Bases: object
Envelops the concert client msg data structure that is published to the rest of the concert with a few extra fields and methods useful for management by the scheduler.
Initialise this concert client with the data from a msg received from the concert conductor.
Parameters: | msg (concert_msgs.ConcertClient) – |
---|
Abandon the resource. Usually called after a request is cancelled or on shutdown. This stops the rapp.
Allocate the resource. This involves also starting the rapp.
Parameters: | |
---|---|
Raises: | FailedToAllocateException if the start_rapp service failed. |
Whether or not it is currently allocated.
If allocated, this indicates its priority.
The concert client’s name on the gateway network (typically has postfixed uuid)
Simple boolean test to check if the client can run the specified resource.
Parameters: | resource (str) – |
---|---|
Returns: | true if compatible, false otherwise |
Return type: | bool |
The subscribed data structure describing a concert client.
The human readable concert alias for this client.
Ungraceful reallocation. Stops the rapp and starts the new one. Should be sending a request off to the service to gracefully cancel the request at the time of its choosing instead.
Parameters: | |
---|---|
Returns: | the old request id (so the requester can be updated) |
Return type: | str |
This module defines exceptions raised by the concert_schedulers package.
A more general catchall for allocation failure.
Simple utilities for the concert schedulers and requesters.
Checks to see if a client is compatible for the implementation’s node rule.
Parameters: |
|
---|---|
Returns: | true if compatible, false otherwise |
Return type: | bool |
Supporting modules for the compatibility tree scheduler.
This module is the engine behind the resource allocation selection algorithm.
Bases: object
Stores the resource - concert client list compatibility tree with algorithms to manipulate it.
Here a branch is a resource, e.g. rocon_apps/teleop, on which leaves are the concert clients that can run that resource (i.e. compatible).
Just add to the first compatible branch (worry about more intelligent adding later)
Parameters: | leaf (common.ConcertClient.) – |
---|
The branches on the tree (dict like objects of {resource : clients} type.
Checks to see if the compatibility tree is a valid tree. Note this has nothing to do with allocatability, just checks that minimum leaves are met and there are no duplicate leaves. :returns: valid or not :rtype: bool
Checks off implementation node rules and matches them to potential clients fulfilling the required conditions (platform tuple, app, optionally name)
Parameters: |
|
---|---|
Returns: | list of tuples, each of which is a node and list of clients that satisfy requirements for that node. |
Return type: |
Recursive function that checks rule min/max allotments and prunes the compatibility tree. It assumes none are currently fixed, so pruning can happen anywhere.
Parameters: |
|
---|---|
Returns: | the pruned branches |
Return type: | [CompatibilityBranch] |
Ros parameter parsing for the scheduler.
The compatibility tree scheduler node.
Bases: object
An implementation of the concert_scheduler_requests abstract Scheduler that uses the compatibility tree algorithm.
It has the following characteristics:
- branches - the required resource (e.g. rocon_apps/teleop)
- leaves - concert clients that can satisfy that resource (e.g. turtlebot_1)
- always consider leaves on the lowest count branches first.
- always take the least visible leaf away from low count branches.
Supporting modules for the resource pool requester.
The resource pool requester.
Bases: object
A variant on the basic requester that can handle some higher level formulation and management of requests.
Loads the requester up with a collecation of resource groups that have min/max requirements for each resource type.
Parameters: |
|
---|
Quick check to see if a request’s resources have been entirely lost (i.e. unallocated). This will trigger the responder to cleanup (i.e. release the request).
Parameters: | request (scheduler_msgs.Request) – |
---|---|
Returns: | true or false if entirely unallocated or not. |
Return type: | bool |