@@ -35,211 +35,5 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP
35
35
36
36
namespace tesseract_planning
37
37
{
38
- // CollisionCostConfig::CollisionCostConfig(const tinyxml2::XMLElement& xml_element)
39
- // {
40
- // const tinyxml2::XMLElement* enabled_element = xml_element.FirstChildElement("Enabled");
41
- // const tinyxml2::XMLElement* use_weighted_sum_element = xml_element.FirstChildElement("UseWeightedSum");
42
- // const tinyxml2::XMLElement* type_element = xml_element.FirstChildElement("CollisionEvaluator");
43
- // const tinyxml2::XMLElement* buffer_margin_element = xml_element.FirstChildElement("BufferMargin");
44
- // const tinyxml2::XMLElement* safety_margin_buffer_element = xml_element.FirstChildElement("SafetyMarginBuffer");
45
- // const tinyxml2::XMLElement* coeff_element = xml_element.FirstChildElement("Coefficient");
46
38
47
- // if (!enabled_element)
48
- // throw std::runtime_error("CollisionCostConfig: Must have Enabled element.");
49
-
50
- // tinyxml2::XMLError status = enabled_element->QueryBoolText(&enabled);
51
- // if (status != tinyxml2::XML_NO_ATTRIBUTE && status != tinyxml2::XML_SUCCESS)
52
- // throw std::runtime_error("CollisionCostConfig: Error parsing Enabled string");
53
-
54
- // if (use_weighted_sum_element)
55
- // {
56
- // status = use_weighted_sum_element->QueryBoolText(&use_weighted_sum);
57
- // if (status != tinyxml2::XML_NO_ATTRIBUTE && status != tinyxml2::XML_SUCCESS)
58
- // throw std::runtime_error("CollisionCostConfig: Error parsing UseWeightedSum string");
59
- // }
60
-
61
- // if (type_element)
62
- // {
63
- // int coll_type = static_cast<int>(trajopt::CollisionEvaluatorType::CAST_CONTINUOUS);
64
- // status = type_element->QueryIntAttribute("type", &coll_type);
65
- // if (status != tinyxml2::XML_SUCCESS)
66
- // throw std::runtime_error("CollisionCostConfig: Error parsing CollisionEvaluator type attribute.");
67
-
68
- // type = static_cast<trajopt::CollisionEvaluatorType>(coll_type);
69
- // }
70
-
71
- // if (buffer_margin_element)
72
- // {
73
- // std::string buffer_margin_string;
74
- // status = tesseract_common::QueryStringText(buffer_margin_element, buffer_margin_string);
75
- // if (status != tinyxml2::XML_NO_ATTRIBUTE && status != tinyxml2::XML_SUCCESS)
76
- // throw std::runtime_error("CollisionCostConfig: Error parsing BufferMargin string");
77
-
78
- // if (!tesseract_common::isNumeric(buffer_margin_string))
79
- // throw std::runtime_error("CollisionCostConfig: BufferMargin is not a numeric values.");
80
-
81
- // tesseract_common::toNumeric<double>(buffer_margin_string, buffer_margin);
82
- // }
83
-
84
- // if (safety_margin_buffer_element)
85
- // {
86
- // std::string safety_margin_buffer_string;
87
- // status = tesseract_common::QueryStringText(safety_margin_buffer_element, safety_margin_buffer_string);
88
- // if (status != tinyxml2::XML_NO_ATTRIBUTE && status != tinyxml2::XML_SUCCESS)
89
- // throw std::runtime_error("CollisionCostConfig: Error parsing SafetyMarginBuffer string");
90
-
91
- // if (!tesseract_common::isNumeric(safety_margin_buffer_string))
92
- // throw std::runtime_error("CollisionCostConfig: SafetyMarginBuffer is not a numeric values.");
93
-
94
- // tesseract_common::toNumeric<double>(safety_margin_buffer_string, safety_margin_buffer);
95
- // }
96
-
97
- // if (coeff_element)
98
- // {
99
- // std::string coeff_string;
100
- // status = tesseract_common::QueryStringText(coeff_element, coeff_string);
101
- // if (status != tinyxml2::XML_NO_ATTRIBUTE && status != tinyxml2::XML_SUCCESS)
102
- // throw std::runtime_error("CollisionCostConfig: Error parsing Coefficient string");
103
-
104
- // if (!tesseract_common::isNumeric(coeff_string))
105
- // throw std::runtime_error("CollisionCostConfig: Coefficient is not a numeric values.");
106
-
107
- // tesseract_common::toNumeric<double>(coeff_string, coeff);
108
- // }
109
- // }
110
-
111
- // tinyxml2::XMLElement* CollisionCostConfig::toXML(tinyxml2::XMLDocument& doc) const
112
- // {
113
- // tinyxml2::XMLElement* xml_coll_cost_config = doc.NewElement("CollisionCostConfig");
114
-
115
- // tinyxml2::XMLElement* xml_enabled = doc.NewElement("Enabled");
116
- // xml_enabled->SetText(enabled);
117
- // xml_coll_cost_config->InsertEndChild(xml_enabled);
118
-
119
- // tinyxml2::XMLElement* xml_use_weighted_sum = doc.NewElement("UseWeightedSum");
120
- // xml_use_weighted_sum->SetText(use_weighted_sum);
121
- // xml_coll_cost_config->InsertEndChild(xml_use_weighted_sum);
122
-
123
- // tinyxml2::XMLElement* xml_type = doc.NewElement("CollisionEvaluator");
124
- // xml_type->SetAttribute("type", std::to_string(static_cast<int>(type)).c_str());
125
- // xml_coll_cost_config->InsertEndChild(xml_type);
126
-
127
- // tinyxml2::XMLElement* xml_buffer_margin = doc.NewElement("BufferMargin");
128
- // xml_buffer_margin->SetText(buffer_margin);
129
- // xml_coll_cost_config->InsertEndChild(xml_buffer_margin);
130
-
131
- // tinyxml2::XMLElement* xml_safety_margin_buffer = doc.NewElement("SafetyMarginBuffer");
132
- // xml_safety_margin_buffer->SetText(safety_margin_buffer);
133
- // xml_coll_cost_config->InsertEndChild(xml_safety_margin_buffer);
134
-
135
- // tinyxml2::XMLElement* xml_coeff = doc.NewElement("Coefficient");
136
- // xml_coeff->SetText(coeff);
137
- // xml_coll_cost_config->InsertEndChild(xml_coeff);
138
-
139
- // return xml_coll_cost_config;
140
- // }
141
-
142
- // CollisionConstraintConfig::CollisionConstraintConfig(const tinyxml2::XMLElement& xml_element)
143
- // {
144
- // const tinyxml2::XMLElement* enabled_element = xml_element.FirstChildElement("Enabled");
145
- // const tinyxml2::XMLElement* use_weighted_sum_element = xml_element.FirstChildElement("UseWeightedSum");
146
- // const tinyxml2::XMLElement* type_element = xml_element.FirstChildElement("CollisionEvaluator");
147
- // const tinyxml2::XMLElement* safety_margin_element = xml_element.FirstChildElement("SafetyMargin");
148
- // const tinyxml2::XMLElement* safety_margin_buffer_element = xml_element.FirstChildElement("SafetyMarginBuffer");
149
- // const tinyxml2::XMLElement* coeff_element = xml_element.FirstChildElement("Coefficient");
150
-
151
- // if (!enabled_element)
152
- // throw std::runtime_error("CollisionConstraintConfig: Must have Enabled element.");
153
-
154
- // tinyxml2::XMLError status = enabled_element->QueryBoolText(&enabled);
155
- // if (status != tinyxml2::XML_NO_ATTRIBUTE && status != tinyxml2::XML_SUCCESS)
156
- // throw std::runtime_error("CollisionConstraintConfig: Error parsing Enabled string");
157
-
158
- // if (use_weighted_sum_element)
159
- // {
160
- // status = use_weighted_sum_element->QueryBoolText(&use_weighted_sum);
161
- // if (status != tinyxml2::XML_NO_ATTRIBUTE && status != tinyxml2::XML_SUCCESS)
162
- // throw std::runtime_error("CollisionConstraintConfig: Error parsing UseWeightedSum string");
163
- // }
164
-
165
- // if (type_element)
166
- // {
167
- // int coll_type = static_cast<int>(trajopt::CollisionEvaluatorType::CAST_CONTINUOUS);
168
- // status = type_element->QueryIntAttribute("type", &coll_type);
169
- // if (status != tinyxml2::XML_SUCCESS)
170
- // throw std::runtime_error("CollisionConstraintConfig: Error parsing CollisionEvaluator type attribute.");
171
-
172
- // type = static_cast<trajopt::CollisionEvaluatorType>(coll_type);
173
- // }
174
-
175
- // if (safety_margin_element)
176
- // {
177
- // std::string safety_margin_string;
178
- // status = tesseract_common::QueryStringText(safety_margin_element, safety_margin_string);
179
- // if (status != tinyxml2::XML_NO_ATTRIBUTE && status != tinyxml2::XML_SUCCESS)
180
- // throw std::runtime_error("CollisionConstraintConfig: Error parsing SafetyMargin string");
181
-
182
- // if (!tesseract_common::isNumeric(safety_margin_string))
183
- // throw std::runtime_error("CollisionConstraintConfig: SafetyMargin is not a numeric values.");
184
-
185
- // tesseract_common::toNumeric<double>(safety_margin_string, safety_margin);
186
- // }
187
-
188
- // if (safety_margin_buffer_element)
189
- // {
190
- // std::string safety_margin_buffer_string;
191
- // status = tesseract_common::QueryStringText(safety_margin_buffer_element, safety_margin_buffer_string);
192
- // if (status != tinyxml2::XML_NO_ATTRIBUTE && status != tinyxml2::XML_SUCCESS)
193
- // throw std::runtime_error("CollisionConstraintConfig: Error parsing SafetyMarginBuffer string");
194
-
195
- // if (!tesseract_common::isNumeric(safety_margin_buffer_string))
196
- // throw std::runtime_error("CollisionConstraintConfig: SafetyMarginBuffer is not a numeric values.");
197
-
198
- // tesseract_common::toNumeric<double>(safety_margin_buffer_string, safety_margin_buffer);
199
- // }
200
-
201
- // if (coeff_element)
202
- // {
203
- // std::string coeff_string;
204
- // status = tesseract_common::QueryStringText(coeff_element, coeff_string);
205
- // if (status != tinyxml2::XML_NO_ATTRIBUTE && status != tinyxml2::XML_SUCCESS)
206
- // throw std::runtime_error("CollisionConstraintConfig: Error parsing Coefficient string");
207
-
208
- // if (!tesseract_common::isNumeric(coeff_string))
209
- // throw std::runtime_error("CollisionConstraintConfig: Coefficient is not a numeric values.");
210
-
211
- // tesseract_common::toNumeric<double>(coeff_string, coeff);
212
- // }
213
- // }
214
-
215
- // tinyxml2::XMLElement* CollisionConstraintConfig::toXML(tinyxml2::XMLDocument& doc) const
216
- // {
217
- // tinyxml2::XMLElement* xml_coll_cnt_config = doc.NewElement("CollisionConstraintConfig");
218
-
219
- // tinyxml2::XMLElement* xml_enabled = doc.NewElement("Enabled");
220
- // xml_enabled->SetText(enabled);
221
- // xml_coll_cnt_config->InsertEndChild(xml_enabled);
222
-
223
- // tinyxml2::XMLElement* xml_use_weighted_sum = doc.NewElement("UseWeightedSum");
224
- // xml_use_weighted_sum->SetText(use_weighted_sum);
225
- // xml_coll_cnt_config->InsertEndChild(xml_use_weighted_sum);
226
-
227
- // tinyxml2::XMLElement* xml_type = doc.NewElement("CollisionEvaluator");
228
- // xml_type->SetAttribute("type", std::to_string(static_cast<int>(type)).c_str());
229
- // xml_coll_cnt_config->InsertEndChild(xml_type);
230
-
231
- // tinyxml2::XMLElement* xml_safety_margin = doc.NewElement("SafetyMargin");
232
- // xml_safety_margin->SetText(safety_margin);
233
- // xml_coll_cnt_config->InsertEndChild(xml_safety_margin);
234
-
235
- // tinyxml2::XMLElement* xml_safety_margin_buffer = doc.NewElement("SafetyMarginBuffer");
236
- // xml_safety_margin_buffer->SetText(safety_margin_buffer);
237
- // xml_coll_cnt_config->InsertEndChild(xml_safety_margin_buffer);
238
-
239
- // tinyxml2::XMLElement* xml_coeff = doc.NewElement("Coefficient");
240
- // xml_coeff->SetText(coeff);
241
- // xml_coll_cnt_config->InsertEndChild(xml_coeff);
242
-
243
- // return xml_coll_cnt_config;
244
- // }
245
39
} // namespace tesseract_planning
0 commit comments