dusty-nv / jetson-inference

Hello AI World guide to deploying deep-learning inference networks and deep vision primitives with TensorRT and NVIDIA Jetson.
https://developer.nvidia.com/embedded/twodaystoademo
MIT License
7.71k stars 2.97k forks source link

ROS2 Dashing + Jetson Inference #1778

Open Rolix57 opened 8 months ago

Rolix57 commented 8 months ago

Hi guys!

I am trying to run detectnet and imagenet using ROS Dashing in a Jetson Nano 2GB with the JetPack 4.6. Dashing seems to be working properly - I've just tested some dummy publisher and subscriber nodes. The real issue comes when I want to integrate Jetson Inference. The build works without an issue. However, when I try to do the launch for video_source, imagenet or detectnet.

The terminal is properly sourced for ros2 and the workspace. I have not modified a thing in the launch files.

ros2 launch ros_deep_learning detectnet.ros2.launch

I have the following error:

1704759117.6031718 [INFO] [launch]: All log files can be found below/home/puzzlebot/.ros/log/2024-01-08-18-11-56-045550-puzzlebot-desktop-32545 1704759117.6037271 [INFO] [launch]: Default logging verbosity is set to INFO 1704759117.7718298 [ERROR] [launch]: Caught exception in launch (see debug for traceback): invalid syntax (video_source.ros2.launch, line 1)

The log file contains the information I posted above. Previously I have used the ROS2 docker images without an issue, any clue what might be the problem?

Best

dusty-nv commented 8 months ago

invalid syntax (video_source.ros2.launch, line 1)

Hi @Rolix57, it was probably some syntax change that occurred between Dashing and Foxy, and Dashing being EOL for some time I haven't ever used it. The earliest I tested this with was Eloquent but an not sure it still works with that (also EOL). Actually I think everything is EOL except Humble? ROS2 moved fast and broke stuff.

Rolix57 commented 8 months ago

So I figured it out!

Thank you for your response. So... you were totally right, they changed some stuff related to ROS2. Starting Foxy you can create launches in XML, Yaml and Python. From Dashing to all the previous ones, you can only use Python for launch files.

I wrote the corresponding launch files for the ones available in the repository (video_source, video_output, video_viewer, detectnet, and imagenet), and they work well enough, they just lag a little bit. I assume it is because of the available computational power of the Jetson Nano.

Do you want me to share them with you?

Best

dusty-nv commented 8 months ago

Thank you @Rolix57, yes sure! - for other ROS2 projects I use the Python-based launch files, but in ros_deep_learning I had previously kept it XML for pseudo-compatibility between ROS1/ROS2 (years ago at this point). But with the waning user base of ROS1, I think it would be good to add the Python launch files 👍

Rolix57 commented 8 months ago

Sure! They work fine for ROS2 Dashing. However, they might need some slight changes for Foxy+ versions. launches.zip