Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port velocity_controllers/joint_position_controller from ROS1 #472

Open
tonynajjar opened this issue Nov 24, 2022 · 5 comments
Open

Port velocity_controllers/joint_position_controller from ROS1 #472

tonynajjar opened this issue Nov 24, 2022 · 5 comments
Assignees

Comments

@tonynajjar
Copy link
Contributor

tonynajjar commented Nov 24, 2022

I know you probably have it on your roadmap somehwere but I didn't find it in the issues (found similar) so I'm writing this feature request to formalize it and track it

I might take this on in the near future.

@bmagyar
Copy link
Member

bmagyar commented Nov 25, 2022

Volunteer accepted! :D

@bmagyar bmagyar moved this to Todo in Roadmap / Features Nov 27, 2022
@destogl
Copy link
Member

destogl commented Nov 30, 2022

Wait! We maybe don't need that! :)

This is basically a PID controller. The question is does this separate name adds any value to it. Or should we stick with more basic names and parameterize controller accordingly.

Copy from the meeting notes

This controller is actually a PID controller – in ROS 1 we had to have those because of templated interfaces
Now we could do relatively simple specialization of PID controller - #434

Parameters set:

position_reference_velocity_commands_controller:
  ros__parameters:
    dof_names:
      - joint1
      - joint2

    command_interface: velocity

    reference_and_state_interfaces:
      - position

    gains:
      joint1: {p: 10.0, i: 1.0, d: 0.1}
      joint2: {p: 10.0, i: 1.0, d: 0.1}

@tonynajjar
Copy link
Contributor Author

Thanks for the heads up, how far away is the PR from being testable? I could help test it

@destogl
Copy link
Member

destogl commented Jan 11, 2023

The PR is testable and workable (almost in production already :D) But I didn't have a chance to finish up the tests.

@muttistefano
Copy link

muttistefano commented Mar 1, 2023

Dear @destogl , i'm trying to test and use your PR.
In my case, I have a joint position controlled hardware interface for a robot, and I want to use the PID controller to feed positions to the hardware interface while receiving velocity commands.
Up to now my config looks like :

controller_manager:
  ros__parameters:
    update_rate: 125  # Hz

    pid:
      type: "pid_controller/PidController"

    forward_velocity_controller_pid:
      type: forward_command_controller/ForwardCommandController

pid:
  ros__parameters:
    dof_names:
      - shoulder_pan_joint
      - shoulder_lift_joint
      - elbow_joint
      - wrist_1_joint
      - wrist_2_joint
      - wrist_3_joint

    command_interface: position

    reference_and_state_interfaces:
      # - position
      - velocity

    update_rate: 125

    gains:
      shoulder_pan_joint:  {"p": 1.0, "i": 1.0, "d": 0.0, "i_clamp_min": -7.0, "i_clamp_max": 7.0, "antiwindup": true}
      shoulder_lift_joint: {"p": 1.0, "i": 1.0, "d": 0.0, "i_clamp_min": -7.0, "i_clamp_max": 7.0, "antiwindup": true}
      elbow_joint:         {"p": 1.0, "i": 1.0, "d": 0.0, "i_clamp_min": -7.0, "i_clamp_max": 7.0, "antiwindup": true}
      wrist_1_joint:       {"p": 1.0, "i": 1.0, "d": 0.0, "i_clamp_min": -7.0, "i_clamp_max": 7.0, "antiwindup": true}
      wrist_2_joint:       {"p": 1.0, "i": 1.0, "d": 0.0, "i_clamp_min": -7.0, "i_clamp_max": 7.0, "antiwindup": true}
      wrist_3_joint:       {"p": 1.0, "i": 1.0, "d": 0.0, "i_clamp_min": -7.0, "i_clamp_max": 7.0, "antiwindup": true}

# preceeding_forward_velocity_controller_pid:
#   ros__parameters:
#     joints:
#       - pid/shoulder_pan_joint
#       - pid/shoulder_lift_joint
#       - pid/elbow_joint
#       - pid/wrist_1_joint
#       - pid/wrist_2_joint
#       - pid/wrist_3_joint
#     interface_name: velocity


forward_velocity_controller_pid:
  ros__parameters:
    joints:
      - pid/shoulder_pan_joint
      - pid/shoulder_lift_joint
      - pid/elbow_joint
      - pid/wrist_1_joint
      - pid/wrist_2_joint
      - pid/wrist_3_joint
    interface_name: velocity

Apart from the PID values that have to be tuned, it seems like the controller still receives position reference rather than velocity.
Am I doing something wrong?

This configuration is a modified version of the one provided in your pull request.
I had to comment out the preceding controller otherwise it wont work.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

4 participants