Skip to content

Commit

Permalink
fixing the computer vision test pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Rshah2004 committed Jun 9, 2024
1 parent 42ae2f8 commit 3748ed8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,20 @@ jobs:
run: |
touch ./opencv-install/COLCON_IGNORE
- name: Download and extract LibTorch
run: |
wget https://download.pytorch.org/libtorch/cu111/libtorch-shared-with-deps-1.8.1%2Bcu111.zip
unzip -o libtorch-shared-with-deps-1.8.1+cu111.zip -d libtorch
- name: Source setup and build then test using colcon
shell: bash
env:
LD_LIBRARY_PATH: /usr/local/lib/
Torch_DIR: ${{ github.workspace }}/libtorch/libtorch/share/cmake/Torch
run: |
source /opt/ros/foxy/setup.bash
source /usr/share/gazebo/setup.sh
colcon build --cmake-args -DCMAKE_CXX_STANDARD=14
colcon build --cmake-args -DCMAKE_CXX_STANDARD=14 -DTorch_DIR=$Torch_DIR
source ./install/setup.bash
colcon test
colcon test-result --verbose
11 changes: 8 additions & 3 deletions src/triton_object_recognition/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@ find_package(cv_bridge REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(image_transport REQUIRED)
find_package(OpenCV 4.5.3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem)
find_package(Torch REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem)

# Use Torch_DIR environment variable if set
if(DEFINED ENV{Torch_DIR})
set(Torch_DIR $ENV{Torch_DIR})
else()
set(Torch_DIR "/default/path/to/libtorch/share/cmake/Torch")
endif()
find_package(Torch REQUIRED)

include_directories(include ${catkin_INCLUDE_DIRS})
include_directories(${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
Expand All @@ -39,7 +45,6 @@ add_library(triton_object_recognition SHARED
target_link_libraries(triton_object_recognition ${OpenCV_LIBRARIES} ${Boost_LIBRARIES})
target_link_libraries(your_executable_name "${TORCH_LIBRARIES}")


rclcpp_components_register_nodes(triton_object_recognition
"triton_object_recognition::ObjectRecognizer"
)
Expand Down

0 comments on commit 3748ed8

Please sign in to comment.