Skip to content

Commit 7c0d147

Browse files
committed
Merge dev branch
1 parent 789c8b4 commit 7c0d147

File tree

3,259 files changed

+441437
-9820
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,259 files changed

+441437
-9820
lines changed

.clang-format

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
AllowShortCaseLabelsOnASingleLine: false
2+
AllowShortFunctionsOnASingleLine: true
3+
AllowShortBlocksOnASingleLine: false
4+
AlwaysBreakTemplateDeclarations: true
5+
BinPackArguments: false
6+
BinPackParameters: false
7+
FixNamespaceComments: true
8+
IndentCaseLabels: true
9+
PenaltyReturnTypeOnItsOwnLine: 100
10+
PenaltyBreakBeforeFirstCallParameter: 10000
11+
SortIncludes: false
12+
SpaceAfterCStyleCast: false

.flake8

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
ignore=E111

.github/workflows/ccpp.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ name: ci
22
on: [push]
33
jobs:
44
ci:
5-
runs-on: ubuntu-18.04
5+
runs-on: ubuntu-20.04
66
steps:
77
- uses: actions/checkout@master
8+
89
- name: install dependencies
9-
run: make deps
10-
- name: build
10+
run: sudo make deps
11+
12+
- name: build yac
13+
run: sudo make lib
14+
15+
- name: build yac_ros
1116
run: make release
12-
- name: download test data
13-
run: sudo make download_test_data
17+
1418
- name: run tests
1519
run: make tests

.gitignore

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
build
22
tags
33

