Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# SPDX-License-Identifier: GPL-3.0
# Copyright (C) 2025-2026 Luo1imasi

cmake_minimum_required(VERSION 3.16)
project(roboparty-inference)
project(roboparty_inference)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native")
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
Expand Down Expand Up @@ -55,21 +58,21 @@ target_link_libraries(robot PUBLIC ${PUBLIC_DEPENDENCIES} utils cnpy
pybind11_add_module(robot_py src/pybind_module.cpp)
target_link_libraries(robot_py PUBLIC robot)

add_executable(${PROJECT_NAME}_node src/inference_node.cpp src/ros_interface.cpp src/obs_manager.cpp)
target_include_directories(${PROJECT_NAME}_node
add_executable(inference_node src/inference_node.cpp src/ros_interface.cpp src/obs_manager.cpp)
target_include_directories(inference_node
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
${ONNXRUNTIME_INCLUDE_DIR}
${CNPY_INCLUDE_DIR}
)
target_link_libraries(${PROJECT_NAME}_node PUBLIC ${PUBLIC_DEPENDENCIES} utils cnpy robot)
ament_target_dependencies(${PROJECT_NAME}_node PUBLIC rclcpp sensor_msgs geometry_msgs std_srvs)
target_link_libraries(inference_node PUBLIC ${PUBLIC_DEPENDENCIES} utils cnpy robot)
ament_target_dependencies(inference_node PUBLIC rclcpp sensor_msgs geometry_msgs std_srvs)

set_target_properties(${PROJECT_NAME}_node PROPERTIES LINK_FLAGS "-Wl,--no-as-needed")
set_target_properties(inference_node PROPERTIES LINK_FLAGS "-Wl,--no-as-needed")

install(TARGETS ${PROJECT_NAME}_node
install(TARGETS inference_node
RUNTIME DESTINATION lib/${PROJECT_NAME})

install(TARGETS robot utils
Expand Down
3 changes: 3 additions & 0 deletions include/robot_interface.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#pragma once

#include <string>
Expand Down
7 changes: 5 additions & 2 deletions launch/inference.launch.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-License-Identifier: GPL-3.0
# Copyright (C) 2025-2026 Luo1imasi

##launch file
from launch import LaunchDescription
from launch_ros.actions import Node
Expand All @@ -7,7 +10,7 @@
def generate_launch_description():
configs = [
os.path.join(
get_package_share_directory("inference"),
get_package_share_directory("roboparty_inference"),
"config",
"inference.yaml",
),
Expand All @@ -16,7 +19,7 @@ def generate_launch_description():
return LaunchDescription(
[
Node(
package="inference",
package="roboparty_inference",
executable="inference_node",
name="inference_node",
parameters=configs,
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>roboparty-inference</name>
<name>roboparty_inference</name>
<version>1.1.5</version>
<description>inference package</description>
<maintainer email="ZhihaoLiu_hit@163.com">RoboParty</maintainer>
Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# SPDX-License-Identifier: GPL-3.0
# Copyright (C) 2025-2026 Luo1imasi

add_subdirectory(utils)
3 changes: 3 additions & 0 deletions src/inference_node.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#include "inference_node.hpp"

ObsStackOrder InferenceNode::parse_obs_stack_order(const std::string& stack_order_name) {
Expand Down
3 changes: 3 additions & 0 deletions src/inference_node.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#pragma once

#include <sys/mman.h>
Expand Down
3 changes: 3 additions & 0 deletions src/obs_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#include "inference_node.hpp"

namespace {
Expand Down
3 changes: 3 additions & 0 deletions src/pybind_module.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "robot_interface.hpp"
Expand Down
3 changes: 3 additions & 0 deletions src/robot_interface.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#include "robot_interface.hpp"

RobotInterface::RobotInterface(const std::string& config_file) {
Expand Down
3 changes: 3 additions & 0 deletions src/ros_interface.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#include "inference_node.hpp"

void InferenceNode::load_config() {
Expand Down
3 changes: 3 additions & 0 deletions src/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-License-Identifier: GPL-3.0
# Copyright (C) 2025-2026 Luo1imasi

AUX_SOURCE_DIRECTORY(. SOURCE_LIST_UTILS)
add_library(utils
STATIC
Expand Down
3 changes: 3 additions & 0 deletions src/utils/close_chain_mapping.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#include "close_chain_mapping.hpp"
#include "decouple_rpo.hpp"

Expand Down
3 changes: 3 additions & 0 deletions src/utils/close_chain_mapping.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#pragma once

#include <memory>
Expand Down
3 changes: 3 additions & 0 deletions src/utils/decouple_rpo.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#include "decouple_rpo.hpp"
#include <iostream>

Expand Down
3 changes: 3 additions & 0 deletions src/utils/decouple_rpo.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#pragma once

#include "close_chain_mapping.hpp"
Expand Down
3 changes: 3 additions & 0 deletions src/utils/motion_loader.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#include "motion_loader.hpp"

MotionLoader::MotionLoader(const std::string& motion_file) {
Expand Down
3 changes: 3 additions & 0 deletions src/utils/motion_loader.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#pragma once

#include <cnpy.h>
Expand Down
3 changes: 3 additions & 0 deletions src/utils/thread_pool.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
// Copyright (C) 2025-2026 Luo1imasi

#pragma once

#include <vector>
Expand Down
Loading