1
1
/* ******************************************************************************
2
- * Copyright 2020 ROBOTIS CO., LTD.
2
+ * Copyright 2024 ROBOTIS CO., LTD.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*******************************************************************************/
16
- /* Authors: Hye-Jong KIM, Yong-Ho Na */
16
+ /* Authors: Hye-Jong KIM*/
17
17
18
18
#include " dynamixel_hardware_interface/dynamixel/dynamixel_info.hpp"
19
19
#include < string>
@@ -56,7 +56,6 @@ void DynamixelInfo::ReadDxlModelFile(uint8_t id, uint16_t model_num)
56
56
{
57
57
std::string path = dxl_model_file_dir + " /" ;
58
58
59
- // find model file path
60
59
auto it = dxl_model_list_.find (model_num);
61
60
if (it != dxl_model_list_.end ()) {
62
61
path += it->second ;
@@ -65,22 +64,17 @@ void DynamixelInfo::ReadDxlModelFile(uint8_t id, uint16_t model_num)
65
64
return ;
66
65
}
67
66
68
- // fprintf(stderr, "[DBG] find model file\n");
69
-
70
- // file open
71
67
std::ifstream open_file (path);
72
68
if (open_file.is_open () != 1 ) {
73
69
fprintf (stderr, " [ERROR] CANNOT FIND DXL [%s] MODEL FILE.\n " , path.c_str ());
74
70
exit (-1 );
75
71
}
76
- // fprintf(stderr, "[DBG] find model file open\n");
77
72
78
73
DxlInfo temp_dxl_info;
79
74
std::string line;
80
75
81
76
temp_dxl_info.model_num = model_num;
82
77
83
- // read type info
84
78
while (!open_file.eof () ) {
85
79
getline (open_file, line);
86
80
if (strcmp (line.c_str (), " [control table]" ) == 0 ) {
@@ -104,9 +98,7 @@ void DynamixelInfo::ReadDxlModelFile(uint8_t id, uint16_t model_num)
104
98
temp_dxl_info.torque_constant = static_cast <double >(stod (strs.at (1 )));
105
99
}
106
100
}
107
- // fprintf(stderr, "[DBG] read type info\n");
108
101
109
- // read control table item
110
102
getline (open_file, line);
111
103
while (!open_file.eof () ) {
112
104
getline (open_file, line);
@@ -117,17 +109,12 @@ void DynamixelInfo::ReadDxlModelFile(uint8_t id, uint16_t model_num)
117
109
std::vector<std::string> strs;
118
110
boost::split (strs, line, boost::is_any_of (" \t " ));
119
111
120
- // fprintf(stderr, "[DBG] address %s.\n", strs.at(0).c_str());
121
- // fprintf(stderr, "[DBG] size %s.\n", strs.at(1).c_str());
122
- // fprintf(stderr, "[DBG] name %s.\n", strs.at(2).c_str());
123
-
124
112
ControlItem temp;
125
113
temp.address = static_cast <uint16_t >(stoi (strs.at (0 )));
126
114
temp.size = static_cast <uint8_t >(stoi (strs.at (1 )));
127
115
temp.item_name = strs.at (2 );
128
116
temp_dxl_info.item .push_back (temp);
129
117
}
130
- // fprintf(stderr, "[DBG] read control item\n");
131
118
132
119
dxl_info_[id] = temp_dxl_info;
133
120
open_file.close ();
@@ -206,6 +193,4 @@ double DynamixelInfo::ConvertValueToRadian(uint8_t id, int32_t value)
206
193
return 0.0 ;
207
194
}
208
195
}
209
-
210
-
211
196
} // namespace dynamixel_hardware_interface
0 commit comments