Robotics StackExchange | Archived questions

how to change the controller interface during running?

Hi all,

I want to simulate the door-opening in Gazebo. Until grasping the door handle, I'm using the positioncontrollers/JointTrajectoryController of JointPositionInterface. To push the door, I need to use the effortcontrollers/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!

Asked by xibeisiber on 2020-10-30 05:11:40 UTC

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.

Asked by gvdhoorn on 2020-10-30 05:53:41 UTC

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....

Asked by xibeisiber on 2020-11-01 21:15:35 UTC

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.

Asked by gvdhoorn on 2020-11-02 03:16:08 UTC

undertand. Thanks for the clarification.

Asked by xibeisiber on 2020-11-04 01:13:44 UTC

Answers