Skip to content

Commit a65428a

Browse files
authored
Merge pull request cggos#33 from cggos/develop
Develop
2 parents a7dafae + a250d1a commit a65428a

File tree

4 files changed

+132
-13
lines changed

4 files changed

+132
-13
lines changed

CMakeLists.txt

+28-13
Original file line numberDiff line numberDiff line change
@@ -180,18 +180,19 @@ target_link_libraries(imu_vo_map_node ${catkin_LIBRARIES} ${OpenCV_LIBS} ${CERES
180180
# all install targets should use catkin DESTINATION variables
181181
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
182182

183-
## Mark executable scripts (Python etc.) for installation
184-
## in contrast to setup.py, you can choose the destination
185-
# install(PROGRAMS
186-
# scripts/my_python_script
187-
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
188-
# )
183+
# Mark executable scripts (Python etc.) for installation
184+
# in contrast to setup.py, you can choose the destination
185+
install(PROGRAMS
186+
scripts/folium_csv.py
187+
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
188+
)
189189

190-
## Mark executables for installation
191-
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
192-
# install(TARGETS ${PROJECT_NAME}_node
193-
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
194-
# )
190+
# Mark executables for installation
191+
# See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
192+
install(TARGETS
193+
imu_gnss_ekf_node imu_vo_ekf_node imu_vo_ukf_node imu_vo_map_node
194+
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
195+
)
195196

196197
## Mark libraries for installation
197198
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
@@ -201,13 +202,27 @@ target_link_libraries(imu_vo_map_node ${catkin_LIBRARIES} ${OpenCV_LIBS} ${CERES
201202
# RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
202203
# )
203204

204-
## Mark cpp header files for installation
205-
# install(DIRECTORY include/${PROJECT_NAME}/
205+
# # Mark cpp header files for installation
206+
# install(DIRECTORY include/common/
206207
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
207208
# FILES_MATCHING PATTERN "*.h"
208209
# PATTERN ".svn" EXCLUDE
209210
# )
210211

212+
install(DIRECTORY
213+
include/common
214+
include/estimator
215+
include/fusion
216+
include/sensor
217+
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}/../
218+
)
219+
220+
install(DIRECTORY
221+
config
222+
launch
223+
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
224+
)
225+
211226
## Mark other files for installation (e.g. launch and bag files, etc.)
212227
# install(FILES
213228
# # myfile1

scripts/docker/Dockerfile

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This is an auto generated Dockerfile for ros:robot
2+
# generated from docker_images/create_ros_image.Dockerfile.em
3+
FROM ros:melodic-ros-base-bionic
4+
5+
# Set the working directory to /root
6+
ENV DIRPATH /root
7+
WORKDIR $DIRPATH
8+
9+
# install ros packages
10+
RUN apt-get update && apt-get install -y ros-melodic-robot=1.4.1-0*
11+
# && rm -rf /var/lib/apt/lists/*
12+
13+
RUN apt install -y ros-melodic-nmea-navsat-driver libgeographic-dev
14+
15+
RUN apt install -y git cmake wget python-catkin-tools
16+
17+
RUN apt install -y libopencv-dev
18+
19+
# # Install OpenCV for Ubuntu 18.04
20+
# RUN apt-get update && apt-get install -y \
21+
# build-essential cmake unzip pkg-config \
22+
# libjpeg-dev libpng-dev libtiff-dev \
23+
# libvtk6-dev \
24+
# libgtk-3-dev \
25+
# libatlas-base-dev gfortran
26+
#
27+
# RUN git clone https://github.com/opencv/opencv.git
28+
# RUN cd opencv && \
29+
# git checkout tags/3.3.1 && \
30+
# mkdir build -j$(nproc)
31+
#
32+
# RUN git clone https://github.com/opencv/opencv_contrib.git
33+
# RUN cd opencv_contrib && \
34+
# git checkout tags/3.3.1
35+
#
36+
# RUN cd opencv/build && \
37+
# cmake -DCMAKE_BUILD_TYPE=Release \
38+
# -DCMAKE_INSTALL_PREFIX=/usr/local \
39+
# -D BUILD_opencv_python=OFF \
40+
# -D BUILD_opencv_python2=OFF \
41+
# -D BUILD_opencv_python3=OFF \
42+
# -DOPENCV_EXTRA_MODULES_PATH=$DIRPATH/opencv_contrib/modules .. && \
43+
# make -j$(nproc) install
44+
45+
RUN apt install -y libeigen3-dev libgoogle-glog-dev libgflags-dev libatlas-base-dev libsuitesparse-dev
46+
47+
RUN cd $DIRPATH
48+
RUN wget http://ceres-solver.org/ceres-solver-2.1.0.tar.gz && tar xvzf ceres-solver-2.1.0.tar.gz && \
49+
cd ceres-solver-2.1.0 && mkdir build && cd build && cmake .. && make install -j$(nproc)
50+
51+
ENV TERM xterm
52+
ENV PYTHONIOENCODING UTF-8
53+
54+
RUN cd $DIRPATH
55+
56+
# dataset
57+
RUN mkdir $DIRPATH/dataset
58+
RUN wget -P $DIRPATH/dataset https://cggos.i234.me:5001/fsdownload/wYejg2zlD/orbslam2_v101easy.bag
59+
60+
RUN mkdir -p $DIRPATH/ws_msf/src
61+
RUN git clone https://github.com/cggos/imu_x_fusion.git $DIRPATH/ws_msf/src/imu_x_fusion
62+
WORKDIR $DIRPATH/ws_msf
63+
RUN catkin config --extend /opt/ros/$ROS_DISTRO --cmake-args -DCMAKE_BUILD_TYPE=Release && \
64+
catkin build -j4 && \
65+
sed -i '/exec "$@"/i \
66+
source "/root/ws_msf/devel/setup.bash"' /ros_entrypoint.sh
67+
# RUN source $DIRPATH/ws_msf/devel/setup.bash

scripts/docker/build.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
sudo docker build -t imu_x_fusion -f ./scripts/docker/Dockerfile .

scripts/docker/run.sh

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
trap : SIGTERM SIGINT
3+
4+
roscore &
5+
ROSCORE_PID=$!
6+
sleep 1
7+
8+
rviz -d ../../rviz/imu_vo_fusion.rviz &
9+
RVIZ_PID=$!
10+
11+
docker run \
12+
-it \
13+
--rm \
14+
--net=host \
15+
-v /root/ws_msf/src/imu_x_fusion/ \
16+
/bin/bash -c \
17+
"cd /root/ws_msf/; \
18+
catkin config \
19+
--env-cache \
20+
--extend /opt/ros/$ROS_DISTRO \
21+
--cmake-args \
22+
-DCMAKE_BUILD_TYPE=Release; \
23+
catkin build; \
24+
source devel/setup.bash; \
25+
roslaunch imu_x_fusion imu_vo_fusion.launch est:=ekf"
26+
27+
wait $ROSCORE_PID
28+
wait $RVIZ_PID
29+
30+
if [[ $? -gt 128 ]]
31+
then
32+
kill $ROSCORE_PID
33+
kill $RVIZ_PID
34+
fi

0 commit comments

Comments
 (0)