APIs, concepts, guides, and more
Path Motion

Define complex 3D paths using lines and arcs for moving an end effector in Cartesian space.

🔹 What is Path Motion?

Path Motion allows complex 3D paths to be specified using simple geometric elements (arcs and lines) in order to define the desired path. Path motion is useful for applications that need to move an end effector in 3D cartesian space on a machine with an arbitrary kinematic model.

🔹 Classes for representing location in 3D space (Pose, Vector, Quaternion)

Class Composed of notes
RobotPosition Pose, RapidVector of Free Axis positions when a Robot has non-kinematic joints
Pose Vector3d, Quaternion Made of a Vector and a Quaternion
Vector3d X, Y, Z or R, P, Y 3 64-bit floating point double values
Quaternion W, X, Y, Z 4 64-bit floating point double values
RapidVector wrapped STL vector similar to std::vector

🔹 Lines

Lines are defined by an endpoint. The start point will either be the end point of the previously appended motion (For the first move it will be the current position).

🔹 Arcs

Arcs are defined by a rotation direction, endpoint, and center.
Alternatively, the can be defined by an endpoint and radius but must then only take place on a specified plane.

Warning
Currently, all arcs must take place on the XY, YZ, or XZ plane.

🔹 Relative/Absolute

Lines and arcs can be programmed as either relative or absolute.
Absolute moves will be relative to the origin point of your kinematic space. Relative moves will be relative to the start point(end point of previous move)

🔹 Examples of Basic Cartesian Lines and Arcs

CartesianRobot.PathLine(Pose(1000,1000,0));
Image

CartesianRobot.PathArc(RSIRotationDirection.Clockwise,Pose(1000,1000,0), Vector(0,1000,0)); Image

CartesianRobot.PathArcXY(RSIRotationDirection.Clockwise,1000,1000,1000);
Image

Note
This Path Motion feature is not the same as legacy path motion (methods on the MultiAxis class)

📜 Sample Code

Basic Path Motion

Gantry Prime Axis

Setup model with 1:1 geared axis.

  • C#

    // We assume the axes have been confgured and homed properly prior this this program.
    const string xLabel = "X-Axis";
    const string yLabel = "Y-Axis";
    const string primeLabel = "Y-Prime";
    // Set the expected labels for each axis.
    x_axis.UserLabelSet(xLabel);
    y_axis.UserLabelSet(yLabel);
    prime_axis.UserLabelSet(primeLabel);
    // The joint index of each axis is the index within the MultiAxis object.
    // "X-Axis" has joint index 0
    // "Y-Axis" has joint index 1
    // "Y-Prime" has joint index 2
    Axis[] axes = new Axis[] { x_axis, y_axis, prime_axis };
    jointsMultiAxis.AxesAdd(axes, axes.Length);
    const LinearUnits units = LinearUnits.Millimeters;
    const string modelName = "RSI_XY_Yp";
    const double scaling = 1.0, offset = 0.0;
    LinearModelBuilder builder = new LinearModelBuilder(modelName);
    builder.UnitsSet(units);
    builder.JointAdd(new LinearJointMapping(0, CartesianAxis.X) { ExpectedLabel = xLabel, Scaling = scaling, Offset = offset });
    builder.JointAdd(new LinearJointMapping(1, CartesianAxis.Y) { ExpectedLabel = yLabel, Scaling = scaling, Offset = offset });
    builder.JointAdd(new LinearJointMapping(2, CartesianAxis.Y) { ExpectedLabel = primeLabel, Scaling = scaling, Offset = offset });
    // Create a Robot object where the y and y prime will be geared 1:1
    const int motionFrameBufferSize = 50; // This is the minimum valid motion frame buffer size.
    robot = Robot.RobotCreate(controller, jointsMultiAxis, builder, motionFrameBufferSize);

Changing Linear Units

How changing linear units affects vel and accel setters.

3D Rendering

Get points in 3D space for rendering them.

  • C#

    const ulong frameCount = 500;
    ulong totalFrames = frameCount;
    ulong startFrame = 0;
    while (totalFrames == frameCount)
    {
    RapidVectorRobotPosition positions = robot.PathPlannedPositionsGet(startFrame, frameCount);
    totalFrames = positions.Size();
    foreach (RobotPosition position in positions.ToArray())
    {
    Pose pose = position.Pose;
    Vector3d spatial = pose.Position;
    double xCoord = spatial.X, yCoord = spatial.Y, zCoord = spatial.Z;
    Quaternion orientation = pose.Orientation;
    }
    //Add code here to create the rendering out of the positions you have collected.
    //Use your prefered 3d library.
    //Example:
    //vector3 = new Vector3D(xPosition, yPosition, zPosition);
    //linePositions.Add(Vector3DToVector3(vector3));
    startFrame += totalFrames;
    }