robot.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  * robot.h
19  *
20  * Created on: 2015. 12. 11.
21  * Author: zerom
22  */
23 
24 #ifndef ROBOTIS_DEVICE_ROBOT_H_
25 #define ROBOTIS_DEVICE_ROBOT_H_
26 
27 
28 #include <vector>
29 
30 #include "sensor.h"
31 #include "dynamixel.h"
33 
34 #define DYNAMIXEL "dynamixel"
35 #define SENSOR "sensor"
36 
37 #define SESSION_CONTROL_INFO "control info"
38 #define SESSION_PORT_INFO "port info"
39 #define SESSION_DEVICE_INFO "device info"
40 
41 #define SESSION_TYPE_INFO "type info"
42 #define SESSION_CONTROL_TABLE "control table"
43 
44 #define DEFAULT_CONTROL_CYCLE 8 // milliseconds
45 
46 namespace robotis_framework
47 {
48 
49 class Robot
50 {
51 private:
53 
54 public:
55  std::map<std::string, dynamixel::PortHandler *> ports_; // string: port name
56  std::map<std::string, std::string> port_default_device_; // port name, default device name
57 
58  std::map<std::string, Dynamixel *> dxls_; // string: joint name
59  std::map<std::string, Sensor *> sensors_; // string: sensor name
60 
61  Robot(std::string robot_file_path, std::string dev_desc_dir_path);
62 
63  Sensor *getSensor(std::string path, int id, std::string port, float protocol_version);
64  Dynamixel *getDynamixel(std::string path, int id, std::string port, float protocol_version);
65 
66  int getControlCycle();
67 };
68 
69 }
70 
71 
72 #endif /* ROBOTIS_DEVICE_ROBOT_H_ */
Dynamixel * getDynamixel(std::string path, int id, std::string port, float protocol_version)
Definition: robot.cpp:315
Robot(std::string robot_file_path, std::string dev_desc_dir_path)
Definition: robot.cpp:64
std::map< std::string, dynamixel::PortHandler * > ports_
Definition: robot.h:55
std::map< std::string, Dynamixel * > dxls_
Definition: robot.h:58
std::map< std::string, std::string > port_default_device_
Definition: robot.h:56
std::map< std::string, Sensor * > sensors_
Definition: robot.h:59
Sensor * getSensor(std::string path, int id, std::string port, float protocol_version)
Definition: robot.cpp:229


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