Feedback Control in gazebo_ros2_control

asked 2022-07-26 18:07:27 -0500

parklane79 gravatar image

updated 2022-07-29 17:12:57 -0500


I have code that takes a position and velocity measurement (state), and a commanded position, and produces a control effort. I want to integrate this in gazebo_ros2_control and ros2_control for use on my robot in Gazebo. I confused on how to tell ros2_control that my control output is an effort. I cant seem to find an example of this in any of the demo code

In my yaml config I have:

   update_rate: 100  # Hz

   type: my_controller/MyController

   type: joint_state_broadcaster/JointStateBroadcaster

         - arm_1_joint
         - position
         - position
         - velocity

In my urdf I have

    <ros2_control name="GazeboSystem" type="system">
    <!-- Controlled joints -->
    <joint name="arm_1_joint">
        <command_interface name="position">
            <param name="min">-1</param>
            <param name="max">1</param>
        <state_interface name="position">
        <state_interface name="velocity"/>


   <plugin filename="" name="gazebo_ros2_control">
         <parameters>$(find my_robot)/config/my_controller_params.yaml</parameters>

Where would I state that my control input is an effort?

Also when building my own controller in ros2_control as in here. I can't seem to figure out how to define my control input in the 'update' method.

The closest example I could find was the JointTrajectoryController in ros2_control but I cannot find anywhere in the 'update' method where the control input is given.

I am completely at a loss on trying to figure this out. I can get the demo controllers to work, but cannot figure out how to integrate my own controller. Documentation is very sparse and trying to read demo code that has little/no comments is driving me a little insane.

If it helps, I am running ros2-foxy with Gazebo 11 on WSL with Windows 11

Thank You

edit retag flag offensive close merge delete