Motion Scripts

This example is similar to example 2, except that it uses the class EcMotionScriptSequence to make motion creation easier for the developer. In this example we create the same motion as in example 2, but with much fewer steps.


The goals of this example are to introduce the concept of motion scripting using EcMotionScriptSequence, which provides a simpler interface to moving the manipulator than in the previous example. Motion script classes provide ready to use joint motions, end effector motions, tool paths, attachments, collision exclusions and more. These motion script objects handle convergence, speed scaling, blending, and provide an easier way to task an EcControlSystemExecutive.

This example also uses theEcControlSystemExecutiveModifier, which is a simpler API that allows for easier interaction with the EcControlSystemExecutive.

Code Review

Code explanation: example3.cpp

run() This function gets a motion sequence and executes the sequence in a loop until complete. This is different form the previous example where we had to estimate the number of simulation timesteps to run. The EcControlSystemExecutiveModifier is used to calculate the system state and serves as a simpler API to the Actin Core library.

generateMotionSequence() A motion sequence allows the programmer to add a sequence of individual motions including target poses and waypoints and then execute the entire motion sequence at once. The function adds to motions to the sequence – the first to position the robot using joint angles and the second to move the end effector using waypoints.

Additional Classes Referenced

  • EcVisualizableStatedSystem
  • EcControlSystemExecutiveModifier
  • EcMotionScriptObject
  • EcMotionScriptSequence
  • EcEndEffectorMotionMoveJoint
  • EcOrientation
  • EcCoordinateSystemTransformation

Reference: Actin Class List

Running Example 3

The output for this example will display in the 3D render window.

    $ cd $ACTIN_HOME
    $ cd examples/build/bin
    $ ./trainExample3

Further Excercises

In the interest of learning Actin, it would be educational to attempt a few modifications. Try creating some more complex motion sequence using the EcMotionScriptSequence. Try creating additional motion library objects such as:

  • EcEndEffectorMotionMoveLinear
  • EcEndEffectorMotionMoveCircular
  • EcEndEffectorMotionInterpolatedPoseSequence
  • EcManipulatorMotionSetActiveEndEffectorSet
  • EcEndEffectorMotionSetTcp
  • EcManipulatorMotionAttachManipulator
  • EcManipulatorMotionRrtPlan

Another useful modification would be to print out state information each timestep, to get joint position and velocity information. This can provide basis for a simple hardware interface if you were to send that information to a physical robot system.