7#ifndef FCF_DEVMGR_DEVICE_MOTOR_BASE_IF_HPP
8#define FCF_DEVMGR_DEVICE_MOTOR_BASE_IF_HPP
10#include <unordered_map>
12#include <yaml-cpp/yaml.h>
19#include <rad/mal/publisher.hpp>
51 double m_target_pos {};
52 double m_actual_pos {};
53 double m_pos_error {};
54 double m_actual_vel {};
55 double m_target_vel {};
56 double m_scale_factor {1};
57 std::string m_user_unit {
""};
103 MotorBaseLcsIf(std::shared_ptr<ifw::fcf::devmgr::common::IDeviceConfig> config,
117 void MoveAbs(
double position, ::fcfif::MotorPosUnit unit = ::fcfif::MotorPosUnit::UU);
134 void MoveRel(
double position, ::fcfif::MotorPosUnit unit = ::fcfif::MotorPosUnit::UU);
222 log4cplus::Logger m_logger;
229#include "motorBaseLcsIf.ipp"
Definition dataContext.hpp:86
Definition deviceLcsIf.hpp:84
Motor Local Control System (LCS) Interface (IF) class.
Definition motorBaseLcsIf.hpp:75
std::optional< double > GetTargetInUserUnits(double value)
Definition motorBaseLcsIf.cpp:66
bool m_mot_initialised
Definition motorBaseLcsIf.hpp:217
double m_mot_actual_enc
Definition motorBaseLcsIf.hpp:209
@ STAT_INITIALISED
Definition motorBaseLcsIf.hpp:88
@ STAT_STATE
Definition motorBaseLcsIf.hpp:81
@ STAT_HW_STATUS
Definition motorBaseLcsIf.hpp:80
@ STAT_ACTUAL_VEL
Definition motorBaseLcsIf.hpp:86
@ STAT_USER_UNIT
Definition motorBaseLcsIf.hpp:89
@ STAT_TARGET_VEL
Definition motorBaseLcsIf.hpp:87
@ STAT_SUBSTATE
Definition motorBaseLcsIf.hpp:82
@ STAT_ACTUAL_POS
Definition motorBaseLcsIf.hpp:83
@ STAT_POS_ERROR
Definition motorBaseLcsIf.hpp:85
@ STAT_LOCAL
Definition motorBaseLcsIf.hpp:78
@ STAT_TARGET_POS
Definition motorBaseLcsIf.hpp:84
@ STAT_MOTOR_BASE_END
Definition motorBaseLcsIf.hpp:90
@ STAT_ERROR
Definition motorBaseLcsIf.hpp:79
MotorBaseLcsIf(std::shared_ptr< ifw::fcf::devmgr::common::IDeviceConfig > config, ifw::fcf::devmgr::common::DataContext &data_ctx)
MotorLcsIf constructor.
Definition motorBaseLcsIf.cpp:57
double m_mot_actual_pos
Definition motorBaseLcsIf.hpp:208
std::string m_mot_user_unit
Definition motorBaseLcsIf.hpp:218
bool IsInPosition() const
Check if motor is in position.
Definition motorBaseLcsIf.cpp:289
double m_mot_scale
Definition motorBaseLcsIf.hpp:216
void MoveEncAbs(int encoders)
Executes the MoveAbs RPC.
Definition motorBaseLcsIf.cpp:139
void MoveEncRel(int encoders)
Executes the MoveRel RPC.
Definition motorBaseLcsIf.cpp:152
void MovePos(double position, double velocity, std::string move_type=RPC_MOVE_ABS)
Definition motorBaseLcsIf.cpp:183
virtual ~MotorBaseLcsIf()
Default destructor.
Definition motorBaseLcsIf.hpp:109
bool IsMoving() const
Check if motor is moving.
Definition motorBaseLcsIf.cpp:264
void MoveVel(double velocity)
Executes the MoveVel RPC.
Definition motorBaseLcsIf.cpp:227
void SetTargetNamedPosition(const std::string named_position)
Definition motorBaseLcsIf.cpp:318
double m_mot_actual_vel
Definition motorBaseLcsIf.hpp:215
std::string m_mot_target_name
Definition motorBaseLcsIf.hpp:210
double m_mot_target_vel
Definition motorBaseLcsIf.hpp:214
virtual bool IsDisabling() const
Check if controller is disabling the motor.
Definition motorBaseLcsIf.cpp:219
double m_mot_target_pos
Definition motorBaseLcsIf.hpp:212
std::string m_mot_actual_name
Definition motorBaseLcsIf.hpp:211
void MoveByName(std::string namedpos)
Executes the MovePos RPC.
Definition motorBaseLcsIf.cpp:165
void MoveRel(double position, ::fcfif::MotorPosUnit unit=::fcfif::MotorPosUnit::UU)
Executes the MoveRel RPC.
Definition motorBaseLcsIf.cpp:112
void MoveAbs(double position, ::fcfif::MotorPosUnit unit=::fcfif::MotorPosUnit::UU)
Executes the MoveAbs RPC.
Definition motorBaseLcsIf.cpp:86
double m_mot_pos_error
Definition motorBaseLcsIf.hpp:213
bool IsStandstill() const
Check if motor is on.
Definition motorBaseLcsIf.cpp:279
const std::string GetTargetNamedPosition()
Definition motorBaseLcsIf.cpp:325
bool IsMovingInRightDirection() const
Check if motor is moving in the right direction.
Definition motorBaseLcsIf.cpp:303
Motor class source file.
Definition motor.hpp:17
constexpr auto RPC_MOVE_ABS
Definition motorBaseConfig.hpp:46
The DeviceControllerData struct.
Definition deviceLcsIf.hpp:42
The MotorBaseControllerData struct.
Definition motorBaseLcsIf.hpp:31
void SetTargetPos(double position)
void SetActualVel(double velocity)
void SetActualPos(double position)
virtual ~MotorBaseControllerData()
Definition motorBaseLcsIf.cpp:52
double GetActualPos() const
double GetActualVel() const
std::string GetUserUnit() const
void SetUserUnit(const std::string &unit)
double GetTargetVel() const
virtual std::string GetSubstateStr() const
double GetPosError() const
void SetPosError(double pos_error)
void SetTargetVel(double velocity)
MotorBaseControllerData()
Definition motorBaseLcsIf.cpp:40
double GetTargetPos() const