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

implemented perform_command_mode_switch override in Ros2ControlSystem #846

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

Conversation

ralphieraccoon
Copy link
Contributor

@ralphieraccoon ralphieraccoon commented Sep 2, 2023

Description
Reusing the solution from here for Gazebo to allow for multiple command interfaces. Implements the perform_command_mode_switch method override to set joint control methods when controllers are activated/deactivated. Can't work out how to detect if a command interface is claimed inside Ros2ControlSystem::init() so you either have to run switch_controllers once to call the function or start with a position controller.

Related Issues
This pull request references the discussion #845 I started earlier.

Affected Packages

  • webots_ros2_control

Tasks

  • Work out how to detect if a command interface is claimed inside Ros2ControlSystem::init() so it's all set up properly at the beginning without having to run switch_controller.

Additional context
Credit to @ksotebeer for the original PR for gazebo_ros2_control.

@ralphieraccoon ralphieraccoon added enhancement New feature or request help wanted Extra attention is needed labels Sep 3, 2023
@ralphieraccoon ralphieraccoon self-assigned this Sep 3, 2023
@ralphieraccoon
Copy link
Contributor Author

ralphieraccoon commented Oct 4, 2023

I'm not sure if discovering which command interfaces are claimed inside Ros2ControlSystem::init() is possible since it doesn't provide access to the ResourceManager which has this function. To make it work might require changes to the ros2_control base class. I can take this PR out of draft as is and the problem could be solved at a later date, what would be best?

@ralphieraccoon ralphieraccoon marked this pull request as ready for review October 5, 2023 14:37
@omichel
Copy link
Member

omichel commented Oct 6, 2023

I would prefer that you test and eventually solve the problem in this PR, rather than committing something which is unfinished or buggy.

@ralphieraccoon
Copy link
Contributor Author

ralphieraccoon commented Oct 6, 2023

I would prefer that you test and eventually solve the problem in this PR, rather than committing something which is unfinished or buggy.

That's fair, though at the moment I'm not sure the issue is fixable without alterations to ros2_control. The PR doesn't break existing functionality, if a single command interface is used it works the same as before, and the issue can be worked around by calling switch_controllers. If anyone has any suggestions on how to solve the issue, it would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

Successfully merging this pull request may close these issues.

2 participants