Skip to content
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

Fix steering controllers library code documentation and naming #1149

Merged
merged 14 commits into from
Jun 5, 2024

Conversation

christophfroehlich
Copy link
Contributor

@christophfroehlich christophfroehlich commented May 24, 2024

A follow-up to #1118, using consistent nomenclature introduced in #954

My commits do not change any logic or behavior, just make the code more readable.

@christophfroehlich christophfroehlich force-pushed the fix/steering_controllers_library-docs branch from 4b06b5f to 77212df Compare May 27, 2024 19:18
@christophfroehlich christophfroehlich marked this pull request as ready for review May 27, 2024 19:18
Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

Few minor comments

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for addressing the comments!

@christophfroehlich
Copy link
Contributor Author

@MCFurry @Timple As you have recently contributed to the steering controllers library: maybe you could have a look if you agree with these changes here?

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

I've left comments regarding the new commits

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

LGTM

const double steer_position = state_interfaces_[STATE_STEER_AXIS].get_value();
if (
!std::isnan(rear_right_wheel_value) && !std::isnan(rear_left_wheel_value) &&
!std::isnan(steer_position))
std::isfinite(traction_right_wheel_value) && std::isfinite(traction_left_wheel_value) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

What does traction mean in this context?

We have front and rear wheel actuated tricycles.

Copy link
Contributor Author

@christophfroehlich christophfroehlich May 30, 2024

Choose a reason for hiding this comment

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

steering_controller lib does implement tricycles with traction on the other axle as the steering wheel (different than the earlier tricycle_controller, assuming steering+traction no the same wheel), but with front or rear steering (subsequently, rear or front traction)

Here, the old variable name was rear_right/left_wheel_value independent of the params_.front_steering value. See the state_interface_configuration() method, where depending on the params_.front_steering the front or rear wheel names are exported as state interfaces, which is read here as state_interfaces_[STATE_TRACTION_RIGHT_WHEEL].get_value(). I just renamed the variable to be valid for both configurations.

Or have I misunderstood something?

Copy link
Contributor

Choose a reason for hiding this comment

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

steering_controller lib does implement tricycles with traction on the other axle as the steering wheel (different than the earlier tricycle_controller, assuming steering+traction on the same wheel)

Ah, this might be part of the confusion. But it only supports a subset of tricycles then. In that case this variable is in line with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

exactly. I have plans to include the "old" tricycle controller into the steering lib, but step by step

Copy link
Contributor

@qinqon qinqon left a comment

Choose a reason for hiding this comment

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

nit

@christophfroehlich christophfroehlich added backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS2 humble. backport-iron labels Jun 5, 2024
Co-authored-by:  Quique Llorente <[email protected]>
@christophfroehlich christophfroehlich merged commit b245155 into master Jun 5, 2024
5 of 18 checks passed
@christophfroehlich christophfroehlich deleted the fix/steering_controllers_library-docs branch June 5, 2024 19:50
mergify bot pushed a commit that referenced this pull request Jun 5, 2024
* Update documentation and consolidate variable names

* Simplify private methods and further update docs

* Rename methods

* Rename method and variables

* Rename convert method

* Rename variables and improve doc

* Rename local variables

* Use std::isfinite instead of !isnan

Co-authored-by: Sai Kishor Kothakota <[email protected]>

* Use a lowercase theta for heading

Co-authored-by: Sai Kishor Kothakota <[email protected]>

* Make some temporary variables const

* Let update_from_position call update_from_velocity

* Explicitly set variables with 0 in constructor

* Fix docstring

* Apply consistent variable naming

Co-authored-by:  Quique Llorente <[email protected]>

---------

Co-authored-by: Sai Kishor Kothakota <[email protected]>
Co-authored-by: Quique Llorente <[email protected]>
(cherry picked from commit b245155)
mergify bot pushed a commit that referenced this pull request Jun 5, 2024
* Update documentation and consolidate variable names

* Simplify private methods and further update docs

* Rename methods

* Rename method and variables

* Rename convert method

* Rename variables and improve doc

* Rename local variables

* Use std::isfinite instead of !isnan

Co-authored-by: Sai Kishor Kothakota <[email protected]>

* Use a lowercase theta for heading

Co-authored-by: Sai Kishor Kothakota <[email protected]>

* Make some temporary variables const

* Let update_from_position call update_from_velocity

* Explicitly set variables with 0 in constructor

* Fix docstring

* Apply consistent variable naming

Co-authored-by:  Quique Llorente <[email protected]>

---------

Co-authored-by: Sai Kishor Kothakota <[email protected]>
Co-authored-by: Quique Llorente <[email protected]>
(cherry picked from commit b245155)
christophfroehlich added a commit that referenced this pull request Jun 5, 2024
#1164)

* Update documentation and consolidate variable names

* Simplify private methods and further update docs

* Rename methods

* Rename method and variables

* Rename convert method

* Rename variables and improve doc

* Rename local variables

* Use std::isfinite instead of !isnan

Co-authored-by: Sai Kishor Kothakota <[email protected]>

* Use a lowercase theta for heading

Co-authored-by: Sai Kishor Kothakota <[email protected]>

* Make some temporary variables const

* Let update_from_position call update_from_velocity

* Explicitly set variables with 0 in constructor

* Fix docstring

* Apply consistent variable naming

Co-authored-by:  Quique Llorente <[email protected]>

---------

Co-authored-by: Sai Kishor Kothakota <[email protected]>
Co-authored-by: Quique Llorente <[email protected]>
(cherry picked from commit b245155)

Co-authored-by: Christoph Fröhlich <[email protected]>
christophfroehlich added a commit that referenced this pull request Jun 5, 2024
#1165)

* Update documentation and consolidate variable names

* Simplify private methods and further update docs

* Rename methods

* Rename method and variables

* Rename convert method

* Rename variables and improve doc

* Rename local variables

* Use std::isfinite instead of !isnan

Co-authored-by: Sai Kishor Kothakota <[email protected]>

* Use a lowercase theta for heading

Co-authored-by: Sai Kishor Kothakota <[email protected]>

* Make some temporary variables const

* Let update_from_position call update_from_velocity

* Explicitly set variables with 0 in constructor

* Fix docstring

* Apply consistent variable naming

Co-authored-by:  Quique Llorente <[email protected]>

---------

Co-authored-by: Sai Kishor Kothakota <[email protected]>
Co-authored-by: Quique Llorente <[email protected]>
(cherry picked from commit b245155)

Co-authored-by: Christoph Fröhlich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS2 humble.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants