cmvr-es/include/hardware/can/abstractmotor.h

35 lines
854 B
C
Raw Normal View History

2025-10-22 16:40:55 +08:00
//
// Created by linbo on 2025/10/22.
//
#ifndef CMVR_ES_ABSTRACTMOTOR_H
#define CMVR_ES_ABSTRACTMOTOR_H
#include "rapidxml/xml_parser.h"
namespace cmvr::device
{
class AbstractMotor
{
public:
explicit AbstractMotor(const XmlNode &cfg)
{
cfg_ = cfg;
id_ = cfg.getAttrString("id");
joint_name_ = cfg.getAttrString("joint_name");
limitQLb_ = cfg.getAttrDefault("limitQLb_",(float)3.14);
limitQUb_ = cfg.getAttrDefault("limitQUb_",(float)3.14);
limitQd = cfg.getAttrDefault("limitQd",(float)3.0);
}
~AbstractMotor() = default;
private:
XmlNode cfg_;
std::string id_;
std::string joint_name_;
double limitQLb_;
double limitQUb_;
double limitQd;
};
}
#endif //CMVR_ES_ABSTRACTMOTOR_H