-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parameter for adjust current sign in battery plugin #2696
base: gz-sim9
Are you sure you want to change the base?
Conversation
Signed-off-by: Tatsuro Sakaguchi <[email protected]>
Signed-off-by: Tatsuro Sakaguchi <[email protected]>
92c8eac
to
fc1a2d5
Compare
@@ -178,6 +178,9 @@ class gz::sim::systems::LinearBatteryPluginPrivate | |||
|
|||
/// \brief Initial power load set trough config | |||
public: double initialPowerLoad = 0.0; | |||
|
|||
/// \brief Adjusts the sign of the current to align with ROS conventions. | |||
public: bool adjustCurrentSignForROS{false}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind to use a different value for the parameter ? We try not to include any ROS related stuff here.
Maybe something like invertSignValues
? But I open to suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also considering using a variable like that, so I agree with the idea.
However, it's not clear what the sign is being inverted for, so how about naming it invertCurrentSign
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go ahead with invertCurrentSign
👌
Signed-off-by: Tatsuro Sakaguchi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this be easier to flip the sign only when the data is being published (PostUpdate) instead of adding extra logic at various places?
🦟 Bug fix
Fixes #2685
Summary
A parameter has been added to adjust the sign of the battery current value to comply with ROS conventions.
By default, it is set to
false
, so the existing behavior remains unchanged.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.