Skip to content

fixed executor issue using wrong task attribute and implementation call#198

Merged
khughes-bdai merged 4 commits into
rai-opensource:mainfrom
zmk5:main
Mar 31, 2026
Merged

fixed executor issue using wrong task attribute and implementation call#198
khughes-bdai merged 4 commits into
rai-opensource:mainfrom
zmk5:main

Conversation

@zmk5
Copy link
Copy Markdown
Contributor

@zmk5 zmk5 commented Mar 17, 2026

Proposed changes

Following issue #197, I finally had the time to formally implement the changes discussed there as a PR. This should allow synchros2 to work with a spot_ros2 Jazzy implementation.

The computer I made the fix with is a work laptop that can't run ROS for the lint and unit tests, and the computer where we have this code deployed is restricted from the internet. Please let me know if it does pass the linting and unit test requirements so I can fix any changes that may crop up. Sorry for this inconvenience!

Checklist

  • Lint and unit tests pass locally
  • I have added tests that prove my changes are effective
  • I have added necessary documentation to communicate the changes

Copy link
Copy Markdown
Collaborator

@mhidalgo-rai mhidalgo-rai left a comment

Choose a reason for hiding this comment

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

Patch looks reasonable to me. Mind DCO sign?

I'll go check why CI fails on an unrelated test.

@zmk5
Copy link
Copy Markdown
Contributor Author

zmk5 commented Mar 17, 2026

Yeah sure. I hope what I did worked. It was giving me some weird rebase issue when I tried to amend the previous commit with the sign-off.

If I run into any issues with running spot_ros2 in jazzy I'll make sure to submit some more patches.

@zmk5
Copy link
Copy Markdown
Contributor Author

zmk5 commented Mar 18, 2026

Looking at where the error points here and the class it is testing here, it doesn't seem that this error has anything to do with what I've submitted.

@zmk5
Copy link
Copy Markdown
Contributor Author

zmk5 commented Mar 18, 2026

Please do not merge the patch yet. I've tested my patch on the hardware and it seems to not be working. When I originally made the fix, I just replaced _do_spin_once with _spin_once_impl, but for this patch, I added an extra method called _spin_once_impl that called _do_spin_once to preserve backwards compat. However, if I do that I get the following error:

[spot_ros2-1] Traceback (most recent call last):
[spot_ros2-1]   File "/home/sandia-autonomy/Developer/spot_ws/install/spot_driver/lib/spot_driver/spot_ros2", line 3182, in <module>
[spot_ros2-1]     main()
[spot_ros2-1]   File "/home/sandia-autonomy/Developer/spot_ws/install/synchros2/lib/python3.12/site-packages/synchros2/process.py", line 212, in __call__
[spot_ros2-1]     return func_taking_argv(rclpy.utilities.remove_ros_args(argv))
[spot_ros2-1]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[spot_ros2-1]   File "/home/sandia-autonomy/Developer/spot_ws/install/spot_driver/lib/spot_driver/spot_ros2", line 3178, in main
[spot_ros2-1]     ros_process.spin(SpotROS)
[spot_ros2-1]   File "/home/sandia-autonomy/Developer/spot_ws/install/synchros2/lib/python3.12/site-packages/synchros2/process.py", line 446, in spin
[spot_ros2-1]     process.spin(factory, *args, **kwargs)
[spot_ros2-1]   File "/home/sandia-autonomy/Developer/spot_ws/install/synchros2/lib/python3.12/site-packages/synchros2/scope.py", line 485, in spin
[spot_ros2-1]     self._executor.spin()
[spot_ros2-1]   File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/executors.py", line 359, in spin
[spot_ros2-1]     self._spin_once_impl()
[spot_ros2-1]   File "/home/sandia-autonomy/Developer/spot_ws/install/synchros2/lib/python3.12/site-packages/synchros2/executors.py", line 665, in _spin_once_impl
[spot_ros2-1]     self._do_spin_once(args, kwargs)
[spot_ros2-1]   File "/home/sandia-autonomy/Developer/spot_ws/install/synchros2/lib/python3.12/site-packages/synchros2/executors.py", line 670, in _do_spin_once
[spot_ros2-1]     task, entity, node = self.wait_for_ready_callbacks(*args, **kwargs)
[spot_ros2-1]                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[spot_ros2-1]   File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/executors.py", line 874, in wait_for_ready_callbacks
[spot_ros2-1]     return next(self._cb_iter)
[spot_ros2-1]            ^^^^^^^^^^^^^^^^^^^
[spot_ros2-1]   File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/executors.py", line 642, in _wait_for_ready_callbacks
[spot_ros2-1]     timeout_nsec = timeout_sec_to_nsec(
[spot_ros2-1]                    ^^^^^^^^^^^^^^^^^^^^
[spot_ros2-1]   File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/utilities.py", line 161, in timeout_sec_to_nsec
[spot_ros2-1]     if timeout_sec is None or timeout_sec < 0:
[spot_ros2-1]                               ^^^^^^^^^^^^^^^
[spot_ros2-1] TypeError: '<' not supported between instances of 'tuple' and 'int'

It seems the line 670, task, entity, node = self.wait_for_ready_callbacks(*args, **kwargs), turns out I forgot to put the * and ** signs when passing args and kwargs to the _do_spin_once() call within _spin_once_impl.

I'll submit a fix for that now.

zmk5 added 2 commits March 18, 2026 17:54
Signed-off-by: Zahi Kakish <zmkakis@sandia.gov>
Signed-off-by: Zahi Kakish <zmkakis@sandia.gov>
Copy link
Copy Markdown
Collaborator

@mhidalgo-rai mhidalgo-rai left a comment

Choose a reason for hiding this comment

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

Good catch @zmk5 !

@mhidalgo-rai mhidalgo-rai mentioned this pull request Mar 30, 2026
3 tasks
@mhidalgo-rai
Copy link
Copy Markdown
Collaborator

@tcappellari-bdai this is good to go. Jazzy CI fails because Jazzy is broken upstream (ros2/rclpy#1598).

@khughes-bdai khughes-bdai merged commit d8b5263 into rai-opensource:main Mar 31, 2026
6 of 7 checks passed
@zmk5
Copy link
Copy Markdown
Contributor Author

zmk5 commented Apr 2, 2026

Thanks for the merge!

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.

4 participants