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

Add an option to skip interpolation in the joint trajectory controller #374

Merged
merged 5 commits into from
Jul 11, 2022

Conversation

AndyZe
Copy link
Contributor

@AndyZe AndyZe commented Jul 1, 2022

This should be useful if a user has a trajectory that is already interpolated to a fine degree, or if the low-level controllers just don't handle fine waypoint spacing well.

To use, just set the parameter in the yaml file. If the parameter is unset, it defaults to the previous method (which is spline-based). The default spline-based method doesn't obey joint limits (position/vel/accel/jerk), which is another reason to use this.

panda_arm_controller:
  ros__parameters:
    command_interfaces:
      - position
      - velocity
      - acceleration
    state_interfaces:
      - position
      - velocity
      - acceleration
    joints:
      - panda_joint1
      - panda_joint2
      - panda_joint3
      - panda_joint4
      - panda_joint5
      - panda_joint6
      - panda_joint7
    interpolation_method: none   # (or "splines")
    joint_limits:
      panda_joint1:
        has_velocity_limits: true
        max_velocity: 2.1750
        has_acceleration_limits: true
        max_acceleration: 3.75
      panda_joint2:
        ...

time_before_traj_msg_, state_before_traj_msg_, first_point_timestamp, first_point_in_msg,
sample_time, output_state);
// If interpolation is disabled, just forward the next waypoint
if (interpolation_method == joint_trajectory_controller::InterpolationMethod::NONE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we check this before calling sample in the update method?

What I understand, we will anyway have also ruckig based interpolation this means that we would need some base class for interpolations. If so we can then just decide at the begining in the configure which interpolation should be used and if non is used then we have default "passthrough" interpolation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should also reduce number of checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think Ruckig is going to be a drop-in replacement for the spline interpolation that's currently there. It requires position/vel/accel inputs. What if there is only a position interface active? Then Ruckig will not have vel/accel input. So we will often still need to run some type of interpolation before Ruckig.

I'm trying to figure out the logic re. your comment on update...

@mergify
Copy link
Contributor

mergify bot commented Jul 6, 2022

This pull request is in conflict. Could you fix it @AndyZe?

Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments to increase maintainability and clarity in the code. Sorry, guys if I am starting to be too picky, and please tell me if I am drifting away in my requests/concerns.

@AndyZe AndyZe force-pushed the andyz/jtc_passthrough branch 7 times, most recently from 17ad373 to fb384bc Compare July 9, 2022 18:48
Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the follow-ups!

@destogl destogl merged commit d1d86c7 into ros-controls:master Jul 11, 2022
mamueluth pushed a commit to StoglRobotics-forks/ros2_controllers that referenced this pull request Aug 26, 2022
…os-controls#374)

* Introduce `InterpolationMethods` structure
* Use parameters to define interpolation use in JTC
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

Successfully merging this pull request may close these issues.

None yet

3 participants