Hi @bshah , apologies for the late response but I finally came back to try going through the tutorial and I am able to successfully read the topics from the stretch and stow the arm with the service call. One thing that I realized the tutorial also doesn’t mention is homing the robot before being able to send the service call. Sorry for the nitpicky detail, but I realized I missed that as I autopiloted my way through the tutorial commands.
I then tried running ros2 run stretch_deep_perception detect_objects
, but received an error that I need to install ultralytics, so I pip installed that (pip install ultralytics
). The default pip install gives me version 8.3.169 whereas the stretch currently has 8.3.40. When I tried to run again, I then received a numpy version error because I am running version 2.2.6 whereas the stretch currently has 1.26.4. The error is pasted at the bottom of this reply. I tried a simple fix of just creating a virtual venv with the same numpy version as the stretch so that I wouldn’t create issues on my desktop pc but that didn’t work. I will likely try looking into it more next week but this is all I had time for today.
All of this is on the stretch 3 btw.
Hope this is helpful and thank you always for your great responses!
joy@joy:~/ament_ws$ ros2 run stretch_deep_perception detect_objects
Traceback (most recent call last):
File "/home/joy/ament_ws/install/stretch_deep_perception/lib/stretch_deep_perception/detect_objects", line 33, in <module>
sys.exit(load_entry_point('stretch-deep-perception==0.0.0', 'console_scripts', 'detect_objects')())
File "/home/joy/ament_ws/install/stretch_deep_perception/lib/stretch_deep_perception/detect_objects", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/joy/ament_ws/install/stretch_deep_perception/lib/python3.10/site-packages/stretch_deep_perception/detect_objects.py", line 6, in <module>
from . import detection_node as dn
File "/home/joy/ament_ws/install/stretch_deep_perception/lib/python3.10/site-packages/stretch_deep_perception/detection_node.py", line 7, in <module>
import ros2_numpy
File "/home/joy/ament_ws/install/ros2_numpy/local/lib/python3.10/dist-packages/ros2_numpy/__init__.py", line 9, in <module>
from . import geometry
File "/home/joy/ament_ws/install/ros2_numpy/local/lib/python3.10/dist-packages/ros2_numpy/geometry.py", line 3, in <module>
import tf_transformations as transformations
File "/opt/ros/humble/lib/python3.10/site-packages/tf_transformations/__init__.py", line 46, in <module>
import transforms3d
File "/usr/lib/python3/dist-packages/transforms3d/__init__.py", line 10, in <module>
from . import quaternions
File "/usr/lib/python3/dist-packages/transforms3d/quaternions.py", line 26, in <module>
_MAX_FLOAT = np.maximum_sctype(np.float)
File "/home/joy/.local/lib/python3.10/site-packages/numpy/__init__.py", line 400, in __getattr__
raise AttributeError(
AttributeError: `np.maximum_sctype` was removed in the NumPy 2.0 release. Use a specific dtype instead. You should avoid relying on any implicit mechanism and select the largest dtype of a kind explicitly in the code.
[ros2run]: Process exited with failure 1