32 lines
678 B
C++
32 lines
678 B
C++
#ifndef CONTROLLER_BASE_H
|
|
#define CONTROLLER_BASE_H
|
|
|
|
#include <memory>
|
|
#include <Eigen/Dense>
|
|
|
|
namespace robot_control {
|
|
namespace control {
|
|
|
|
class ControllerBase {
|
|
public:
|
|
using Ptr = std::shared_ptr<ControllerBase>;
|
|
using ConstPtr = std::shared_ptr<const ControllerBase>;
|
|
|
|
ControllerBase() = default;
|
|
~ControllerBase() = default;
|
|
|
|
// 计算控制输入
|
|
Eigen::VectorXd computeControl(const t, const x);
|
|
|
|
// 重置控制器
|
|
virtual void reset() = 0;
|
|
|
|
// 检查是否到达目标
|
|
virtual bool isGoalReached(const ocs2::vector_t& x) const = 0;
|
|
};
|
|
|
|
} // namespace control
|
|
} // namespace robot_control
|
|
|
|
#endif // CONTROLLER_BASE_H
|