4-
deps/bin
5-
deps/include
6-
deps/lib
7-
deps/share
84
deps/*.log
9-
deps/src/apriltag3/build
10-
deps/src/apriltags/build
11-
deps/src/ceres-solver
12-
deps/src/SuiteSparse
5+
*.mp4
6+
.catkin_tools/

.style.yapf

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[style]
2+
based_on_style = google
3+
column_limit = 80
4+
indent_width = 2
5+
blank_line_before_nested_class_or_def = 0

Dockerfile

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:18.04
1+
FROM ros:noetic-perception-focal
22

33
SHELL ["/bin/bash", "-c"]
44
ENV HOME /root
@@ -11,7 +11,9 @@ RUN apt-get update && apt-get install -qq -y \
1111
build-essential \
1212
git \
1313
cmake \
14-
vim
14+
vim \
15+
python3-catkin-tools \
16+
python3-osrf-pycommon
1517

1618
# yac over to home
1719
WORKDIR $HOME
@@ -21,4 +23,5 @@ COPY ./ yac
2123
# build yac
2224
WORKDIR $HOME/yac
2325
RUN make deps
24-
RUN make release
26+
RUN make lib
27+
RUN source /opt/ros/noetic/setup.bash && make release

Makefile

+78-33
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,94 @@
11
SHELL:=/bin/bash
2-
CATKIN_WS=${HOME}/catkin_ws
2+
PREFIX=/opt/yac
3+
BUILD_DIR=build
4+
CATKIN_WS=${HOME}/yac_ws
35
YAC_PATH=${CATKIN_WS}/src/yac
6+
ROS_VERSION="noetic"
7+
NUM_CPU=2
48

5-
default: release
6-
.PHONY: deps release debug
9+
.PHONY: help deps lib_debug lib debug release download_test_data tests
710

8-
${YAC_PATH}:
9-
ln -sf ${PWD} ${CATKIN_WS}/src/yac
11+
define compile_yac
12+
@cd ${BUILD_DIR} \
13+
&& cmake ../yac \
14+
-DCMAKE_BUILD_TYPE=$(1) \
15+
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
16+
&& time sudo make install -s -j${NUM_CPU}
17+
endef
18+
19+
define compile_yac_ros
20+
@cd ${CATKIN_WS} \
21+
&& . /opt/ros/${ROS_VERSION}/setup.sh \
22+
&& catkin build yac_ros -DCMAKE_BUILD_TYPE=Release -j${NUM_CPU}
23+
endef
24+
25+
help:
26+
@echo -e "\033[1;34m[make targets]:\033[0m"
27+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
28+
| awk 'BEGIN {FS = ":.*?## "}; \
29+
{printf "\033[1;36m%-20s\033[0m%s\n", $$1, $$2}'
30+
31+
${BUILD_DIR}:
32+
@sudo mkdir -p ${BUILD_DIR}
33+
34+
${PREFIX}:
35+
@sudo mkdir -p ${PREFIX}
1036

1137
${CATKIN_WS}:
1238
@mkdir -p ${CATKIN_WS}/src; catkin init
1339

14-
deps:
40+
${YAC_PATH}:
41+
ln -sf ${PWD} ${CATKIN_WS}/src/yac
42+
43+
deps: ## Install dependencies
1544
@echo "[Installing Dependencies]"
16-
@sudo bash ./scripts/deps/install.bash
1745
@make -s -C deps
1846

19-
lib: ${CATKIN_WS} ${YAC_PATH}
20-
@cd ${CATKIN_WS} && \
21-
. /opt/ros/melodic/setup.sh && \
22-
catkin build yac -DCMAKE_BUILD_TYPE=RelWithDebInfo -j2
23-
24-
lib_debug: ${CATKIN_WS} ${YAC_PATH}
25-
@cd ${CATKIN_WS} && \
26-
. /opt/ros/melodic/setup.sh && \
27-
catkin build yac -DCMAKE_BUILD_TYPE=Debug -j2
47+
lib_debug: ${BUILD_DIR} ${PREFIX} ## Build libyac in debug mode
48+
$(call compile_yac,Debug)
2849

29-
release: ${CATKIN_WS} ${YAC_PATH}
30-
@cd ${CATKIN_WS} && \
31-
. /opt/ros/melodic/setup.sh && \
32-
catkin build yac yac_ros -DCMAKE_BUILD_TYPE=Release -j2
50+
lib_relwithdeb: ${BUILD_DIR} ${PREFIX} ## Build libyac in release with debug info
51+
$(call compile_yac,RelWithDebInfo)
3352

34-
debug: ${CATKIN_WS} ${YAC_PATH}
35-
@cd ${CATKIN_WS} && \
36-
. /opt/ros/melodic/setup.sh && \
37-
catkin build yac yac_ros -DCMAKE_BUILD_TYPE=Debug -j2
53+
lib: ${BUILD_DIR} ${PREFIX} ## Build libyac in release mode
54+
$(call compile_yac,Release)
3855

39-
download_test_data:
56+
download_test_data: ## Download test data
4057
@bash ./scripts/download_test_data.bash
4158

42-
tests:
43-
@. /opt/ros/melodic/setup.sh && \
44-
source ${CATKIN_WS}/devel/setup.bash && \
45-
rosrun yac test_aprilgrid && \
46-
rosrun yac test_calib_data && \
47-
rosrun yac test_calib_mocap && \
48-
rosrun yac test_calib_mono && \
49-
rosrun yac test_calib_stereo
59+
tests: ## Build and run tests
60+
@cd build \
61+
&& ./test_util_config \
62+
&& ./test_util_cv \
63+
&& ./test_util_data \
64+
&& ./test_util_fs \
65+
&& ./test_util_net \
66+
&& ./test_util_timeline \
67+
&& ./test_calib_camera \
68+
&& ./test_calib_data \
69+
&& ./test_calib_mocap \
70+
&& ./test_calib_vi
71+
72+
debug: ${CATKIN_WS} ${YAC_PATH} ## Build libyac and yac_ros in debug mode
73+
$(call compile_yac_ros,Debug)
74+
75+
relwithdeb: ${CATKIN_WS} ${YAC_PATH} ## Build libyac and yac_ros in release with debug info
76+
$(call compile_yac_ros,RelWithDebInfo)
77+
78+
release: ${CATKIN_WS} ${YAC_PATH} ## Build libyac and yac_ros in release mode
79+
$(call compile_yac_ros,Release)
80+
81+
build_docker:
82+
sudo rm -rf build \
83+
&& sudo rm -rf deps/src/apriltags3/build \
84+
&& docker build -t chutsu/yac .
85+
86+
run_docker:
87+
@xhost +local:docker
88+
@docker run -e DISPLAY \
89+
-v /tmp/.X11-unix:/tmp/.X11-unix \
90+
-v /data:/data \
91+
--network="host" \
92+
-it \
93+
--rm chutsu/yac
94+

0 commit comments

Comments
 (0)