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

Created new hardware interface for switching between controller modes #128

Closed
wants to merge 3 commits into from

Conversation

davetcoleman
Copy link
Member

This implements the "custom interface" described on this wiki page and addresses this issue #99

@davetcoleman
Copy link
Member Author

@adolfo-rt could you review this?

@adolfo-rt
Copy link
Member

I have seen this PR, but I can't really give an opinion yet, since I don't fully understand how the interface should be used (by controllers and the robot hardware abstraction) to change control modes at runtime (see comments on related ros_controllers PR).

So far I have the impression that static modes are well supported, but I'd like to know if the dynamic case should/will be supported, and how. I think this is a very good and attractive new feature, so we should take care that the most common usecases are well supported.

@davetcoleman
Copy link
Member Author

The dynamic case is now supported. With my robot I can switch with these two calls:

switch to position mode

rosservice call /robot/controller_manager/switch_controller "{start_controllers: ['position_joint_mode_controller','left_position_trajectory_controller','right_position_trajectory_controller'], stop_controllers: ['velocity_joint_mode_controller','left_velocity_trajectory_controller','right_velocity_trajectory_controller'], strictness: 2}"

switch to velocity mode

rosservice call /robot/controller_manager/switch_controller "{start_controllers: ['velocity_joint_mode_controller','left_velocity_trajectory_controller','right_velocity_trajectory_controller'], stop_controllers: ['position_joint_mode_controller','left_position_trajectory_controller','right_position_trajectory_controller'], strictness: 2}"

@kphawkins
Copy link
Contributor

So I'm not sure if I saw this when I wrote it, but I have an implementation which is very similar to this. I have a set of files strewn out over my gt-ros-pkg/universal_robot repository (hydro-devel-c-api branch) which perform a very similar function. They work natively with ros-control and do not require any direct modification, though more seamless integration would definitely help.

JointModeHandle
SwitchModeController
Implementations of SwitchModeController

In addition, I have a Python helper class which allows one to easily switch joint controllers without having to always keep up with current/new joint modes. This still needs work, but it is nice to only need to make a single call to the controller wanted running. I see no reason why ros-control can't automatically determine controller/joint mode conflicts and stop them properly.

URControllerManager
It requires that each controller be assigned a mode parameter, seen here.

I'm just leaving this here to help inform future discussion of a more official integration.

@kphawkins kphawkins mentioned this pull request Jul 12, 2014
@adolfo-rt
Copy link
Member

On these links:

JointModeHandle
SwitchModeController
Implementations of SwitchModeController

I like the fact that the handle type does not impose the available control modes, but is a general identifier (in your case an int). What is missing is a mapping between the identifiers and the actual hardware interfaces used by the controllers, which you are currently resolving with an additional mode setting in the controller configuration.

ros-controls/ros_controllers#62 has comments that are relevant to this discussion.

@fmessmer
Copy link

#180 is the rebased version for indigo-devel

@davetcoleman
Copy link
Member Author

pal-robotics has been putting a lot of work into improving this original PR - I believe this PR has been superseded by the hydro-devel branch of https://github.com/pal-robotics/ros_control

@bmagyar can you confirm?

@ipa-fxm I think your rebased version should be closed in favor of pal-robotics work. @adolfo-rt can you confirm this?

@bmagyar
Copy link
Member

bmagyar commented Sep 5, 2014

I do confirm.

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.

None yet

5 participants