Skip to content

Commit 4c944c3

Browse files
committed
Merge branch 'master' into apriltags
2 parents d914d67 + f62b5ca commit 4c944c3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/shared/util/field.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ FieldLine::~FieldLine() {
180180

181181
FieldCircularArc* FieldCircularArc::FromVarList(VarList* list) {
182182
vector<VarType*> list_entries = list->getChildren();
183-
if (list_entries.size() != static_cast<size_t>(7)) {
184-
// The list should have exactly 7 entries.
183+
if (list_entries.size() != static_cast<size_t>(8)) {
184+
// The list should have exactly the expected number of entries.
185185
return NULL;
186186
}
187187
VarString* name = NULL;
@@ -232,7 +232,7 @@ FieldCircularArc::FieldCircularArc(
232232

233233
FieldCircularArc::FieldCircularArc(const FieldCircularArc& other) :
234234
name(new VarString("Name", other.name->getString())),
235-
type(new VarStringEnum("Type", "Undefined")),
235+
type(new VarStringEnum("Type", other.type->getString())),
236236
center_x(new VarDouble("Center.x", other.center_x->getDouble())),
237237
center_y(new VarDouble("Center.y", other.center_y->getDouble())),
238238
radius(new VarDouble("Radius", other.radius->getDouble())),
@@ -301,13 +301,15 @@ FieldCircularArc::FieldCircularArc(const string& marking_name) :
301301

302302
FieldCircularArc::~FieldCircularArc() {
303303
list->removeChild(thickness);
304+
list->removeChild(type);
304305
list->removeChild(a2);
305306
list->removeChild(a1);
306307
list->removeChild(radius);
307308
list->removeChild(center_y);
308309
list->removeChild(center_x);
309310
list->removeChild(name);
310311
delete name;
312+
delete type;
311313
delete center_x;
312314
delete center_y;
313315
delete radius;
@@ -568,7 +570,7 @@ void RoboCupField::ResizeFieldArcs() {
568570
}
569571
if (new_num_arcs > old_num_arcs) {
570572
for (size_t i = old_num_arcs; i < new_num_arcs; ++i) {
571-
const string name = StringPrintf("Line %d", static_cast<int>(i));
573+
const string name = StringPrintf("Arc %d", static_cast<int>(i));
572574
field_arcs.push_back(new FieldCircularArc(name));
573575
field_arcs_list->addChild(field_arcs[i]->list);
574576
}

0 commit comments

Comments
 (0)