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

Remove front_steering from steering library #1166

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

qinqon
Copy link
Contributor

@qinqon qinqon commented Jun 8, 2024

To Accommodate controllers that are not only steering at front or rear
this change remove the front_steering variable from
steering_controller_library, as a byproduct of that the notion of
front or rear wheel radius is also removed from dependant controllers
and the library has know "traction_joints_names" and
"steering_joints_names" instead of "front_wheels_names" and
"rear_wheels_names".

Depends on:

@qinqon qinqon force-pushed the remove_front_steering_param_from_steering_library branch 4 times, most recently from c83dce3 to 71800b2 Compare June 8, 2024 08:32
Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

I support the idea, thanks!

Please deprecate the old parameters and add the new ones to support both temporarily. Then we can also backport such changes.

Additionally, please add migration notes here.

@christophfroehlich
Copy link
Contributor

christophfroehlich commented Jun 8, 2024

Have you read and considered #692? Ideally, we should solve it with this PR.
I'm not sure if your proposal works for 4WD + 4x steering?

@qinqon qinqon changed the title [WIP] Remove front_steering from steering library Remove front_steering from steering library Jun 8, 2024
@qinqon
Copy link
Contributor Author

qinqon commented Jun 8, 2024

Have you read and considered #692? Ideally, we should solve it with this PR.

The idea is the same, is all about generalize the steering library a little more.

I'm not sure if your proposal works for 4WD + 4x steering?

Next PR will allow that, I am thinking about extending the current ackermann instead of new controller, if you add a pair of traction and steering joints and define the instantaneus center of robot you can have this by modifyting a little the IK and odometry. Also you can keep the current ackermann by configuring the instantaneus centor or robot at the traction joints and using the same IK and odometry.

@qinqon qinqon force-pushed the remove_front_steering_param_from_steering_library branch 12 times, most recently from 3965416 to c09d17b Compare June 12, 2024 20:58
@qinqon qinqon force-pushed the remove_front_steering_param_from_steering_library branch from c09d17b to 41b3219 Compare June 19, 2024 17:22
Copy link
Contributor

mergify bot commented Jun 19, 2024

This pull request is in conflict. Could you fix it @qinqon?

@qinqon
Copy link
Contributor Author

qinqon commented Jun 23, 2024

Tests working

$ colcon test 
Starting >>> steering_controllers_library
Finished <<< steering_controllers_library [0.44s]          
Starting >>> ackermann_steering_controller
Starting >>> bicycle_steering_controller
Starting >>> tricycle_steering_controller                                                                    
Finished <<< bicycle_steering_controller [1.50s]                                                                                                   
Finished <<< ackermann_steering_controller [1.58s]                                                            
Finished <<< tricycle_steering_controller [1.52s]

Summary: 4 packages finished [3.01s]

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

I unearthed this PR, I changed my mind and think it makes sense to merge this before a possible rewrite of the library.

Thanks @qinqon for the initial work, on top of that I did

  • add proper backwards compatibility
  • updated the docs
  • added migration and release notes
  • fixed a bug, that with Ackermann kinematics a different wheel track of the steering and traction axle was not supported (although the parameters were there from the beginning).

@christophfroehlich christophfroehlich requested review from ARK3r and removed request for VanshGehlot January 3, 2025 16:01
@Timple
Copy link
Contributor

Timple commented Jan 3, 2025

It's hard to see on mobile. But I see a separation between tracked and steered wheels.
Can steered wheels also have traction with this pr? We have a vehicle with an active driven front wheel. Would be nice to use this 👍

@christophfroehlich
Copy link
Contributor

It's hard to see on mobile. But I see a separation between tracked and steered wheels. Can steered wheels also have traction with this pr? We have a vehicle with an active driven front wheel. Would be nice to use this 👍

No, this is is not possible yet. I made a proposal once to configure this more freely, but haven't started going in that direction.

@qinqon
Copy link
Contributor Author

qinqon commented Jan 3, 2025

I unearthed this PR, I changed my mind and think it makes sense to merge this before a possible rewrite of the library.

Thanks @qinqon for the initial work, on top of that I did

  • add proper backwards compatibility

  • updated the docs

  • added migration and release notes

  • fixed a bug, that with Ackermann kinematics a different wheel track of the steering and traction axle was not supported (although the parameters were there from the beginning).

