6#ifndef RMP_INSTALL_PATH
7#define RMP_INSTALL_PATH ""
11#include <source_location>
27 inline constexpr char RMP_PATH[] = RMP_INSTALL_PATH;
44 std::ostringstream message;
45 message <<
"You must implement the " << __func__ <<
" function (found in " << __FILE__ <<
" line " << __LINE__ <<
") to use hardware.";
46 throw std::runtime_error(message.str().c_str());
100 Axis* axis = controller->AxisGet(axisIndex);
115 const double positionToleranceMax =
116 std::numeric_limits<double>::max() /
144 std::ostringstream message;
145 message <<
"The Sample Apps are configured to use Phantom Axes, but the network is not in the UNINITIALIZED or SHUTDOWN state.\n"
146 <<
"If you intended to run with hardware, then follow the steps in README.md and /src/config.h\n"
147 <<
"Otherwise, shutdown the network before running the sample apps with phantom axes.";
149 throw std::runtime_error(message.str().c_str());
159 int axisCount = controller->AxisCountGet();
160 if (axisCount < numAxes)
162 std::ostringstream message;
163 message <<
"Error! Not enough axes configured. Expected " << numAxes <<
" axes but only found " << axisCount <<
" axes."
164 <<
"Please configure the axes in the Config::ConfigureHardwareAxes function.";
165 throw std::runtime_error(message.str().c_str());
177 controller->AxisCountSet(numAxes);
180 for (
int i = 0; i < numAxes; i++)
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,...
Represents the RMP soft motion controller. This class provides an interface to general controller con...
@ RSINetworkStateSHUTDOWN
EtherCAT was shutdown or stopped, must restart.
@ RSINetworkStateUNINITIALIZED
EtherCAT not yet started.
@ RSIActionNONE
None - do not perform any action.
@ RSIMotorTypePHANTOM
Phantom motor (nothing physically connected).
static int initialAxisCount
[ConfigurePhantomAxis]
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 ConfigurePhantomAxis(MotionController *controller, int axisIndex)
[GetCreationParameters]
void Cleanup(MotionController *controller)
[SetupController]
void ConfigureHardwareAxes(MotionController *controller)
Configures the hardware axes according to user specified implementation.
This namespace provides static methods and constants for user configuration in RMP applications....
constexpr int CPU_AFFINITY
(Linux only) CPU core to use. This should be an isolated core.
static int initialMotionCount
Initial motion count to restore later (-1 indicates it has not been set).
constexpr char NIC_PRIMARY[]
Name of the NIC to use for the EtherCAT network (not needed for running on phantom axes).
constexpr bool USE_HARDWARE
Flag for whether to use hardware or phantom axes.
constexpr char RMP_PATH[]
Path to the RMP.rta file (usually the RapidSetup folder).
constexpr char NODE_NAME[]
(Windows only) INtime node name. Use "" for default node.
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 NetworkStart(MotionController *controller)
[CheckErrors]
char NodeName[PathLengthMaximum]
[Windows/INtime] Indicate the INtime node on which the RMP and RMPNetwork processes run.
char RmpPath[PathLengthMaximum]
Location of the RMP firmware executable, license, and associated binaries and resources.
int32_t CpuAffinity
[Linux] Indicate the CPU core on which the RMP and RMPNetwork processes run.
char NicPrimary[PathLengthMaximum]
Primary EtherCAT Network Interface (NIC) name.
static constexpr uint32_t PathLengthMaximum
MotionController::CreationParameters Maximum string buffer length.
CreationParameters for MotionController::Create.