Skip to content

KafuuChikai/test_torch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

test_torch

0. Introduction

This is a generic ROS package designed to test the functionality of LibTorch. https://pytorch.org/get-started/locally/

Tested Libtorch version:

libtorch-version

Please download cxx11 ABI version, otherwise it may cause ROS library error.

Reference:

1. Installation

  • Move this package to the directory of your ROS workspace (e.g., catkin_ws/src/).

    • Create a workspace: cd $HOME && mkdir -p catkin_ws/src

    • Clone the repo into the workspace:

      cd $HOME/catkin_ws/src
      git clone https://github.com/KafuuChikai/test_torch.git
      
  • Change the Torch_DIR variable in the CMakeLists.txt file to point to your LibTorch installation directory.

    # set package directories
    set(Torch_DIR {Your_libtorch_path})
  • Navigate to the catkin_ws/ directory and then build:

    catkin_make

Possible make ERROR:

CMake Error at test_torch/CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.18 or higher is required.  You are running version 3.xx.x

Resolution: update Cmake:

  1. Download from https://cmake.org/files/ and

    tar -xvzf cmake-3.xx.tar.gz
  2. Make and install

    cd cmake-3.xx.tar.gz
    ./configure
    make
    sudo make install
    

2. getting started

To get started, open a terminal and start roscore.

roscore

Then, in another terminal, run ROS node.

rosrun test_torch test_torch

3. raspberry pi

  • Tested Libtorch version:

https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.6.0%2Bcpu.zip

Do not use v2.2.x. Just download and there is no need to make.

  • Tested CMake version:

cmake-3.18.5.tar.gz

​ Install is the same as Ubuntu!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published