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

Using both position and velocity controller #69

Open
BCaran opened this issue Feb 28, 2024 · 2 comments
Open

Using both position and velocity controller #69

BCaran opened this issue Feb 28, 2024 · 2 comments

Comments

@BCaran
Copy link

BCaran commented Feb 28, 2024

I have eight motors (Dynamixel XH430-W210-T), 4 for steering and 4 for driving mobile robot. I would like to control steering motor with position controller and driving motor with velocity controller...is this possible? I tried using JointGroupPositionController and JointGroupVelocityController and when I send [0, 0, 0, 0] to position controller, steering motors go to 0 position, but then I try to send [0.5, 0.5, 0.5, 0.5] to velocity controller and driving motors start driving a bit and then return to 0...does anyone know why is that..am I missing something?
I am using ROS2 Humble with ros2_controll, and my .yaml file is bellow:

controller_manager:
  ros__parameters:
    update_rate: 100  # Hz

    joint_state_broadcaster:
      type: joint_state_broadcaster/JointStateBroadcaster

    velocity_controller:
      type: velocity_controllers/JointGroupVelocityController

    position_controller:
      type: position_controllers/JointGroupPositionController

velocity_controller:
  ros__parameters:
    joints:
      - FL_wheel
      - BL_wheel
      - BR_wheel
      - FR_wheel

position_controller:
  ros__parameters:
    joints:
      - FL_steering
      - BL_steering
      - BR_steering
      - FR_steering
@BCaran
Copy link
Author

BCaran commented Feb 28, 2024

I have noticed, that when control mode is changed, all the motors change their control mode. Is it possible to define specific control interface for each motor at the same time. For example to have 4 motors that are controlled using position control mode and 4 motors that are controlled using velocity control mode?

@ijnek
Copy link
Member

ijnek commented Mar 5, 2024

The quick answer is no, this is not supported currently. It is assumed that all of the joints will be using the same controller type.
That being said, I don't think there is anything preventing this from being implemented, and would be a good addition if anyone is interested in opening a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants