62using RSI.RapidCode.dotNET;
68public class Motion : SampleAppTestBase
70 [Test, Timeout(Constants.MAX_TEST_TIME)]
71 public void AbsoluteMotion()
75 axis.
MoveTrapezoidal(Constants.POSITION, Constants.VELOCITY, Constants.ACCELERATION, Constants.DECELERATION);
80 Assert.That(axis.
CommandPositionGet(), Is.EqualTo(Constants.POSITION),
"The command position should be equal to POSITION");
83 [Test, Timeout(Constants.MAX_TEST_TIME)]
84 public void SCurveMotion()
92 Assert.That(axis.
CommandPositionGet(), Is.EqualTo(Constants.POSITION),
"The command position should be equal to POSITION");
95 [Test, Timeout(Constants.MAX_TEST_TIME)]
96 public void FinalVelocity()
99 int finalVelocity = 5;
104 Constants.ACCELERATION,
105 Constants.DECELERATION,
106 Constants.JERK_PERCENT,
112 Assert.That(axis.
CommandVelocityGet(), Is.EqualTo(finalVelocity),
"The command velocity should be equal to FINAL_VELOCITY");
118 [Test, Timeout(Constants.MAX_TEST_TIME)]
119 public void RelativeMotion()
122 axis.
MoveRelative(Constants.POSITION, Constants.VELOCITY, Constants.ACCELERATION, Constants.DECELERATION, Constants.JERK_PERCENT);
128 axis.
MoveRelative(-1 * Constants.POSITION, Constants.VELOCITY, Constants.ACCELERATION, Constants.DECELERATION, Constants.JERK_PERCENT);
133 Assert.That(cmdPositionAfterMove, Is.EqualTo(Constants.POSITION),
"The command position should be equal to POSITION");
137 public void MoveVelocity()
141 axis.
MoveVelocity(Constants.VELOCITY, Constants.ACCELERATION);
146 Assert.That(axis.
CommandVelocityGet(), Is.EqualTo(Constants.VELOCITY),
"The command velocity should be equal to FINAL_VELOCITY");
double CommandPositionGet()
Get the current command position.
void MoveVelocity(double velocity)
void MoveTrapezoidal(double position, double vel, double accel, double decel)
Point-to-point trapezoidal move.
double CommandVelocityGet()
Get the current commanded velocity.
void MoveRelative(double relativePosition, double vel, double accel, double decel, double jerkPct)
Command a relative point-to-point S-Curve motion.
void MoveSCurve(double position, double vel, double accel, double decel, double jerkPct)
Command a point-to-point S-Curve motion.
int32_t MotionDoneWait()
Waits for a move to complete.