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>
115 template<
typename TOPIC_TYPE>
159 MotorLcsIf(std::shared_ptr<fcf::devmgr::common::IDeviceConfig> config,
173 void MoveAbs(
double position,
double velocity);
181 void MoveRel(
double position,
double velocity);
220 bool force_read =
true);
257 const fcf::common::Variant& value,
273 void MovePos(
double position,
double velocity, std::string move_type=
RPC_MOVE_ABS);
305 static std::timed_mutex m_mutex;
314 #include "motorLcsIf.ipp"
316 #endif //FCF_DEVMGR_DEVICE_MOTOR_IF_HPP
void SetEnableFlag(bool flag)
short GetInfoData2() const
void PublishPosition(const fcf::common::Variant &value, int attribute)
Publish Position.
bool m_mot_initialised
Definition: motorLcsIf.hpp:285
bool m_mot_signal_lhw
Definition: motorLcsIf.hpp:297
DataContext class header file.
@ STAT_MOTOR_END
Definition: motorLcsIf.hpp:148
@ STAT_AXIS_INFO2
Definition: motorLcsIf.hpp:137
bool IsMoving()
Check if motor is moving.
bool m_mot_signal_ustop
Definition: motorLcsIf.hpp:301
@ STAT_POS_ERROR
Definition: motorLcsIf.hpp:127
void SetTargetVel(double velocity)
void SetLockFlag(bool flag)
short GetInfoData1() const
virtual std::string GetRpcError(const short error_code) const
std::unique_ptr< rad::cii::Publisher< fcfif::MotorPositionTopic > > m_motor_publisher
Definition: motorLcsIf.hpp:277
void SetScaleFactor(double scale)
@ STAT_TARGET_POS
Definition: motorLcsIf.hpp:126
@ STAT_STATE
Definition: motorLcsIf.hpp:123
double m_mot_scale
Definition: motorLcsIf.hpp:284
bool m_brake
Definition: motorLcsIf.hpp:91
@ STAT_SCALE_FACTOR
Definition: motorLcsIf.hpp:147
bool m_ready
Definition: motorLcsIf.hpp:95
short m_mot_axis_info1
Definition: motorLcsIf.hpp:289
virtual std::string GetErrorText() const
double GetActualVel() const
bool GetSignalFlag(Signal signal) const
@ STAT_SUBSTATE
Definition: motorLcsIf.hpp:124
double m_actual_pos
Definition: motorLcsIf.hpp:86
virtual std::string GetSubstateStr() const
bool m_mot_axis_inpos
Definition: motorLcsIf.hpp:295
@ STAT_MODE
Definition: motorLcsIf.hpp:133
void Listener(fcf::common::VectorVariant ¶ms)
Callback to manage changes on the monitored items.
int m_mot_init_step
Definition: motorLcsIf.hpp:286
@ STAT_SIGNAL_REF
Definition: motorLcsIf.hpp:143
@ STAT_ERROR
Definition: motorLcsIf.hpp:121
bool m_locked
Definition: motorLcsIf.hpp:93
@ STAT_SIGNAL_LHW
Definition: motorLcsIf.hpp:142
bool m_mot_axis_ready
Definition: motorLcsIf.hpp:291
@ STAT_AXIS_ENABLE
Definition: motorLcsIf.hpp:131
Signal
Definition: motorConfig.hpp:173
bool IsStandstill()
Check if motor is on.
@ STAT_LOCAL
Definition: motorLcsIf.hpp:120
void SetTargetPos(double position)
bool GetInPositionFlag() const
virtual bool IsDisabling()
Check if controller is disabling the motor.
double GetPosError() const
bool GetBrakeFlag() const
int m_info_data2
Definition: motorLcsIf.hpp:98
@ STAT_INITIALISED
Definition: motorLcsIf.hpp:138
void SetInPositionFlag(bool flag)
virtual void ReadStatus(MotorControllerData &status, bool force_read=true)
Read status from the controller.
@ STAT_SIGNAL_LSTOP
Definition: motorLcsIf.hpp:141
std::vector< bool > m_signals
Definition: motorLcsIf.hpp:99
MotorControllerData()
Definition: motorLcsIf.cpp:4
deviceLcsIf class header file.
void SetActualPos(double position)
int m_mot_mode
Definition: motorLcsIf.hpp:288
bool m_mot_axis_brake
Definition: motorLcsIf.hpp:293
void MoveVel(double velocity)
Executes the MoveVel RPC.
double m_mot_pos_error
Definition: motorLcsIf.hpp:282
int m_mode
Definition: motorLcsIf.hpp:94
@ STAT_AXIS_BRAKE
Definition: motorLcsIf.hpp:130
Definition: dataContext.hpp:92
bool m_in_position
Definition: motorLcsIf.hpp:96
double m_target_pos
Definition: motorLcsIf.hpp:85
short m_mot_axis_info2
Definition: motorLcsIf.hpp:290
Definition: deviceLcsIf.hpp:75
@ STAT_HW_STATUS
Definition: motorLcsIf.hpp:122
void SetReadyFlag(bool flag)
double m_mot_target_pos
Definition: motorLcsIf.hpp:281
int m_mot_init_action
Definition: motorLcsIf.hpp:287
@ STAT_INIT_ACTION
Definition: motorLcsIf.hpp:140
void SetPosError(double pos_error)
void SetInfoData1(short info)
bool m_mot_signal_uhw
Definition: motorLcsIf.hpp:300
double m_pos_error
Definition: motorLcsIf.hpp:87
double m_mot_actual_pos
Definition: motorLcsIf.hpp:280
double GetActualPos() const
virtual ~MotorControllerData()
Definition: motorLcsIf.cpp:26
constexpr auto RPC_MOVE_ABS
Definition: motorConfig.hpp:110
void MoveAbs(double position, double velocity)
Executes the MoveAbs RPC.
@ STAT_AXIS_INPOS
Definition: motorLcsIf.hpp:135
double GetTargetVel() const
void SetBrakeFlag(bool flag)
virtual ~MotorLcsIf()
Default destructor.
Definition: motorLcsIf.hpp:165
@ STAT_AXIS_READY
Definition: motorLcsIf.hpp:134
double m_scale_factor
Definition: motorLcsIf.hpp:90
bool m_mot_signal_ref
Definition: motorLcsIf.hpp:298
bool GetEnableFlag() const
std::unique_ptr< rad::cii::Publisher< TOPIC_TYPE > > m_publisher
Definition: motorLcsIf.hpp:278
void StoreAttribute(const std::string key, const fcf::common::Variant &value, bool publish, int attribute)
Store the updated into the DB.
void SetActualVel(double velocity)
void SetSignalFlag(Signal signal, bool flag)
@ STAT_TARGET_VEL
Definition: motorLcsIf.hpp:129
bool GetReadyFlag() const
bool m_mot_signal_lstop
Definition: motorLcsIf.hpp:296
@ STAT_ACTUAL_POS
Definition: motorLcsIf.hpp:125
@ STAT_SIGNAL_UHW
Definition: motorLcsIf.hpp:145
@ STAT_ACTUAL_VEL
Definition: motorLcsIf.hpp:128
double GetScaleFactor() const
void MoveRel(double position, double velocity)
Executes the MoveRel RPC.
double m_mot_actual_vel
Definition: motorLcsIf.hpp:283
int m_info_data1
Definition: motorLcsIf.hpp:97
void SetInfoData2(short info)
bool m_mot_axis_lock
Definition: motorLcsIf.hpp:294
The DeviceControllerData struct.
Definition: deviceLcsIf.hpp:34
double m_target_vel
Definition: motorLcsIf.hpp:89
bool m_enabled
Definition: motorLcsIf.hpp:92
@ STAT_AXIS_LOCK
Definition: motorLcsIf.hpp:132
@ STAT_INIT_STEP
Definition: motorLcsIf.hpp:139
MotorConfig class header file.
bool m_mot_axis_enable
Definition: motorLcsIf.hpp:292
double m_actual_vel
Definition: motorLcsIf.hpp:88
void SetData(const MotorControllerData &data)
Definition: motorLcsIf.cpp:29
MotorLcsIf(std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config, fcf::devmgr::common::DataContext &data_ctx, bool initialise=true)
MotorLcsIf constructor.
double GetTargetPos() const
@ STAT_AXIS_INFO1
Definition: motorLcsIf.hpp:136
Motor Local Control System (LCS) Interface (IF) class.
Definition: motorLcsIf.hpp:117
bool m_mot_signal_index
Definition: motorLcsIf.hpp:299
@ STAT_SIGNAL_INDEX
Definition: motorLcsIf.hpp:144
@ STAT_SIGNAL_USTOP
Definition: motorLcsIf.hpp:146
The MotorControllerData struct.
Definition: motorLcsIf.hpp:34