Skip to content

ROS2 PyTorch template node - running PyTorch C++ models in ROS2

License

Notifications You must be signed in to change notification settings

klintan/ros2_pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS2 PyTorch node

Run a PyTorch model in C++ in ROS2. A template node to be able to adapt to whatever model you want to run, for instance object detection of people and bikes.

Features

There might be major changes to the code as it is a WIP.

Topics

/ - topic for

Build and installation

Make sure to run setup.bash and local_setup.bash for your ROS2 environment for all dependencies or symlink them into the repo.

Add Libtorch to your CMAKE_PREFIX_PATH env variable, like so:

export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:/path/to/libtorch

Add CV_Bridge as well if its not already on your CMAKE_PREFIX_PATH

export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:<path>

(If its built using colcon build this is the path to cv_bridge folder in the install folder.)

Run

colcon build

Unfortunately you also have to copy two libs from https://github.com/intel/mkl-dnn/releases into the libtorch lib folder.

libmklml.dylib libiomp5.dylib

Usage

ros2 run ros2_pytorch ros2_pytorch_node

References

About

ROS2 PyTorch template node - running PyTorch C++ models in ROS2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published