Control Tasks

Control Tasks are where the work happens and is how the state machine interfaces with the ControlSystemExecutiveModifer (SCEM). Recall that the RCEM provides and interface to the system control executive that is easier to use than calling functions on the control executive directly.

Control System Executive Modifier

EcControlSystemExecutiveModifier <motionPlanning/ ecControlSystemExecutiveModifier.h >

This class provides the primary C++ interface to the Actin Control System Executive. Here are some of its common uses:

  • Configuring the system
  • Joint Actuators (Gear ratio, friction properties, inertia, torque constants)
  • Attachments and collision exclusions
  • Joint limits and rate limits
  • Named frames
  • Motion Planning
  • Call motion commands directly – movePose, speedPose, moveJoint, …
  • System State Queries (this is state the the Stated System, not the state machine).
  • Actual end-effector placement
  • Joint torques (inverse dynamics)
Common Control Tasks

Here are some common Control tasks used to interface with the Actin Control System Executive

Data Synchronization

  • Get and Set the System Configuration
  • Set the control inputs (desired end effector placement)
  • Get the control output (system state, end effector placement)
  • Inverse Kinematics
  • Run Motion Scripts
  • Check Collisions
  • Check Torque Divergence
Control Task Class

Control tasks are customized according to each particular system, but all are derived from EcBaseControlTask

This needs a re-write, something is missing. Talk to Doug.

The control task publishes it's call back update function to the data store so that it can be called from state machine, transition and thread invokes.

Data Store Interface: • Publishes an update method callback (EcBaseRtTask) • XML attribute “updateCallbackId” C++ interface: • update() • setControlInputs() and controlInputs()setControlOutputs() and controlOutputs()

Control Tasks - Order of Operations

On each update the following are executed in order:

  1. Transfer control inputs
  2. Call the task specific update method
  3. Transfer control outputs
Control Transfer Elements

Transfer Elements are either inputs or outputs relative to the Actin control system. Recall that the control system can read or write data to the Data Store. The Control Transfer Elements enable this transfer.

Need to insert a sequence diagram (Doug, Jeff).

Control Input / Output Sequence

  • read data from the Data Store
  • call the API of the control system modifier
  • write data to the Data Store.

Three base classes are used to get/set data at the System, Manipulator, and Link levels.

EcBaseControlSystemTransferElement
EcBaseManipulatorTransferElement
EcBaseManipulatorLinkTransferElement

Data Synchronization Control Task

This tasks provides a way to synchronize data between manipulator controllers

Common Use Cases:

  • Copy the robot position state from one manipulator controller to another
  • Set or get data from the manipulator controller
  • Set actual joint state and get commanded joint state

Missing image for data sync task!

Inverse Kinematics Control Task

This task runs the Actin Inverse Kinematics on the stated system.

  • Calls EcControlSystemExecutiveModifier::calculateState
  • References a system clock defined in the data store You may recall that the caculateState requires an argument for the current time. The time value in the data store is updated periodically by another thread.

The XML representation of the IK control task is show in the snippet below:

Run Motion Script Task

This task runs an Actin Motion Script (EcScript). It should be before calling the IK task in each update cycle

Needs clarification from Doug (below)

Data Store Interface

Subscribes:

  • Motion script (can be EcScript text or preparsed).

Publishes:

  • Motion script status
  • Motion script progress
  • Update Callback
  • Restart Callback

The declaration of the motion script control tasks is show in the XML snippet below:

XML inline code example:

      <aggregateInvokes updateCallbackId="RUN_MOTION_CONTROL" path=".">
         <invokes>
            <invoke taskId="RUN_MOTION_SCRIPT" taskPath="/manipulator_controllers/ur"/>
            <invoke taskId="UPDATE_COMBINED_SPEED_SCALING" taskPath="/transfer_layers/rtde/speed_scaling"/>
            <invoke taskId="CALCULATE_STATE" taskPath="/manipulator_controllers/ur"/>
         </invokes>
      </aggregateInvokes>

Check for Collisions Task

This task runs the Actin Collision Detection. The common use case is to trigger state transitions based on collision detection

Data Store Interface

Publishes:

  • Collision Detection Flag (True if collision is detected)
  • Propagation Results

Review with Doug: I don't see the publish/subscribe delarations here.

The XML snipped for collision detection task declaration is shown below:

Check Torque Divergence Task

This task uses Inverse Dynamics to detect divergence from expected torques. A common use case is to trigger a state transition to a protective stop of the robot when external torque exceeds a threshold.

Data Store Interface

Subscribes:

  • Robot state
  • State estimation parameters
  • Joint torque thresholds

Publishes:

  • Torque divergence flag

The XML declaration for the torque divergence control tasks is shown in the XML snippet below: