#include "helpers.h"
#include "config.h"
#include "rsi.h"
int main()
{
const std::string SAMPLE_APP_NAME = "📜 Axis: Phantom Axis";
const int NUM_AXES = 1;
const int AXIS_INDEX = 0;
int exitCode = -1;
try
{
Axis *axis = controller->AxisGet(AXIS_INDEX);
const double positionToleranceMax = std::numeric_limits<double>::max() / 10.0;
std::cout << "Phantom Axis created with index: " << AXIS_INDEX << std::endl;
exitCode = 0;
}
catch (const std::exception &ex)
{
std::cerr << ex.what() << std::endl;
exitCode = -1;
}
controller->Delete();
return exitCode;
}
void HardwareNegLimitActionSet(RSIAction action)
Set the action that will occur when the Hardware Negative Limit Event triggers.
void HardwarePosLimitActionSet(RSIAction action)
Set the action that will occur when the Hardware Positive Limit Event triggers.
void PositionToleranceCoarseSet(double tolerance)
Set the Coarse Position Tolerance for Axis settling.
void SoftwareNegLimitActionSet(RSIAction action)
Set the action that will occur when the Software Negative Limit Event triggers.
void AmpFaultActionSet(RSIAction action)
Set the Amp Fault action.
void AmpFaultTriggerStateSet(bool state)
Set the trigger state of the Amp Fault input.
void HomeActionSet(RSIAction action)
Set the action that will occur when the Home Event triggers.
void PositionToleranceFineSet(double tolerance)
Set the Fine Position Tolerance for Axis settling.
void ErrorLimitActionSet(RSIAction action)
Set the action that will occur when the Error Limit Event triggers.
void MotorTypeSet(RSIMotorType type)
Set the motor type.
void PositionSet(double position)
Set the Command and Actual positions.
void SoftwarePosLimitActionSet(RSIAction action)
Set the action that will occur when the Software Positive Limit Event triggers.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
static MotionController * Create(CreationParameters *creationParameters)
Initialize and start the RMP EtherCAT controller.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
@ RSIActionNONE
None - do not perform any action.
@ RSIMotorTypePHANTOM
Phantom motor (nothing physically connected).
void SetupController(MotionController *controller, int numAxes=0)
Setup the controller and check if the network is in the correct state for the configuration.
MotionController::CreationParameters GetCreationParameters()
Returns a MotionController::CreationParameters object with user-defined parameters.
void Cleanup(MotionController *controller)
[SetupController]
void CheckErrors(RapidCodeObject *rsiObject, const std::source_location &location=std::source_location::current())
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
void PrintHeader(std::string sampleAppName)
[NetworkShutdown]
void PrintFooter(std::string sampleAppName, int exitCode)
[PrintHeader]
CreationParameters for MotionController::Create.