UR driver twist_controller not implemented?

asked 2021-08-30 06:29:11 -0600

horvath.daniel gravatar image

updated 2021-08-30 06:29:41 -0600

Hello, guys! I've recently been working on making a teleoperation control node for an UR5e robot arm. I know that the twist_controller is the controller designated for teleoperation which is provided by the ur_robot_driver itself and I've tried switching the controllers using the "rosservice /controller_manager/switch_controller" command and it worked for the joint_group_vel_controller, but when I tried to switch to twist_controller it says:

[ERROR] [1630061194.905462256]: Could not start controller with name 'twist_controller' because no controller with this name exists

Is the twist_controller controller somehow not implemented yet, and if so, how can I install it?

edit retag flag offensive close merge delete

Comments

It's likely your ros_control configuration file does not contain any information on the twist_controller.

If that's the case, switch_controller cannot switch to it, as the controller_manager will not have loaded it.

gvdhoorn gravatar image gvdhoorn  ( 2021-08-30 08:20:46 -0600 )edit

I've added the following to the .ur5e_controllers.yaml file for my robot in the Universal_Robots_ROS_Driver/ur_robot_driver/config folder:

twist_controller:
   type:         cartesian_ros_controllers/TwistController

   # The controller uses this identifier to get the according command handle
   # from the hardware interface.
   frame_id:     "endpoint_to_control"

   joints:
   - joint1
   - joint2
   - joint3
   - joint4
   - joint5
   - joint6

This didn't really work so I tried also to load the controller using "/controller_manager/load_controller twist_controller" and I got the following error:

[ERROR] [1630403138.102246501]: Could not load controller 'twist_controller' because controller type 'cartesian_ros_controllers/TwistController' does not exist.
[ERROR] [1630403138.102345667]: Use 'rosservice call controller_manager/list_controller_types' to get the available types
horvath.daniel gravatar image horvath.daniel  ( 2021-08-31 04:52:50 -0600 )edit

Do I have to clone the following repository or is it not relevant? https://github.com/fzi-forschungszent...

horvath.daniel gravatar image horvath.daniel  ( 2021-08-31 05:00:58 -0600 )edit

You'll have to make sure to have installed the referenced controller, yes.

re: clone repository: on Noetic, you can install the controller using apt: status_page/ros_noetic_default.html?q=carte (green squares everywhere).

On Melodic you'll either have to enable the TestingRepository or build from source, as the package has been released, but Melodic has not seen any sync yet (note the blue square in the last column of the row for twist_controller).

gvdhoorn gravatar image gvdhoorn  ( 2021-08-31 05:11:15 -0600 )edit

Thanks! I've already cloned the said repository and changed the config .yaml file to:

twist_controller:
   type: cartesian_ros_controllers/TwistController

   # The controller uses this identifier to get the according command handle
   # from the hardware interface.
   frame_id: "endpoint_to_control"

   joints:
     - shoulder_pan_joint
     - shoulder_lift_joint
     - elbow_joint
     - wrist_1_joint
     - wrist_2_joint
     - wrist_3_joint

You mentioned that I can install the controller using apt, but how exactly do I do that? (I'm really new to ROS)

horvath.daniel gravatar image horvath.daniel  ( 2021-08-31 05:29:56 -0600 )edit

You don't need to do both. Either install using apt, or build it from source (where git clone is one step).

See #q252478 for a (high-level) overview of the workflow.

Just git clone-ing a repository is typically not sufficient.

gvdhoorn gravatar image gvdhoorn  ( 2021-08-31 05:36:18 -0600 )edit

Ok, did that. But I checked the controller list using "rosservice call controller_manager/list_controllers" and I don't see any twist_controller.

Moreover, when I tried loading again the twist_controller I got this new error:

[ERROR] [1630405521.163189747]: This controller requires a hardware interface of type 'cartesian_ros_control::TwistCommandInterface'. Make sure this is registered in the hardware_interface::RobotHW class.
[ERROR] [1630405521.163288661]: Initializing controller 'twist_controller' failed

Any clue what this means?

horvath.daniel gravatar image horvath.daniel  ( 2021-08-31 05:39:29 -0600 )edit

It tells you that the driver you're using does not expose the required resources for the controller to use.

You'll have to make sure that you're using the correct version of the driver.

If you're using the UR driver, the Cartesian interfaces were only added recently, so you may have to update and rebuild.

But I'd ask the maintainers / developers.

gvdhoorn gravatar image gvdhoorn  ( 2021-08-31 05:59:13 -0600 )edit