APIs, concepts, guides, and more

◆ SetupController()

static void SetupController ( MotionController * controller)
static
static void SetupController(MotionController *controller)
{
// Set the axis and motion counts
// Get the axis objects and check them for errors
CheckErrors(axisX);
CheckErrors(axisY);
// Check if we are using hardware or phantom axes
{
SampleAppsConfig::ConfigureHardwareAxes(controller, {axisX, axisY});
}
else
{
// Set the user units
// Configure them as phantoms
}
// Clear Faults
axisX->ClearFaults();
axisY->ClearFaults();
// Start or shutdown the network depending on the configuration
{
StartTheNetwork(controller);
}
else
{
if (controller->NetworkStateGet() != RSINetworkState::RSINetworkStateUNINITIALIZED &&
controller->NetworkStateGet() != RSINetworkState::RSINetworkStateSHUTDOWN)
{
std::cout << "The Sample Apps are configured to use Phantom Axes, but the network is not in the UNINITIALIZED or SHUTDOWN state.\n";
std::cout << "If you intended to run with hardware, then follow the steps in README.md and /include/SampleAppsHelper.h\n";
}
ShutdownTheNetwork(controller);
}
}
Examples
AxisConfiguration.cpp, CalculateAccelerationFromVelocity.cpp, DifferenceOfPositionUserLimit.cpp, PhantomAxis.cpp, PointToPoint.cpp, and SampleAppsHelper.h.

Definition at line 337 of file SampleAppsHelper.h.