motion_module.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright 2018 ROBOTIS CO., LTD.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16 
17 /*
18  * motion_module.h
19  *
20  * Created on: 2016. 1. 15.
21  * Author: zerom
22  */
23 
24 #ifndef ROBOTIS_FRAMEWORK_COMMON_MOTION_MODULE_H_
25 #define ROBOTIS_FRAMEWORK_COMMON_MOTION_MODULE_H_
26 
27 
28 #include <map>
29 #include <string>
30 
31 #include "singleton.h"
32 #include "robotis_device/robot.h"
34 
35 namespace robotis_framework
36 {
37 
39 {
43 };
44 
46 {
47 protected:
48  bool enable_;
49  std::string module_name_;
51 
52 public:
53  std::map<std::string, DynamixelState *> result_;
54 
55  virtual ~MotionModule() { }
56 
57  std::string getModuleName() { return module_name_; }
59 
60  void setModuleEnable(bool enable)
61  {
62  if(this->enable_ == enable)
63  return;
64 
65  this->enable_ = enable;
66  if(enable)
68  else
70  }
71  bool getModuleEnable() { return enable_; }
72 
73  virtual void onModuleEnable() { }
74  virtual void onModuleDisable() { }
75 
76  virtual void initialize(const int control_cycle_msec, Robot *robot) = 0;
77  virtual void process(std::map<std::string, Dynamixel *> dxls, std::map<std::string, double> sensors) = 0;
78 
79  virtual void stop() = 0;
80  virtual bool isRunning() = 0;
81 };
82 
83 
84 }
85 
86 
87 #endif /* ROBOTIS_FRAMEWORK_COMMON_MOTION_MODULE_H_ */
std::map< std::string, DynamixelState * > result_
Definition: motion_module.h:53
void setModuleEnable(bool enable)
Definition: motion_module.h:60
virtual void initialize(const int control_cycle_msec, Robot *robot)=0
virtual void process(std::map< std::string, Dynamixel * > dxls, std::map< std::string, double > sensors)=0


robotis_framework_common
Author(s): Zerom , Kayman , SCH
autogenerated on Mon Jun 10 2019 14:35:11