-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
67 lines (54 loc) · 1.89 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Usage: make [command]
SHELL:=/bin/bash
WORKSPACE=$(shell pwd)
.PHONY: build # to avoid error
build:
source /opt/ros/noetic/setup.bash &&\
export CC=clang-11 && export CXX=clang++-11 &&\
catkin build --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O2"
clean:
rm -r build devel logs .catkin_tools
install_deps: # install packages which are not supported by rosdep
apt update && apt install -y \
psmisc clang-11
setup_docker:
docker build -t noetic_image:latest -f docker/Dockerfile . --no-cache
exec_docker:
docker exec -it noetic_container /bin/bash
run_rocker:
rocker --x11 --user --network host --privileged --nocleanup --volume .:/home/$(shell whoami)/mppi_swerve_drive_ros --name noetic_container noetic_image:latest
run_docker:
@if [ "$(shell docker inspect --format='{{.State.Status}}' noetic_container)" = "running" ]; then \
$(MAKE) exec_docker; \
elif [ "$(shell docker inspect --format='{{.State.Status}}' noetic_container)" = "exited" ]; then \
docker start noetic_container; \
if [$? -eq 0]; then \
$(MAKE) exec_docker; \
else \
docker rm noetic_container; \
$(MAKE) run_rocker; \
fi; \
else \
$(MAKE) run_rocker; \
fi
# record rosbag (all topics)
record:
cd ${WORKSPACE}/rosbag; rosbag record -a
# play rosbag
## [shell 1] make play
## [shell 2] rosbag play rosbag/xxx.bag
play:
source /opt/ros/noetic/setup.bash && source ./devel/setup.bash &&\
roslaunch launch/rosbag_play.launch workspace:=${WORKSPACE}
# gazebo_world.launch
gazebo_world:
source /opt/ros/noetic/setup.bash && source ./devel/setup.bash &&\
roslaunch launch/gazebo_world.launch
# gmapping.launch
gmapping:
source /opt/ros/noetic/setup.bash && source ./devel/setup.bash &&\
roslaunch launch/gmapping.launch workspace:=${WORKSPACE}
# navigation.launch
navigation:
source /opt/ros/noetic/setup.bash && source ./devel/setup.bash &&\
roslaunch launch/navigation.launch workspace:=${WORKSPACE}