Skip to content

Suggested changes to #729#748

Merged
aaronchongth merged 1 commit intoaaron/pose-quat-empty-valuefrom
azeey/suggestion_729
Nov 12, 2021
Merged

Suggested changes to #729#748
aaronchongth merged 1 commit intoaaron/pose-quat-empty-valuefrom
azeey/suggestion_729

Conversation

@azeey
Copy link
Copy Markdown
Collaborator

@azeey azeey commented Nov 11, 2021

These changes make it so that the default string used in the sdf description is used as-is if an element is added by default or it's value is empty. This avoids introducing changes in the output of ToString (eg. <magnetic_field>5.5645e-6 22.8758e-6 -42.3884e-6</magnetic_field> as opposed to <magnetic_field>6e-06 2.3e-05 -4.2e-05</magnetic_field> in #729)

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #748 (3f60481) into aaron/pose-quat-empty-value (4eaf06b) will decrease coverage by 0.00%.
The diff coverage is 88.88%.

Impacted file tree graph

@@                       Coverage Diff                       @@
##           aaron/pose-quat-empty-value     #748      +/-   ##
===============================================================
- Coverage                        88.35%   88.35%   -0.01%     
===============================================================
  Files                               76       76              
  Lines                            11538    11546       +8     
===============================================================
+ Hits                             10194    10201       +7     
- Misses                            1344     1345       +1     
Impacted Files Coverage Δ
src/parser.cc 86.14% <50.00%> (-0.07%) ⬇️
src/Param.cc 88.99% <100.00%> (+0.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4eaf06b...3f60481. Read the comment docs.

Copy link
Copy Markdown
Collaborator

@aaronchongth aaronchongth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this makes a lot of sense. Thanks for finding a solution to this dilemma 🙇 I'll go ahead and merge it in

@aaronchongth aaronchongth merged commit 7df7a9f into aaron/pose-quat-empty-value Nov 12, 2021
@aaronchongth aaronchongth deleted the azeey/suggestion_729 branch November 12, 2021 02:17
aaronchongth added a commit that referenced this pull request Dec 21, 2021
…used angles (#689)

* Ruby option to print in_degrees or snap_to_degrees

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Basic PrintConfig added

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* PrintConfig gets passed into printing implementations of Element and Param

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Adding basic test for print options

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Reverting to PrintConfig with basic API

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Moved creation of PrintConfig into ign functions

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Param value GetPoseAsString and tests

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Moved attribute painting to its own function, fixed test strings

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Added basic tests for pose rotation input as quaternions

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Using different flags for ign sdf -p, allow snapping to different values

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Disabling test on windows, fixing comment

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Remove stale function, fixed linting

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Adding tolerance as a argument, added tests

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Use 3 spaces when changing rotation formats or snapping to degrees

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Added check for tolerance larger than snapping interval

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Moving PrintAttributes to ElementPrivate to remain ABI stability

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Using true/false instead of 1/0

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Remove use of SDF_ASSERT in GetAsString

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Added tests for //include/pose

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Adding parsing passing test for empty quat_xyzw pose

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Added check for default string values to be modified when rotation_format is defined

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Added tests

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Reparsing translates default value into string to be used if values have not been assigned to param

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Using StringFromValueImpl for getting strings from all ParamVariants

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Refactor pose string from value into its own function

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Fixing casting erroerror, added documentation and tests for tolerance < interval

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Correcting stale comments

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Fixing snapToInterval math, added more tests

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Removed unneeded visibility macro

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Adding return documentation and using const reference to variant instead of pointer

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Returning string directly, removing stale _config, reverting strValue to nullopt

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Remove use of assertions

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Suggested changes to #729 (#748)

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>

* Using three space delimiter between position and rotation if attributes are set

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Added comment regarding use of default PrintConfig in Reparse

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Adding equality comparison for PrintConfig

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Removed stale include

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Uniied string and value parsing behavior, and modified necessary tests

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Overloaded function to maintain ABI stability

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Fixing missing space in test for exec command

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Adding comment regarding attributeExceptions

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Indenting help message, adding test for shuffling command flags

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Modifying cmd flag shuffling test to handling flags with arguments too

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Removed Get from PrintConfig getter functions

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Using std optional's converting constructor

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Modified snapToInterval implementation, added test

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Added bool type specific value parser, values are parsed using ParamStreamer by default

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Reverting all unnecessary changes made in sdf12 to old tests

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Added comparison for PreserveIncludes

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Check for 'type' attribute in unknown elements as well, in order to parse booleans into true/false, instead of 1/0

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Only checking for pose related PrintConfig options for returning string instead of default PrintConfig

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Added comment regarding sanitizing -0 in test outputs

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

Co-authored-by: Addisu Z. Taddese <addisu@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants