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
84 changes: 84 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#基础样式
BasedOnStyle: Google
# 指针和引用的对齐: Left, Right, Middle
DerivePointerAlignment: false
PointerAlignment: Right
#访问修饰符前的空格
AccessModifierOffset: -2
# 缩进宽度
IndentWidth: 2
# 连续的空行保留几行
MaxEmptyLinesToKeep: 1
# 圆括号的换行方式
BreakBeforeBraces: Custom
# 是否允许短方法单行
AllowShortFunctionsOnASingleLine: false
# 支持一行的if
AllowShortIfStatementsOnASingleLine: false
# 在未封闭(括号的开始和结束不在同一行)的括号中的代码是否对齐
AlignAfterOpenBracket: Align
# switch的case缩进
IndentCaseLabels: true
# 每行字符的长度
ColumnLimit: 100
# 注释对齐,true将左对齐,false不会对齐
AlignTrailingComments: true
# C cast括号后加空格
SpaceAfterCStyleCast: false
# 换行的时候对齐操作符
AlignOperands: true
# 中括号两边空格 []
SpacesInSquareBrackets: false
# 多行声明语句按照=对齐
AlignConsecutiveDeclarations: true
# 连续赋值时,对齐所有等号
AlignConsecutiveAssignments: true
# 容器类的空格 例如 OC的字典
SpacesInContainerLiterals: false
# 在构造函数初始化时按逗号断行,并以冒号对齐
BreakConstructorInitializersBeforeComma: false
# 函数参数换行
AllowAllParametersOfDeclarationOnNextLine: true
#在续行(#下一行)时的缩进长度
ContinuationIndentWidth: 4
# tab键盘的宽度
TabWidth: 4
# 赋值运算符前加空格
SpaceBeforeAssignmentOperators: true
# 行尾的注释前加1个空格
SpacesBeforeTrailingComments: 1
# false表示所有形参要么都在同一行,要么都各自一行
BinPackParameters: false
# 头文件排序
SortIncludes: false

# 大括号换行,只有当BreakBeforeBraces设置为Custom时才有效
BraceWrapping:
# class定义后面
AfterClass: false
# 控制语句后面
AfterControlStatement: true
# enum定义后面
AfterEnum: false
# 函数定义后面
AfterFunction: true
# 命名空间定义后面
AfterNamespace: false
# struct定义后面
AfterStruct: false
# union定义后面
AfterUnion: false
# extern之后
AfterExternBlock: false
# catch之前
BeforeCatch: false
# else之前
BeforeElse: false
# 缩进大括号
IndentBraces: false
# 分离空函数
SplitEmptyFunction: false
# 分离空语句
SplitEmptyRecord: false
# 分离空命名空间
SplitEmptyNamespace: false
32 changes: 22 additions & 10 deletions .github/workflows/Compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ jobs:
-v ${{ github.workspace }}:/workspace
-w /workspace
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
- name: Init Submodule
uses: actions/checkout@v4
with:
submodules: recursive # 递归初始化所有子模块
# 如果子模块是私有仓库,需配置 SSH 密钥
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Build Project
run:
cd /workspace &&
mkdir build && cd build &&
cmake .. &&
cd /workspace &&
mkdir build && cd build &&
cmake .. -DENABLE_TENSORRT=ON &&
make -j

tensorrt10:
Expand All @@ -38,10 +44,16 @@ jobs:
-v ${{ github.workspace }}:/workspace
-w /workspace
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
- name: Init Submodule
uses: actions/checkout@v4
with:
submodules: recursive # 递归初始化所有子模块
# 如果子模块是私有仓库,需配置 SSH 密钥
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Build Project
run:
cd /workspace &&
mkdir build && cd build &&
cmake .. &&
cd /workspace &&
mkdir build && cd build &&
cmake .. -DENABLE_TENSORRT=ON &&
make -j
26 changes: 26 additions & 0 deletions .github/workflows/Lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: pre-commit Checks

on:
pull_request: # 在 PR 时触发
push: # 在推送代码到 main/master 分支时触发
branches: [main, master]

jobs:
pre-commit:
name: Run pre-commit checks
runs-on: ubuntu-latest # 使用 Ubuntu 环境

steps:
- name: Checkout code
uses: actions/checkout@v4 # 检出代码

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10" # 指定 Python 版本

- name: Install pre-commit
run: pip install pre-commit # 安装 pre-commit

- name: Run pre-commit checks
run: pre-commit run --all-files # 运行所有检查
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
build
models
.vscode
mustard0
mustard0
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "easy_deploy_tool"]
path = easy_deploy_tool
url = [email protected]:zz990099/EasyDeployTool.git
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
repos:
# 官方仓库中的基础钩子
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-xml
- id: check-yaml
args: ["--allow-multiple-documents"]
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
exclude_types: [rst]
- id: fix-byte-order-marker

# 运行 Uncrustify 格式化 C/C++ 代码
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v20.1.0" # 指定 clang-format 版本
hooks:
- id: clang-format
name: clang-format (check)
args: [--style=file, --dry-run, --Werror] # 检查模式
types: [c, c++]
exclude:
detection_6d_foundationpose/src/nvdiffrast(/.*)?
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ cmake_minimum_required(VERSION 3.8)
project(foundationpose_cpp)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

add_subdirectory(deploy_core)
add_subdirectory(inference_core)
add_subdirectory(easy_deploy_tool)
add_subdirectory(detection_6d_foundationpose)

add_subdirectory(simple_tests)
add_subdirectory(simple_tests)
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@

### Enviroment Build

1. 使用`docker`来构建运行环境
1. 下载`foundationpose_cpp`repo
```bash
git clone [email protected]:zz990099/foundationpose_cpp.git
cd foundationpose_cpp
git submodule init
git submodule update
```

2. 使用`docker`来构建运行环境
```bash
cd ${foundationpose_cpp}/docker
bash build_docker.sh --container_type=trt8 # trt10, jetson_trt8, jetson_trt10
Expand All @@ -71,7 +79,7 @@
```bash
cd /workspace
mkdir build && cd build
cmake ..
cmake -DENABLE_TENSORRT=ON ..
make -j
```

Expand Down
30 changes: 0 additions & 30 deletions deploy_core/CMakeLists.txt

This file was deleted.

68 changes: 0 additions & 68 deletions deploy_core/README.md

This file was deleted.

Loading