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

Ensure the robot state is up-to-date before Servoing #2954

Merged
merged 4 commits into from
Aug 13, 2024

Conversation

AndyZe
Copy link
Member

@AndyZe AndyZe commented Aug 7, 2024

Description

Previously we didn't wait to get a current robot state before servoing began. That caused the initial joint angles to be all-zero, which caused a small jump at the beginning of motion. This is a fix.

Test with:

ros2 launch moveit_servo demo_ros_api.launch.py

ros2 run moveit_servo servo_keyboard_input

Copy link
Contributor

@sea-bass sea-bass left a comment

Choose a reason for hiding this comment

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

Fixes look good at a glance!

One thing to watch out for, from my own experience, is what happens if you pause/stop servo, move the robot through some other free-space motion planner, and then resume servo. (Maybe @pac48 and @sjahr can test with MoveIt Pro and double check?)

Far as I remember, this was one reason for the liberal sprinkling of resetSmoothing(), but I don't doubt this PR fixes that. I just want to make sure it wasn't pruned too much to affect the interaction with other motions.

Essentially, there are 2 alternatives:

  1. Keep the smoothing going even when servo is stopped,
  2. Ensure that transitioning servo from stopped to not stopped triggers a reset to the latest state when restarting.

There are merits to both, but just wanted to bring it up and have people test this case.

@AndyZe
Copy link
Member Author

AndyZe commented Aug 12, 2024

One thing to watch out for, from my own experience, is what happens if you pause/stop servo, move the robot through some other free-space motion planner, and then resume servo. (Maybe @pac48 and @sjahr can test with MoveIt Pro and double check?)

I had to add one line to fix this. Good catch. Here's a video of several cycles of Servo -> pause -> joint command -> unpause -> Servo again

servo_pausing.webm

@AndyZe AndyZe force-pushed the servo_initial_joints branch 2 times, most recently from 3089351 to 3686dae Compare August 12, 2024 16:37
Copy link
Contributor

@sea-bass sea-bass left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for that test!

@AndyZe AndyZe added this pull request to the merge queue Aug 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 13, 2024
Copy link
Contributor

@sjahr sjahr left a comment

Choose a reason for hiding this comment

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

Nice work, thanks!

@sjahr sjahr merged commit 2178ed0 into moveit:main Aug 13, 2024
10 of 12 checks passed
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.

3 participants