Skip to content

Refactor to distinguish between wheel and steering joints (steering controller) #692

Open
@roncapat

Description

@roncapat

Pre-requirement of #648

If you have a look for example at:
https://github.com/ros-controls/ros2_controllers/blob/master/ackermann_steering_controller/test/ackermann_steering_controller_params.yaml
you can see that front_wheels_names and rear_wheels_names in fact might refer (depending on situation) to either a traction actuator or a steering actuator.

Here:

controller_interface::InterfaceConfiguration
SteeringControllersLibrary::command_interface_configuration() const
{
controller_interface::InterfaceConfiguration command_interfaces_config;
command_interfaces_config.type = controller_interface::interface_configuration_type::INDIVIDUAL;
command_interfaces_config.names.reserve(nr_cmd_itfs_);
if (params_.front_steering)
{
for (size_t i = 0; i < params_.rear_wheels_names.size(); i++)
{
command_interfaces_config.names.push_back(
params_.rear_wheels_names[i] + "/" + hardware_interface::HW_IF_VELOCITY);
}
for (size_t i = 0; i < params_.front_wheels_names.size(); i++)
{
command_interfaces_config.names.push_back(
params_.front_wheels_names[i] + "/" + hardware_interface::HW_IF_POSITION);
}
}
else
{
for (size_t i = 0; i < params_.front_wheels_names.size(); i++)
{
command_interfaces_config.names.push_back(
params_.front_wheels_names[i] + "/" + hardware_interface::HW_IF_VELOCITY);
}
for (size_t i = 0; i < params_.rear_wheels_names.size(); i++)
{
command_interfaces_config.names.push_back(
params_.rear_wheels_names[i] + "/" + hardware_interface::HW_IF_POSITION);
}
}
return command_interfaces_config;
}

a distinction is then made depending on front_steering param (and linked to #648, I should introduce here somehow all_wheel_drive parameter).

It feels to me that otherwise introducing additional implicit conventions in combination of new flags / number of passed joints and their interpretation as wheels or steers will complicate even more the steering_controller package...

Semantically, we have no enforcement at configuration level of what is "wheel" and what is "steer". I propose to add front_steer_names and rear_steer_names, and refactor the code in support of both #648 and #526 (which I am also involved in).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions