ros2_canopen master
C++ ROS CANopen Library
Loading...
Searching...
No Matches
base.hpp
Go to the documentation of this file.
1// Copyright 2023 Christoph Hellmann Santos
2// Copyright 2014-2022 Authors of ros_canopen
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16//
17#ifndef CANOPEN_402_BASE_H
18#define CANOPEN_402_BASE_H
19#include <string>
20
21#include "lely/coapp/driver.hpp"
22#include "lely/coapp/master.hpp"
23
24namespace ros2_canopen
25{
26
32{
33protected:
35
36public:
51
59 virtual bool setTarget(double val) = 0;
60
68 virtual bool enterModeAndWait(uint16_t mode) = 0;
69
77 virtual bool isModeSupported(uint16_t mode) = 0;
78
84 virtual uint16_t getMode() = 0;
85
90 virtual void registerDefaultModes() {}
91
92 typedef std::shared_ptr<MotorBase> MotorBaseSharedPtr;
93};
95
96} // namespace ros2_canopen
97
98#endif
Motor Base Class.
Definition base.hpp:32
MotorBase()
Definition base.hpp:34
virtual void registerDefaultModes()
Register default Operation Modes.
Definition base.hpp:90
virtual uint16_t getMode()=0
Get current Mode.
virtual bool setTarget(double val)=0
Set target.
virtual bool isModeSupported(uint16_t mode)=0
Check if Operation Mode is supported.
virtual bool enterModeAndWait(uint16_t mode)=0
Enter Operation Mode.
std::shared_ptr< MotorBase > MotorBaseSharedPtr
Definition base.hpp:92
OperationMode
Definition base.hpp:38
@ Profiled_Velocity
Definition base.hpp:42
@ Cyclic_Synchronous_Velocity
Definition base.hpp:48
@ Cyclic_Synchronous_Torque
Definition base.hpp:49
@ Cyclic_Synchronous_Position
Definition base.hpp:47
@ No_Mode
Definition base.hpp:39
@ Profiled_Position
Definition base.hpp:40
@ Homing
Definition base.hpp:45
@ Reserved
Definition base.hpp:44
@ Profiled_Torque
Definition base.hpp:43
@ Interpolated_Position
Definition base.hpp:46
@ Velocity
Definition base.hpp:41
Definition configuration_manager.hpp:28
MotorBase::MotorBaseSharedPtr MotorBaseSharedPtr
Definition base.hpp:94