how to change the controller interface during running?

asked 2020-10-30 05:11:40 -0500

xibeisiber gravatar image

Hi all,

I want to simulate the door-opening in Gazebo. Until grasping the door handle, I'm using the position_controllers/JointTrajectoryController of JointPositionInterface. To push the door, I need to use the effort_controllers/JointEffortController of JointEffortInterface to achieve the compliant control of the arm.

I tried to change the transmission in urdf and config file for node "controller_manager". It seems I can only load only one control mode for the arm. Can I load two kinds of controllers for arm and switch when needed??

Thanks very much!

edit retag flag offensive close merge delete

Comments

I don't believe this is currently supported out-of-the-box.

Or, at least not in Gazebo's implementation of the hardware_interface. Technically it should be possible to offer more than a single interface -- many drivers for real robots actually do this, and ros_control would simply manage those resources. Controllers would be able to use them.

Switching controllers at runtime is something which is certainly supported, so as long as the interfaces are there, it should work.

gvdhoorn gravatar image gvdhoorn  ( 2020-10-30 05:53:41 -0500 )edit

Thanks for your reply. so it seems in Gazebo for each joint I can only keep one kind of controller running. Maybe I could stop current controller and start a new one by running the controller_manager in C++ file. I saw the video of pr2 opening a door in Gazebo and parts of its source code, but not quite understand how it works....

xibeisiber gravatar image xibeisiber  ( 2020-11-01 20:15:35 -0500 )edit

You seem to conflate interfaces with controllers. gazebo_ros_control does not support multiple interfaces per joint afaik, but gazebo_ros_control uses the regular ControllerManager, so it does support controller switching.

gvdhoorn gravatar image gvdhoorn  ( 2020-11-02 02:16:08 -0500 )edit

undertand. Thanks for the clarification.

xibeisiber gravatar image xibeisiber  ( 2020-11-04 00:13:44 -0500 )edit