Deep_Object_Pose icon indicating copy to clipboard operation
Deep_Object_Pose copied to clipboard

ROS2 Humble

Open sara9915 opened this issue 2 years ago • 9 comments

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.

sara9915 avatar Oct 27 '23 11:10 sara9915

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

TontonTremblay avatar Oct 30 '23 17:10 TontonTremblay

@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 avatar Oct 30 '23 17:10 TontonTremblay

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 avatar Nov 03 '23 17:11 TontonTremblay

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='[email protected]',
    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?

TontonTremblay avatar Nov 03 '23 17:11 TontonTremblay

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 avatar Nov 03 '23 17:11 sara9915

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.

sara9915 avatar Nov 03 '23 18:11 sara9915

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 avatar Nov 03 '23 21:11 TontonTremblay

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

TontonTremblay avatar Mar 20 '24 17:03 TontonTremblay

I will take a look


From: Jonathan Tremblay @.> Sent: Wednesday, March 20, 2024 10:27 AM To: NVlabs/Deep_Object_Pose @.> Cc: Jeff Smith @.>; Mention @.> Subject: Re: [NVlabs/Deep_Object_Pose] ROS2 Humble (PR #326)

@nv-jeffhttps://github.com/nv-jeff do you think you could this one out and add to the refactor you are working on?

— Reply to this email directly, view it on GitHubhttps://github.com/NVlabs/Deep_Object_Pose/pull/326#issuecomment-2010167253, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AP65QBFY6LXBNCAZPKIK4QLYZHBINAVCNFSM6AAAAAA6SU62F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJQGE3DOMRVGM. You are receiving this because you were mentioned.Message ID: @.***>

nv-jeff avatar Mar 20 '24 17:03 nv-jeff