modify some path in thridparty

This commit is contained in:
黄JY
2026-04-11 13:41:50 +08:00
parent db690df1dd
commit 5e270b20e7
3 changed files with 19 additions and 11 deletions
+9 -7
View File
@@ -101,13 +101,15 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Set optimization flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
set(TARGET_PREDICTION_DEPLOY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../TargetPrediction/deploy")
set(TARGET_PREDICTION_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../..")
set(TARGET_PREDICTION_DEPLOY_DIR "${TARGET_PREDICTION_ROOT_DIR}/deploy")
set(TARGET_PREDICTION_THIRDPARTY_DIR "${TARGET_PREDICTION_ROOT_DIR}/thirdparty")
set(ODIN_TARGET_OBSERVATION_AVAILABLE OFF)
set(ODIN_TARGET_OBSERVATION_READY OFF)
if(ODIN_DRIVER_ENABLE_TARGET_OBSERVATION AND
EXISTS "${TARGET_PREDICTION_DEPLOY_DIR}/YOLOs-CPP-TensorRT/include/yolos/tasks/pose.hpp" AND
EXISTS "${TARGET_PREDICTION_DEPLOY_DIR}/motcpp/CMakeLists.txt")
EXISTS "${TARGET_PREDICTION_THIRDPARTY_DIR}/YOLOs-CPP-TensorRT/include/yolos/tasks/pose.hpp" AND
EXISTS "${TARGET_PREDICTION_THIRDPARTY_DIR}/motcpp/CMakeLists.txt")
enable_language(CUDA)
find_package(CUDAToolkit REQUIRED)
@@ -143,7 +145,7 @@ if(ODIN_DRIVER_ENABLE_TARGET_OBSERVATION AND
set(MOTCPP_INSTALL OFF CACHE BOOL "" FORCE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_subdirectory(
${TARGET_PREDICTION_DEPLOY_DIR}/motcpp
${TARGET_PREDICTION_THIRDPARTY_DIR}/motcpp
${CMAKE_CURRENT_BINARY_DIR}/motcpp
EXCLUDE_FROM_ALL
)
@@ -152,7 +154,7 @@ if(ODIN_DRIVER_ENABLE_TARGET_OBSERVATION AND
message(WARNING "TensorRT not found. Target observation support disabled.")
endif()
elseif(ODIN_DRIVER_ENABLE_TARGET_OBSERVATION)
message(WARNING "TargetPrediction deploy dependencies not found. Target observation support disabled.")
message(WARNING "TargetPrediction thirdparty target-observation dependencies not found. Target observation support disabled.")
endif()
# Find common dependencies
@@ -191,11 +193,11 @@ set(COMMON_LIBS
if(ODIN_TARGET_OBSERVATION_READY)
add_library(target_observation_processing STATIC
src/target_observation_processing.cpp
${TARGET_PREDICTION_DEPLOY_DIR}/YOLOs-CPP-TensorRT/include/yolos/core/cuda_preprocessing.cu
${TARGET_PREDICTION_THIRDPARTY_DIR}/YOLOs-CPP-TensorRT/include/yolos/core/cuda_preprocessing.cu
)
target_include_directories(target_observation_processing PUBLIC
include
${TARGET_PREDICTION_DEPLOY_DIR}/YOLOs-CPP-TensorRT/include
${TARGET_PREDICTION_THIRDPARTY_DIR}/YOLOs-CPP-TensorRT/include
${TENSORRT_INCLUDE_DIR}
)
target_link_libraries(target_observation_processing
+2 -1
View File
@@ -4,7 +4,7 @@ import os
import yaml
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
@@ -78,6 +78,7 @@ def generate_launch_description():
# Create launch description
ld = LaunchDescription()
ld.add_action(SetEnvironmentVariable('RCUTILS_COLORIZED_OUTPUT', '1'))
ld.add_action(config_file_arg)
ld.add_action(rviz_config_arg) # Add RViz configuration argument
ld.add_action(host_sdk_node)
+8 -3
View File
@@ -40,6 +40,11 @@ std::filesystem::path get_package_source_directory_from_file()
return std::filesystem::path(__FILE__).parent_path().parent_path();
}
std::filesystem::path get_target_prediction_root_directory()
{
return get_package_source_directory_from_file().parent_path().parent_path().parent_path().parent_path();
}
std::string format_vector3f(const Eigen::Vector3f& value)
{
std::ostringstream oss;
@@ -184,11 +189,11 @@ CloudReprojectionRosNode::CloudReprojectionRosNode(const rclcpp::NodeOptions& op
void CloudReprojectionRosNode::loadParameters()
{
const auto package_path = get_package_source_directory_from_file();
const auto workspace_src_path = package_path.parent_path().parent_path().parent_path();
const auto target_prediction_root = get_target_prediction_root_directory();
const auto default_yolo_engine =
(workspace_src_path / "TargetPrediction" / "deploy" / "model" / "yolo26s-pose.trt").string();
(target_prediction_root / "deploy" / "model" / "yolo26s-pose.trt").string();
const auto default_yolo_labels =
(workspace_src_path / "TargetPrediction" / "deploy" / "YOLOs-CPP-TensorRT" / "models" / "coco.names").string();
(target_prediction_root / "thirdparty" / "YOLOs-CPP-TensorRT" / "models" / "coco.names").string();
// Declare and get parameters
this->declare_parameter<std::string>("cloud_slam_topic", "/odin1/cloud_slam");