@christophfroehlich happy that the PR did help with the effort, let me know on whatever you need.

@skasperski
Copy link

Hello, I am interested in the work here and would like to see it merged. I am currently testing this branch on jazzy and face some issues, probably due to parameterization. Is there any specific order required for traction_joint_names and steering_joint_names lists? Doesn't it need to know which joints are right and which are left?

@qinqon Are you still working on the 4WD patch? I'd be also willing to contribute or help with testing.

@christophfroehlich
Copy link
Contributor

Hello, I am interested in the work here and would like to see it merged. I am currently testing this branch on jazzy and face some issues, probably due to parameterization. Is there any specific order required for traction_joint_names and steering_joint_names lists? Doesn't it need to know which joints are right and which are left?

Does your config work with the current version without this PR? After merging, we have to fix the ackermann_drive_controller of gz_ros2_control_demos, @skasperski maybe you want to work on that and create a PR there? then we can troubleshoot together if something is not working properly.

@skasperski
Copy link

Ok, I will look into this. For now the parameters are misspelled in the deprecation messages. Can I somehow add commits to this PR?

@christophfroehlich
Copy link
Contributor

Ok, I will look into this. For now the parameters are misspelled in the deprecation messages. Can I somehow add commits to this PR?

you can review in the "Files changed" tab, and I can commit the changes.

{
RCLCPP_WARN(
get_node()->get_logger(),
"DEPRECATED parameter 'front_steering', set 'traction_joint_names' or 'steering_joint_names' "

Choose a reason for hiding this comment

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

Parameter is actually called "traction_joints_names".

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed.

@@ -172,22 +170,22 @@ class SteeringControllersLibraryFixture : public ::testing::Test
command_ifs.reserve(joint_command_values_.size());

command_itfs_.emplace_back(hardware_interface::CommandInterface(
rear_wheels_names_[0], traction_interface_name_,
traction_joints_names_[0], traction_interface_name_,

Choose a reason for hiding this comment

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

Here it is always assumed that there are exactly two joints in the order [right, left]. This is as far as I can tell not documented anywhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

only for ackermann, and there is this note in the beginning of the test:

// NOTE: Testing steering_controllers_library for Ackermann vehicle configuration only

I added this information to the parameter yaml.

}
}
// END OF DEPRECATED

Choose a reason for hiding this comment

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

Here it should be tested that traction_joints_names and steering_joints_names have exactly length 2, because it will crash during update if not.

Copy link
Contributor

Choose a reason for hiding this comment

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

I added checks here.

@skasperski
Copy link

skasperski commented Feb 14, 2025

I am currently unable to compile these packages, because all tests fail to build with this error:

/ros_ws/src/ros2_controllers/ackermann_steering_controller/test/test_ackermann_steering_controller.cpp:34:26: error: ‘struct steering_controllers_library::Params’ has no member named ‘traction_joints_names’
   34 |     controller_->params_.traction_joints_names, testing::ElementsAreArray(traction_joints_names_));

I have no idea why that is, because the generated struct does have this member. Could this be some compatibility issue between jazzy and rolling?

Edit: Never mind, the binary installed version of this package had leaked into the workspace.

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

@skasperski thanks for the hints. I pushed changes, let me know what you think.

@@ -172,22 +170,22 @@ class SteeringControllersLibraryFixture : public ::testing::Test
command_ifs.reserve(joint_command_values_.size());

command_itfs_.emplace_back(hardware_interface::CommandInterface(
rear_wheels_names_[0], traction_interface_name_,
traction_joints_names_[0], traction_interface_name_,
Copy link
Contributor

Choose a reason for hiding this comment

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

only for ackermann, and there is this note in the beginning of the test:

// NOTE: Testing steering_controllers_library for Ackermann vehicle configuration only

I added this information to the parameter yaml.

{
RCLCPP_WARN(
get_node()->get_logger(),
"DEPRECATED parameter 'front_steering', set 'traction_joint_names' or 'steering_joint_names' "
Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed.

}
}
// END OF DEPRECATED

Copy link
Contributor

Choose a reason for hiding this comment

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

I added checks here.

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