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)
🔹 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](https://support.roboticsys.com/assets/image (345).png)
CartesianRobot.PathArc(RSIRotationDirection.Clockwise,Pose(1000,1000,0), Vector(0,1000,0));
![Image](https://support.roboticsys.com/assets/image (82).png)
CartesianRobot.PathArcXY(RSIRotationDirection.Clockwise,1000,1000,1000);
![Image](https://support.roboticsys.com/assets/image (79).png)
- Note
- This Path Motion feature is not the same as legacy path motion (methods on the MultiAxis class)
📜 Sample Code
Basic Path Motion
- C#
const string xLabel = "X-Axis";
const string yLabel = "Y-Axis";
const string zLabel = "Z-Axis";
const string aLabel = "A-Axis";
const string bLabel = "B-Axis";
const string cLabel = "C-Axis";
Axis[] axes =
new Axis[] { x_axis, y_axis, z_axis, a_axis, b_axis, c_axis };
jointsMultiAxis.
AxesAdd(axes, axes.Length);
const string modelName = "RSI_XYZABC_Meters";
const double scaling = 1.0, offset = 0.0;
- C++
const int AXIS_COUNT = (2);
const int AXIS_X = 0;
const int AXIS_Y = 1;
const double USER_UNITS = 1048576;
const char* const PATH_MOTION_FILEPATH = "PathMotion.csv";
USE_HARDWARE = false;
double running_x = 0;
double running_y = 0;
double line_A[2] = { running_x, running_y };
running_x += -0.5;
double line_B[2] = { running_x, running_y };
running_y += -0.5;
double line_C[2] = { running_x, running_y };
running_y += (-0.25);
double arc_center_A[2] = { running_x,running_y };
running_x += (0.25);
running_x += -0.25;
double arc_center_B[2] = { running_x,running_y };
running_y += -0.25;
running_y += 0.25;
double arc_center_C[2] = { running_x,running_y };
running_x += -0.25;
running_x += 0.25;
double arc_center_D[2] = { running_x,running_y };
running_y += 0.25;
running_x += -0.5;
running_y += 0.5;
double line_D[2] = { running_x, running_y };
if (USE_HARDWARE)
{
}
else
{
}
try
{
axisX->
HomeMethodSet(RSIHomeMethod::RSIHomeMethodCURRENT_POSITION);
axisY->
HomeMethodSet(RSIHomeMethod::RSIHomeMethodCURRENT_POSITION);
std::ofstream myfile;
myfile.open(PATH_MOTION_FILEPATH);
myfile << "samples,x,y,\n";
}
myfile.close();
printf("\n%s\n", PATH_MOTION_FILEPATH);
}
{
printf("\n%s\n", err.text);
return -1;
}
return 0;
Gantry Prime Axis
Setup model with 1:1 geared axis.
- C#
const string xLabel = "X-Axis";
const string yLabel = "Y-Axis";
const string primeLabel = "Y-Prime";
Axis[] axes =
new Axis[] { x_axis, y_axis, prime_axis };
jointsMultiAxis.
AxesAdd(axes, axes.Length);
const string modelName = "RSI_XY_Yp";
const double scaling = 1.0, offset = 0.0;
const int motionFrameBufferSize = 50;
robot =
Robot.
RobotCreate(controller, jointsMultiAxis, builder, motionFrameBufferSize);
Changing Linear Units
How changing linear units affects vel and accel setters.
- C#
const string xLabel = "X-Axis";
const string yLabel = "Y-Axis";
const string zLabel = "Z-Axis";
const string aLabel = "A-Axis";
const string bLabel = "B-Axis";
const string cLabel = "C-Axis";
Axis[] axes =
new Axis[] { x_axis, y_axis, z_axis, a_axis, b_axis, c_axis };
jointsMultiAxis.
AxesAdd(axes, axes.Length);
const string modelName = "RSI_XYZABC_Millimeters";
const double scaling = 1.0, offset = 0.0;
3D Rendering
Get points in 3D space for rendering them.
- C#
const ulong frameCount = 500;
ulong totalFrames = frameCount;
ulong startFrame = 0;
while (totalFrames == frameCount)
{
totalFrames = positions.Size();
{
double xCoord = spatial.
X, yCoord = spatial.
Y, zCoord = spatial.
Z;
}
startFrame += totalFrames;
}