ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROS2_control general procedure

asked 2022-05-23 14:55:05 -0500

MaxDio gravatar image

Hi there,

So I have a KUKA IIWA LBR7 which I want to control via the https://github.com/KCL-BMEIS/lbr_fri_.... But I am pretty confused by ros2_control framework overall. Although I had a look at the demos I am not sure how to proceed or understand the general procedure:

So I need to launch the controller_manager but how do I connect it to the hardware interfaces?? In ros(1)_control I was able to define it during the construction of he controller_manager via reference

Cheers Max

edit retag flag offensive close merge delete

Comments

Should you not ask the KCL-BMEIS/lbr_fri_ros2_stack developers/maintainers for guidance?

The chances someone here has experience with the exact package you link are rather low.

gvdhoorn gravatar image gvdhoorn  ( 2022-05-24 02:13:23 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2022-05-26 20:55:51 -0500

saltus gravatar image

In ros2_control, the hardware interfaces are done through a hardware abstraction layer in the form of a plugin which is loaded dynamically by the resource manager at runtime. This hardware abstraction layer is defined in a separate cpp file, which is then linked to the urdf with the ros2_control xacro tag. In the standard setup, when your launch file is executed, the urdf location is passed to the ros2_control node, which loads the plugin and sets up the hardware interface.

Relevant tutorial links: Resource Manager , Hardware Description in URDF , Building Interface Class

Demo links: Sample hardware abstraction , with associated ros2_control.urdf file (this is just tacked on at the end of the full urdf here by importing with xacro), and then associated high level launch file.

edit flag offensive delete link more
1

answered 2022-05-24 02:18:03 -0500

Joe28965 gravatar image

In ros2_control you add it to the config file. If you look at this config file, you can see that the forward_position_controller and position_trajectory_controller are parameters for the controller_manager. Then you simply need to add the type of the controller.

As for how the controller_manager knows what to control. I'm pretty sure that's done by this function and the one below.

The first one returns the states, the second one the commands. I'm pretty sure that the controller_manager calls them.

Finally you need to add something like this to your URDF.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-05-23 14:55:05 -0500

Seen: 217 times

Last updated: May 26 '22