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

ROS2 Humble #326

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

ROS2 Humble #326

wants to merge 22 commits into from

Conversation

sara9915
Copy link

We developed a ROS2 package to make inference with DOPE network (it works without the ISAAC framework). Simply, we adapted the ROS interface of your package to work on ROS2, keeping your code structure and ROS topics unchanged.

We also modified some instructions in the inference scripts to make the code compatible with the updated version of the requirements (see requirements.txt). This has been necessary since ROS2 need to use Python 3.10. Moreover, enabling torch.backends.cudnn.benchmark, we run the inference at 17 fps on our workstation.

@TontonTremblay
Copy link
Collaborator

Thank you Sara, this is very cool. Let me install ros2 on my machine and test it out. I am excited about this.

@TontonTremblay
Copy link
Collaborator

@nv-jeff Do you think you could look into testing it, I am afraid that I do not have a 2204 machine to test on. Sorry for the delay, I appreciate the PR a lot.

@TontonTremblay
Copy link
Collaborator

white@white:~/ros2_ws$ colcon build
Starting >>> dope_ros2
--- stderr: dope_ros2                   
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
error: can't copy 'resource/dope_ros2': doesn't exist or not a regular file
---
Failed   <<< dope_ros2 [1.06s, exited with code 1]

Summary: 0 packages finished [2.05s]
  1 package failed: dope_ros2
  1 package had stderr output: dope_ros2

I am not a 100% sure how this works, but I got this following the readme.

As an other comment, it would be great if the PR was better integrated in the current code base. I am not sure what is the best way to do so. Thinking about it I could think of a ROS2 folder with this version of the code in there. And in the main readme we could add a reference to the ros2 folder?

@TontonTremblay
Copy link
Collaborator

I changed the setup.py:

setup(
    name=package_name,
    version='0.0.0',
    packages=find_packages(exclude=['test']),
    data_files=[
        # ('share/ament_index/resource_index/packages',
        #     ['resource/' + package_name]),
        ('share/' + package_name, ['package.xml']),
        (os.path.join('share', package_name, 'launch'), glob(os.path.join('launch', '*launch.[pxy][yma]*'))),
        (os.path.join('share', package_name, 'config'), glob('config/*.yaml')),
        (os.path.join('share', package_name, 'weights'), glob('weights/*.pth')),
        # (os.path.join('share', package_name, 'rviz'), glob('rviz/*.rviz')),
    ],
    install_requires=['setuptools', 'inference_script', 'uclv_utilities'],
    zip_safe=True,
    maintainer='sfederico',
    maintainer_email='sfederico@todo.todo',
    description='TODO: Package description',
    license='TODO: License declaration',
    tests_require=['pytest'],
    entry_points={
        'console_scripts': [
        'dope_node = dope_ros2.dope_node:main',
        ],
    },
)

But I still do not know how to start the node and use it, would it be possible to add light instructions as well?

@sara9915
Copy link
Author

sara9915 commented Nov 3, 2023

I apologize for this error. I realized that in the .gitignore I added the /resource folder by mistake (obviously it cannot find it).
I will fix the problem and then update the readme with some guidelines about the usage of the node.

As regards the folder for ros2 code, I can test the idea by pulling my code into your repo to check its correct functioning (I'm not sure due to compatibility between catkin build and colcon build). I'll let you know!

@sara9915
Copy link
Author

sara9915 commented Nov 3, 2023

Let me know if you have other problems running the code. Note that the structure of the code is equal to your, so you need to specify the parameters for the inference in the config files as described in your repo.

@TontonTremblay
Copy link
Collaborator

Thanks for the updates, I will try them next week. As for how to integrate both code base, I am not a 100%. Since I do not know how ROS2 works, I am not sure, maybe we could make a script that only downloads the ROS2 folder. I am trying to think of a way to do keep both ways, or maybe it is just wishful thinking and we should switch to ros2 all together. But with our robot, currently, we cannot use ros2. So I would be inclined not to do that.

@TontonTremblay
Copy link
Collaborator

@nv-jeff do you think you could this one out and add to the refactor you are working on?

@nv-jeff
Copy link
Contributor

nv-jeff commented Mar 20, 2024 via email

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.

None yet

5 participants