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

Freedrive Controller #1114

Merged
merged 57 commits into from
Dec 18, 2024
Merged

Freedrive Controller #1114

merged 57 commits into from
Dec 18, 2024

Conversation

VinDp
Copy link
Collaborator

@VinDp VinDp commented Sep 25, 2024

The PR aims at introducing the possibility of enabling the freedrive mode through the ROS2 driver. It relies on the implementation of a specific controller to handle it, in order to correctly deactivate other controllers and avoid unsafe jumps of the robot once the freedrive mode is switched off.

@VinDp VinDp changed the title Freedrive Mode Freedrive Controller Sep 25, 2024
@gavanderhoorn
Copy link
Contributor

gavanderhoorn commented Sep 25, 2024

Would an action be nicer, semantically?

Start of action -> enable freedrive.

Cancel action -> stop freedrive.

The goal client handle would become something similar to a 'token' or 'mutex' (not exactly, as it wouldn't be as safe or strict, but conceptually).

Concurrent goal -> reject (something/someone else already has 'control' of the freedrive mode).

Event on robot or robot-controller causes freedrive to be disengaged -> abort action (notifies client something happened). A subscriber can't do that.

it would also make it (slightly) harder for something to take over control of the robot by just spamming Bool messages.

And it would make it semantically clearer it controls some specific functionality (ie: because a custom action goal needs to be submitted, instead of a generic Bool).

@fmauch
Copy link
Collaborator

fmauch commented Sep 25, 2024

Would an action be nicer, semantically?

I have to say, that makes sense! Thank you for the input :-)

@gavanderhoorn
Copy link
Contributor

One aspect that would need some thought though: time-out (ie: when should freedrive be stopped due to the client no longer 'responding').

There might be some way to exploit liveliness QoS or something, but I'm not sure how that would work with actions.

@urfeex
Copy link
Member

urfeex commented Dec 13, 2024

I just resolved the conflicts with the main branch. @VinDp is this ready to review?

@urfeex urfeex marked this pull request as ready for review December 13, 2024 14:55
Copy link
Member

@urfeex urfeex left a comment

Choose a reason for hiding this comment

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

I think, we need to revisit the RT-compatibility, especially regarding deactivate().

ur_controllers/doc/index.rst Outdated Show resolved Hide resolved
ur_controllers/src/freedrive_mode_controller.cpp Outdated Show resolved Hide resolved
ur_controllers/src/freedrive_mode_controller.cpp Outdated Show resolved Hide resolved
ur_controllers/src/freedrive_mode_controller.cpp Outdated Show resolved Hide resolved
ur_controllers/src/freedrive_mode_controller.cpp Outdated Show resolved Hide resolved
VinDp and others added 7 commits December 16, 2024 09:18
Co-authored-by: Felix Exner <feex@universal-robots.com>
…r.hpp

Co-authored-by: Felix Exner <feex@universal-robots.com>
…r.hpp

Co-authored-by: Felix Exner <feex@universal-robots.com>
Co-authored-by: Felix Exner <feex@universal-robots.com>
Co-authored-by: Felix Exner <feex@universal-robots.com>
Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 3.78%. Comparing base (1b121b7) to head (49c265d).
Report is 370 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##            main   #1114      +/-   ##
========================================
+ Coverage   3.59%   3.78%   +0.19%     
========================================
  Files         13     395     +382     
  Lines        947   43449   +42502     
  Branches     152    6395    +6243     
========================================
+ Hits          34    1645    +1611     
- Misses       843   41661   +40818     
- Partials      70     143      +73     
Flag Coverage Δ
unittests 3.78% <ø> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@urfeex urfeex self-requested a review December 18, 2024 07:42
Copy link
Member

@urfeex urfeex left a comment

Choose a reason for hiding this comment

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

This seems good to me :-)

Thank you @VinDp

@urfeex urfeex merged commit 8d4ba94 into UniversalRobots:main Dec 18, 2024
12 of 14 checks passed
@urfeex
Copy link
Member

urfeex commented Dec 18, 2024

@Mergifyio backport humble

Copy link

mergify bot commented Dec 18, 2024

backport humble

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Dec 18, 2024
This controller allows activating freedrive mode by continuously publishing an a topic

(cherry picked from commit 8d4ba94)

# Conflicts:
#	ur_robot_driver/doc/usage/controllers.rst
#	ur_robot_driver/src/hardware_interface.cpp
#	ur_robot_driver/urdf/ur.ros2_control.xacro
urfeex pushed a commit that referenced this pull request Dec 18, 2024
This controller allows activating freedrive mode by continuously publishing an a topic

(cherry picked from commit 8d4ba94)

# Conflicts:
#	ur_robot_driver/doc/usage/controllers.rst
#	ur_robot_driver/src/hardware_interface.cpp
#	ur_robot_driver/urdf/ur.ros2_control.xacro
urfeex pushed a commit that referenced this pull request Dec 18, 2024
This controller allows activating freedrive mode by continuously publishing an a topic

(cherry picked from commit 8d4ba94)

# Conflicts:
#	ur_robot_driver/doc/usage/controllers.rst
#	ur_robot_driver/src/hardware_interface.cpp
#	ur_robot_driver/urdf/ur.ros2_control.xacro
urfeex pushed a commit that referenced this pull request Dec 18, 2024
This controller allows activating freedrive mode by continuously publishing an a topic

---

Co-authored-by: Vincenzo Di Pentima <DiPentima@fzi.de>
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.

Added freedrive mode functionality to ROS2
4 participants