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

Servo Node - pause service: check if request is different than current state. #3265

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

Jelmerdw
Copy link
Contributor

Description

When using the servo_node from moveit_servo, the service call to /servo_node/pause_servo hangs for a while (sometimes even up to a minute on my machine) when requesting pause = false while the pause status was already false. This behavior can be experienced by running the demo:

ros2 launch moveit_servo demo_ros_api.launch.py

And calling the service:

ros2 service call /servo_node/pause_servo std_srvs/srv/SetBool '{data: false}'

After a while, the following error is logged:

[moveit_servo_demo_container.moveit.ros.move_group.collision_monitor]: Collision monitor could not be started

To avoid this behavior, I propose this change to first check whether the requested pause state is different compared to the current pause state. If not, the response will be returned with the message that nothing is changed since the requested pause stated was already active.

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

@Jelmerdw Jelmerdw changed the title Return if requested pause state is already active. Servo Node - pause service: check if request is different than current state. Jan 24, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 45.59%. Comparing base (870b23d) to head (c1391d6).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
moveit_ros/moveit_servo/src/servo_node.cpp 0.00% 6 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3265      +/-   ##
==========================================
- Coverage   45.94%   45.59%   -0.34%     
==========================================
  Files         716      716              
  Lines       62393    62379      -14     
  Branches     7543     7544       +1     
==========================================
- Hits        28659    28435     -224     
- Misses      33568    33777     +209     
- Partials      166      167       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

This is a good change, but also noting that #3259 was recently merged which may help with this. Checking if you have this commit locally?

Besides that, just one small comment to reduce duplication.

Signed-off-by: Jelmer de Wolde <jelmer.de.wolde@alliander.com>
Signed-off-by: Jelmer de Wolde <jelmer.de.wolde@alliander.com>
@Jelmerdw
Copy link
Contributor Author

Jelmerdw commented Jan 30, 2025

This is a good change, but also noting that #3259 was recently merged which may help with this. Checking if you have this commit locally?

Thanks for this suggestion, I didn't have that commit locally indeed. Now I get the Collision monitor could not be started error immediately, which is good enough for me.

I did apply you suggestion. Feel free to close this PR (since my actual problem was already solved by #3259), or to still merge it if you like to have this check on the servo pause state.

@sea-bass sea-bass added this pull request to the merge queue Jan 30, 2025
Merged via the queue into moveit:main with commit 0af5e0f Jan 30, 2025
9 checks passed
@sea-bass sea-bass added the backport-jazzy Mergify label that triggers a PR backport to Jazzy label Feb 15, 2025
mergify bot pushed a commit that referenced this pull request Feb 15, 2025
…t state. (#3265)

* Return if requested pause state is already active.

Signed-off-by: Jelmer de Wolde <jelmer.de.wolde@alliander.com>

* Reuse logger message with a shared string variable.

Signed-off-by: Jelmer de Wolde <jelmer.de.wolde@alliander.com>

---------

Signed-off-by: Jelmer de Wolde <jelmer.de.wolde@alliander.com>
(cherry picked from commit 0af5e0f)
sea-bass pushed a commit that referenced this pull request Feb 15, 2025
…t state. (#3265) (#3348)

Signed-off-by: Jelmer de Wolde <jelmer.de.wolde@alliander.com>
(cherry picked from commit 0af5e0f)

Co-authored-by: Jelmer de Wolde <Jelmerdw@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-jazzy Mergify label that triggers a PR backport to Jazzy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants