@@ -55,6 +55,14 @@ namespace sdf
55
55
SDFORMAT_VISIBLE
56
56
bool init (SDFPtr _sdf, const ParserConfig &_config);
57
57
58
+ // / \brief Initialize the SDF interface from the embedded root spec file
59
+ // / \param[out] _errors Vector of errors.
60
+ // / \param[out] _sdf Pointer to an SDF object.
61
+ // / \param[in] _config Custom parser configuration
62
+ // / \return True if successful.
63
+ SDFORMAT_VISIBLE
64
+ bool init (sdf::Errors &_errors, SDFPtr _sdf, const ParserConfig &_config);
65
+
58
66
// / \brief Initialize the SDF interface using a file
59
67
// / \param[in] _filename Name of the SDF file
60
68
// / \param[out] _sdf Pointer to an SDF object.
@@ -71,9 +79,20 @@ namespace sdf
71
79
bool initFile (
72
80
const std::string &_filename, const ParserConfig &_config, SDFPtr _sdf);
73
81
82
+ // / \brief Initialize the SDF interface using a file
83
+ // / \param[in] _filename Name of the SDF file
84
+ // / \param[in] _config Custom parser configuration
85
+ // / \param[out] _sdf Pointer to an SDF object.
86
+ // / \param[out] _errors Vector of errors.
87
+ // / \return True if successful.
88
+ SDFORMAT_VISIBLE
89
+ bool initFile (
90
+ const std::string &_filename, const ParserConfig &_config, SDFPtr _sdf,
91
+ sdf::Errors &_errors);
92
+
74
93
// / \brief Initialize an SDF Element interface using a file
75
94
// / \param[in] _filename Name of the SDF file
76
- // / \param[in ] _sdf Pointer to an SDF Element object.
95
+ // / \param[out ] _sdf Pointer to an SDF Element object.
77
96
// / \return True if successful.
78
97
SDFORMAT_VISIBLE
79
98
bool initFile (const std::string &_filename, ElementPtr _sdf);
@@ -87,6 +106,16 @@ namespace sdf
87
106
bool initFile (const std::string &_filename, const ParserConfig &_config,
88
107
ElementPtr _sdf);
89
108
109
+ // / \brief Initialize an SDFElement interface using a file
110
+ // / \param[in] _filename Name of the SDF file
111
+ // / \param[in] _config Custom parser configuration
112
+ // / \param[out] _sdf Pointer to an SDF Element object.
113
+ // / \param[out] _errors Vector of errors.
114
+ // / \return True if successful.
115
+ SDFORMAT_VISIBLE
116
+ bool initFile (const std::string &_filename, const ParserConfig &_config,
117
+ ElementPtr _sdf, sdf::Errors &_errors);
118
+
90
119
// / \brief Initialize the SDF interface using a string
91
120
// / \param[in] _xmlString XML string to be parsed.
92
121
// / \param[out] _sdf Pointer to an SDF object.
@@ -103,6 +132,16 @@ namespace sdf
103
132
bool initString (
104
133
const std::string &_xmlString, const ParserConfig &_config, SDFPtr _sdf);
105
134
135
+ // / \brief Initialize the SDF interface using a string
136
+ // / \param[in] _xmlString XML string to be parsed.
137
+ // / \param[in] _config Custom parser configuration
138
+ // / \param[out] _sdf Pointer to an SDF object.
139
+ // / \param[out] _errors Vector of errors.
140
+ // / \return True if successful.
141
+ SDFORMAT_VISIBLE
142
+ bool initString (const std::string &_xmlString, const ParserConfig &_config,
143
+ SDFPtr _sdf, sdf::Errors &_errors);
144
+
106
145
// / \brief Populate the SDF values from a file
107
146
// /
108
147
// / This populates a new SDF pointer from a file. If the file is a URDF
@@ -317,6 +356,16 @@ namespace sdf
317
356
SDFORMAT_VISIBLE
318
357
std::string getModelFilePath (const std::string &_modelDirPath);
319
358
359
+ // / \brief Get the file path to the model file
360
+ // / \param[out] _errors Vector of errors.
361
+ // / \param[in] _modelDirPath directory system path of the model
362
+ // / \return string with the full filesystem path to the best version (greater
363
+ // / SDF protocol supported by this sdformat version) of the .sdf
364
+ // / model files hosted by _modelDirPath.
365
+ SDFORMAT_VISIBLE
366
+ std::string getModelFilePath (sdf::Errors &_errors,
367
+ const std::string &_modelDirPath);
368
+
320
369
// / \brief Convert an SDF file to a specific SDF version.
321
370
// / \param[in] _filename Name of the SDF file to convert.
322
371
// / \param[in] _version Version to convert _filename to.
@@ -387,6 +436,17 @@ namespace sdf
387
436
SDFORMAT_VISIBLE
388
437
bool checkCanonicalLinkNames (const sdf::Root *_root);
389
438
439
+ // / \brief Check that for each model, the canonical_link attribute value
440
+ // / matches the name of a link in the model if the attribute is set and
441
+ // / not empty.
442
+ // / This checks recursively and should check the files exhaustively
443
+ // / rather than terminating early when the first error is found.
444
+ // / \param[out] _errors Vector of errors.
445
+ // / \param[in] _root SDF Root object to check recursively.
446
+ // / \return True if all models have valid canonical_link attributes.
447
+ SDFORMAT_VISIBLE
448
+ bool checkCanonicalLinkNames (sdf::Errors &_errors, const sdf::Root *_root);
449
+
390
450
// / \brief For the world and each model, check that the attached_to graphs
391
451
// / build without errors and have no cycles.
392
452
// / Confirm that following directed edges from each vertex in the graph
@@ -398,6 +458,18 @@ namespace sdf
398
458
SDFORMAT_VISIBLE
399
459
bool checkFrameAttachedToGraph (const sdf::Root *_root);
400
460
461
+ // / \brief For the world and each model, check that the attached_to graphs
462
+ // / build without errors and have no cycles.
463
+ // / Confirm that following directed edges from each vertex in the graph
464
+ // / leads to a model, link, or world frame.
465
+ // / This checks recursively and should check the files exhaustively
466
+ // / rather than terminating early when the first error is found.
467
+ // / \param[out] _errors Vector of errors.
468
+ // / \param[in] _root SDF Root object to check recursively.
469
+ // / \return True if all attached_to graphs are valid.
470
+ SDFORMAT_VISIBLE
471
+ bool checkFrameAttachedToGraph (sdf::Errors &_errors, const sdf::Root *_root);
472
+
401
473
// / \brief Check that for each frame, the attached_to attribute value
402
474
// / does not match its own frame name but does match the name of a
403
475
// / link, joint, or other frame in the model if the attribute is set and
@@ -409,6 +481,18 @@ namespace sdf
409
481
SDFORMAT_VISIBLE
410
482
bool checkFrameAttachedToNames (const sdf::Root *_root);
411
483
484
+ // / \brief Check that for each frame, the attached_to attribute value
485
+ // / does not match its own frame name but does match the name of a
486
+ // / link, joint, or other frame in the model if the attribute is set and
487
+ // / not empty.
488
+ // / This checks recursively and should check the files exhaustively
489
+ // / rather than terminating early when the first error is found.
490
+ // / \param[out] _errors Vector of errors.
491
+ // / \param[in] _root SDF Root object to check recursively.
492
+ // / \return True if all frames have valid attached_to attributes.
493
+ SDFORMAT_VISIBLE
494
+ bool checkFrameAttachedToNames (sdf::Errors &_errors, const sdf::Root *_root);
495
+
412
496
// / \brief Check that all joints in contained models specify parent
413
497
// / and child link names that match the names of sibling links.
414
498
// / This checks recursively and should check the files exhaustively
@@ -469,6 +553,18 @@ namespace sdf
469
553
SDFORMAT_VISIBLE
470
554
bool checkPoseRelativeToGraph (const sdf::Root *_root);
471
555
556
+ // / \brief For the world and each model, check that the attached_to graphs
557
+ // / build without errors and have no cycles.
558
+ // / Confirm that following directed edges from each vertex in the graph
559
+ // / leads to a model, link, or world frame.
560
+ // / This checks recursively and should check the files exhaustively
561
+ // / rather than terminating early when the first error is found.
562
+ // / \param[out] _errors Vector of errors.
563
+ // / \param[in] _root SDF Root object to check recursively.
564
+ // / \return True if all attached_to graphs are valid.
565
+ SDFORMAT_VISIBLE
566
+ bool checkPoseRelativeToGraph (sdf::Errors &_errors, const sdf::Root *_root);
567
+
472
568
// / \brief Check that all sibling elements of the same type have unique names.
473
569
// / This checks recursively and should check the files exhaustively
474
570
// / rather than terminating early when the first duplicate name is found.
@@ -478,6 +574,17 @@ namespace sdf
478
574
SDFORMAT_VISIBLE
479
575
bool recursiveSameTypeUniqueNames (sdf::ElementPtr _elem);
480
576
577
+ // / \brief Check that all sibling elements of the same type have unique names.
578
+ // / This checks recursively and should check the files exhaustively
579
+ // / rather than terminating early when the first duplicate name is found.
580
+ // / \param[out] _errors Vector of errors.
581
+ // / \param[in] _elem SDF Element to check recursively.
582
+ // / \return True if all contained elements have do not share a name with
583
+ // / sibling elements of the same type.
584
+ SDFORMAT_VISIBLE
585
+ bool recursiveSameTypeUniqueNames (sdf::Errors &_errors,
586
+ sdf::ElementPtr _elem);
587
+
481
588
// / \brief Check that all sibling elements of the any type have unique names.
482
589
// / This checks recursively and should check the files exhaustively
483
590
// / rather than terminating early when the first duplicate name is found.
@@ -487,6 +594,16 @@ namespace sdf
487
594
SDFORMAT_VISIBLE
488
595
bool recursiveSiblingUniqueNames (sdf::ElementPtr _elem);
489
596
597
+ // / \brief Check that all sibling elements of the any type have unique names.
598
+ // / This checks recursively and should check the files exhaustively
599
+ // / rather than terminating early when the first duplicate name is found.
600
+ // / \param[out] _errors Vector of errors.
601
+ // / \param[in] _elem SDF Element to check recursively.
602
+ // / \return True if all contained elements have do not share a name with
603
+ // / sibling elements of any type.
604
+ SDFORMAT_VISIBLE
605
+ bool recursiveSiblingUniqueNames (sdf::Errors &_errors, sdf::ElementPtr _elem);
606
+
490
607
// / \brief Check that all sibling elements do not contain the delimiter
491
608
// / double colons '::' in element names, which is reserved for forming scopes
492
609
// / in SDFormat 1.8. This checks recursively and should check the files
@@ -497,6 +614,18 @@ namespace sdf
497
614
SDFORMAT_VISIBLE
498
615
bool recursiveSiblingNoDoubleColonInNames (sdf::ElementPtr _elem);
499
616
617
+ // / \brief Check that all sibling elements do not contain the delimiter
618
+ // / double colons '::' in element names, which is reserved for forming scopes
619
+ // / in SDFormat 1.8. This checks recursively and should check the files
620
+ // / exhaustively rather than terminating early when the first name
621
+ // / containing '::' is found.
622
+ // / \param[out] _errors Vector of errors.
623
+ // / \param[in] _elem SDF Element to check recursively.
624
+ // / \return True if all contained element names do not have the delimiter '::'
625
+ SDFORMAT_VISIBLE
626
+ bool recursiveSiblingNoDoubleColonInNames (sdf::Errors &_errors,
627
+ sdf::ElementPtr _elem);
628
+
500
629
// / \brief Check whether the element should be validated. If this returns
501
630
// / false, validators such as the unique name and reserve name checkers should
502
631
// / skip this element and its descendants.
0 commit comments