Go to the documentation of this file.
9 #ifndef FCF_DEVMGR_DEVICE_MOTOR_IF_HPP
10 #define FCF_DEVMGR_DEVICE_MOTOR_IF_HPP
13 #include <unordered_map>
16 #include <yaml-cpp/yaml.h>
23 #include <rad/mal/publisher.hpp>
159 MotorLcsIf(std::shared_ptr<fcf::devmgr::common::IDeviceConfig> config,
265 void Listener(fcf::common::VectorVariant& params);
272 virtual std::string
GetRpcError(
const short error_code)
const;
289 void MovePos(
double position,
double velocity, std::string move_type=
RPC_MOVE_ABS);
322 log4cplus::Logger m_logger;
329 #include "motorLcsIf.ipp"
331 #endif //FCF_DEVMGR_DEVICE_MOTOR_IF_HPP
double m_mot_actual_enc
Definition: motorLcsIf.hpp:297
void SetEnableFlag(bool flag)
short GetInfoData2() const
bool m_mot_axis_ready
Definition: motorLcsIf.hpp:309
double m_mot_pos_error
Definition: motorLcsIf.hpp:300
@ STAT_AXIS_LOCK
Definition: motorLcsIf.hpp:131
@ STAT_POS_ERROR
Definition: motorLcsIf.hpp:126
void MoveVel(double velocity)
Executes the MoveVel RPC.
Definition: motorLcsIf.cpp:197
DataContext class header file.
bool IsMoving() const
Check if motor is moving.
Definition: motorLcsIf.cpp:230
void MoveByName(std::string namedpos)
Executes the MovePos RPC.
Definition: motorLcsIf.cpp:134
@ STAT_INIT_STEP
Definition: motorLcsIf.hpp:138
std::string m_mot_actual_name
Definition: motorLcsIf.hpp:298
void SetTargetVel(double velocity)
void SetLockFlag(bool flag)
short GetInfoData1() const
double m_mot_actual_pos
Definition: motorLcsIf.hpp:296
@ STAT_STATE
Definition: motorLcsIf.hpp:122
@ STAT_AXIS_INFO1
Definition: motorLcsIf.hpp:135
int m_mot_mode
Definition: motorLcsIf.hpp:306
void SetScaleFactor(double scale)
virtual bool IsDisabling()
Check if controller is disabling the motor.
Definition: motorLcsIf.cpp:189
@ STAT_TARGET_VEL
Definition: motorLcsIf.hpp:128
virtual void ReadStatus(MotorControllerData &status)
Read status from the controller.
Definition: motorLcsIf.cpp:268
bool m_brake
Definition: motorLcsIf.hpp:91
short m_mot_axis_info2
Definition: motorLcsIf.hpp:308
bool m_ready
Definition: motorLcsIf.hpp:95
virtual std::string GetErrorText() const
double GetActualVel() const
bool GetSignalFlag(Signal signal) const
bool m_mot_axis_inpos
Definition: motorLcsIf.hpp:313
double m_actual_pos
Definition: motorLcsIf.hpp:86
@ STAT_MODE
Definition: motorLcsIf.hpp:132
bool IsInPosition() const
Check if motor is in position.
Definition: motorLcsIf.cpp:255
virtual std::string GetSubstateStr() const
@ STAT_SIGNAL_LHW
Definition: motorLcsIf.hpp:141
void MoveRel(double position)
Executes the MoveRel RPC.
Definition: motorLcsIf.cpp:95
@ STAT_SIGNAL_LSTOP
Definition: motorLcsIf.hpp:140
@ STAT_SIGNAL_REF
Definition: motorLcsIf.hpp:142
bool m_locked
Definition: motorLcsIf.hpp:93
double m_mot_actual_vel
Definition: motorLcsIf.hpp:301
bool m_mot_initialised
Definition: motorLcsIf.hpp:303
@ STAT_SIGNAL_USTOP
Definition: motorLcsIf.hpp:145
Signal
Definition: motorConfig.hpp:176
@ STAT_INIT_ACTION
Definition: motorLcsIf.hpp:139
MotorLcsIf(std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config, fcf::devmgr::common::DataContext &data_ctx)
MotorLcsIf constructor.
Definition: motorLcsIf.cpp:35
void SetTargetPos(double position)
bool GetInPositionFlag() const
double GetPosError() const
bool GetBrakeFlag() const
int m_info_data2
Definition: motorLcsIf.hpp:98
@ STAT_ERROR
Definition: motorLcsIf.hpp:120
void SetInPositionFlag(bool flag)
@ STAT_AXIS_ENABLE
Definition: motorLcsIf.hpp:130
std::vector< bool > m_signals
Definition: motorLcsIf.hpp:99
@ STAT_ACTUAL_POS
Definition: motorLcsIf.hpp:124
@ STAT_ACTUAL_VEL
Definition: motorLcsIf.hpp:127
@ STAT_AXIS_INFO2
Definition: motorLcsIf.hpp:136
MotorControllerData()
Definition: motorLcsIf.cpp:4
deviceLcsIf class header file.
virtual ~MotorLcsIf()
Default destructor.
Definition: motorLcsIf.hpp:165
void SetActualPos(double position)
bool m_mot_axis_enable
Definition: motorLcsIf.hpp:310
@ STAT_MOTOR_END
Definition: motorLcsIf.hpp:147
void Listener(fcf::common::VectorVariant ¶ms)
Callback to manage changes on the monitored items.
Definition: motorLcsIf.cpp:286
@ STAT_AXIS_INPOS
Definition: motorLcsIf.hpp:134
bool m_mot_axis_lock
Definition: motorLcsIf.hpp:312
void StorePosition(const fcf::common::Variant &value, int attribute)
Store Position.
Definition: motorLcsIf.cpp:510
int m_mode
Definition: motorLcsIf.hpp:94
@ STAT_SIGNAL_UHW
Definition: motorLcsIf.hpp:144
@ STAT_HW_STATUS
Definition: motorLcsIf.hpp:121
Definition: dataContext.hpp:90
void MoveEncAbs(int encoders)
Executes the MoveAbs RPC.
Definition: motorLcsIf.cpp:108
short m_mot_axis_info1
Definition: motorLcsIf.hpp:307
bool m_in_position
Definition: motorLcsIf.hpp:96
double m_target_pos
Definition: motorLcsIf.hpp:85
Definition: deviceLcsIf.hpp:77
int m_mot_init_action
Definition: motorLcsIf.hpp:305
bool m_mot_signal_ref
Definition: motorLcsIf.hpp:316
void SetReadyFlag(bool flag)
void SetPosError(double pos_error)
void SetInfoData1(short info)
double m_pos_error
Definition: motorLcsIf.hpp:87
double GetActualPos() const
virtual ~MotorControllerData()
Definition: motorLcsIf.cpp:26
bool m_mot_signal_ustop
Definition: motorLcsIf.hpp:319
constexpr auto RPC_MOVE_ABS
Definition: motorConfig.hpp:113
bool m_mot_signal_index
Definition: motorLcsIf.hpp:317
double GetTargetVel() const
void SetBrakeFlag(bool flag)
@ STAT_SUBSTATE
Definition: motorLcsIf.hpp:123
double m_scale_factor
Definition: motorLcsIf.hpp:90
virtual std::string GetRpcError(const short error_code) const
Definition: motorLcsIf.cpp:477
bool GetEnableFlag() const
@ STAT_LOCAL
Definition: motorLcsIf.hpp:119
double m_mot_scale
Definition: motorLcsIf.hpp:302
bool IsStandstill() const
Check if motor is on.
Definition: motorLcsIf.cpp:245
void SetActualVel(double velocity)
void SetSignalFlag(Signal signal, bool flag)
@ STAT_SIGNAL_INDEX
Definition: motorLcsIf.hpp:143
void MoveAbs(double position)
Executes the MoveAbs RPC.
Definition: motorLcsIf.cpp:82
bool GetReadyFlag() const
bool m_mot_signal_lstop
Definition: motorLcsIf.hpp:314
bool m_mot_signal_lhw
Definition: motorLcsIf.hpp:315
@ STAT_SCALE_FACTOR
Definition: motorLcsIf.hpp:146
double GetScaleFactor() const
void MoveEncRel(int encoders)
Executes the MoveRel RPC.
Definition: motorLcsIf.cpp:121
@ STAT_INITIALISED
Definition: motorLcsIf.hpp:137
bool m_mot_signal_uhw
Definition: motorLcsIf.hpp:318
int m_info_data1
Definition: motorLcsIf.hpp:97
void SetInfoData2(short info)
The DeviceControllerData struct.
Definition: deviceLcsIf.hpp:36
double m_target_vel
Definition: motorLcsIf.hpp:89
bool m_enabled
Definition: motorLcsIf.hpp:92
double m_mot_target_pos
Definition: motorLcsIf.hpp:299
@ STAT_AXIS_READY
Definition: motorLcsIf.hpp:133
MotorConfig class header file.
double m_actual_vel
Definition: motorLcsIf.hpp:88
void SetData(const MotorControllerData &data)
Definition: motorLcsIf.cpp:29
double GetTargetPos() const
int m_mot_init_step
Definition: motorLcsIf.hpp:304
@ STAT_AXIS_BRAKE
Definition: motorLcsIf.hpp:129
bool m_mot_axis_brake
Definition: motorLcsIf.hpp:311
@ STAT_TARGET_POS
Definition: motorLcsIf.hpp:125
Motor Local Control System (LCS) Interface (IF) class.
Definition: motorLcsIf.hpp:116
The MotorControllerData struct.
Definition: motorLcsIf.hpp:34