Repository navigation
Conversation
Signed-off-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
Signed-off-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
Signed-off-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
Signed-off-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The latest supported URDF version (
1.2) was hardcoded in more than one place: the range check inmodel.cppand its error message. Adding support for a new URDF version meant finding and updating every one of them.This PR adds the supported range once, as public
constexprconstants inurdf_parser/urdf_parser.hpp:The version check in
model.cppand its error message are now built from these constants. Supporting a new URDF version becomes a one-line change. Integrators can also query the supported range at compile time.The feature gates (
at_least(1, 1),at_least(1, 2), ...) are intentionally left as they are. They mark the version a feature was introduced in, and they must not move when the latest supported version is bumped.Changes
URDFVersion(major, minor)constructor, comparisons and getters are nowconstexpr, so the class can be used in constant expressionsURDF_MIN_SUPPORTED_VERSION/URDF_MAX_SUPPORTED_VERSIONconstantsmodel.cppversion check and error message use the constants; the message text is unchanged