-
Notifications
You must be signed in to change notification settings - Fork 5
Autonomy
Autonomous missions are handled by the autonomytaskpanel
, but the majority of code for missions lives in the multi_gait_scheduler
or multi_gait_executor
.
Missions are defined in python files in the multi_gait_scheduler
. Missions should be subclasses of the RobotMission
object, which provides some utility functions for constructing missions, such as addTask
, and addWalkingTask
. addTask
simply calls a function. addWalkingTask
creates a task to walk to a given location provided by a transform, along with the name of the controller to use to move there. (Where are these controllers specified?).
Once a mission is defined, a string name for it has to be added to the large if statement in multi_gait_scheduler.py/handle
, which receives requests to the multi_gait_scheduler/mission_request
service. This string is referenced in the autonomytaskpanel.py/_initTaskPanel
function. When the "Load Mission" button on the task panel is clicked, the scheduler sets its current mission to the requested one.
The scheduler has two threads running which execute missions. The scheduler thread which runs from worker_scheduler
checks on the size of the task queue every second, and if there is a task calls its task()
function to execute it. The task()
function of a task refers to a function that it was initialised with.
If the task function returns non-None
value, a TaskArray
is constructed and populated with the returned object, which is assumed without checks to be a Task
object. The resulting array is sent to the multi_gait_executor
actionclient, and the scheduler waits for the task to complete.
The other thread is the status thread, run from worker_status
which continuously publishes the current state of the queue to /multi_gait/current_planner_queue
.
The executor handles requests from the scheduler. The controller strings specified in the Task
objects are used to select a controller with which the task is executed.
The pose for the goal is then passed on to the position controller or to anymal's built in position controllers.