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.

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

christophfroehlich and others added 3 commits May 27, 2024 22:00
Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
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 maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron. labels Jun 5, 2024
Co-authored-by:  Quique Llorente <ellorent@redhat.com>
@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 <sai.kishor@pal-robotics.com>

* Use a lowercase theta for heading

Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>

* 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 <ellorent@redhat.com>

---------

Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
Co-authored-by: Quique Llorente <ellorent@redhat.com>
(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 <sai.kishor@pal-robotics.com>

* Use a lowercase theta for heading

Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>

* 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 <ellorent@redhat.com>

---------

Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
Co-authored-by: Quique Llorente <ellorent@redhat.com>
(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 <sai.kishor@pal-robotics.com>

* Use a lowercase theta for heading

Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>

* 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 <ellorent@redhat.com>

---------

Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
Co-authored-by: Quique Llorente <ellorent@redhat.com>
(cherry picked from commit b245155)

Co-authored-by: Christoph Fröhlich <christophfroehlich@users.noreply.github.com>
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 <sai.kishor@pal-robotics.com>

* Use a lowercase theta for heading

Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>

* 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 <ellorent@redhat.com>

---------

Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
Co-authored-by: Quique Llorente <ellorent@redhat.com>
(cherry picked from commit b245155)

Co-authored-by: Christoph Fröhlich <christophfroehlich@users.noreply.github.com>
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 maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants