Stretch 3 Offload Computing to Jetson AGX Orin

Hello all,

I’m encountering an error while following this guide, https://docs.hello-robot.com/0.3/ros2/remote_compute/ on offloading computation from the Hello Robot Stretch 3 to the NVIDIA Jetson AGX Orin. I’m currently at the end of step 2, building the workspace with " colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release ", but I’ve run into a CMake error.
From what I can tell, the error seems to be related to the git cloning of the “ros2-development” branch of the realsense-ros. I’ve tried troubleshooting on my own, but I’m still stuck and could really use an advice.
Any suggestions or advice would be greatly appreciated.

Hey @ashishderiya, looks like the error is complaining that librealsense2 is missing. Would you try following these steps to install it?

Then try building the workspace again.

Hi, I’m actually running into a similar issue now trying to offload the compute to a desktop pc with a GPU. It seems that cloning git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2-development with the development flag as instructed on the tutorial causes build errors if you are not using realsense 2.56, which isn’t the version that comes when installing with apt. I cloned with the ros2-master flag instead and was at least able to build the workspace.

Thanks @jimmy, good catch! I’ll make the edit to the docs. Does the rest of the tutorial work with ros2-master?

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