-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstruction.sh
166 lines (116 loc) · 4.53 KB
/
instruction.sh
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
###############################################################################
#Dependecies
sudo apt install default-jre
git clone --recurse-submodules https://github.com/ardupilot/Micro-XRCE-DDS-Gen.git
cd Micro-XRCE-DDS-Gen
./gradlew assemble
-------------------------------------------
#Add the following line to .bashrc file and source
gedit ~/.bashrc
export PATH=$PATH:~/Micro-XRCE-DDS-Gen/scripts
source ~/.bashrc
-------------------------------------------
sudo apt-get update
sudo apt-get install git
sudo apt-get install gitk git-gui
sudo apt-get install gcc-arm-none-eabi
###############################################################################
#Ardupilot
git clone https://github.com/ArduPilot/ardupilot.git
cd ardupilot
git submodule update --init --recursive
git status
./waf distclean
./waf distclean
./waf configure --board MatekF405-Wing
./waf plane
-------------------------------------------
#If fail, please try:
git submodule init
git submodule update
./waf configure --board MatekF405-Wing
./waf clean
./waf distclean
./waf configure --board MatekF405-Wing
-------------------------------------------
###############################################################################
#ROS2
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws
vcs import --recursive --input https://raw.githubusercontent.com/ArduPilot/ardupilot/master/Tools/ros2/ros2.repos src
cd ~/ros2_ws
sudo apt update
rosdep update
source /opt/ros/humble/setup.bash
rosdep install --from-paths src --ignore-src
#build workspace
cd ~/ros2_ws
colcon build --packages-up-to ardupilot_dds_tests
------------------------------------------------------------------------------
#If the build fails, when you request help, please re-run the build in verbose mode like so:
colcon build --packages-up-to ardupilot_dds_tests --event-handlers=console_cohesion+
------------------------------------------------------------------------------
#test
cd ~/ros2_ws
source ./install/setup.bash
colcon test --packages-select ardupilot_dds_tests
colcon test-result --all --verbose
#SITL
cd ~/ardupilot
git pull
Tools/environment_install/install-prereqs-ubuntu.sh -y #
#./waf clean
./waf configure --board sitl
./waf copter -v
cd ~/ardupilot/Tools/autotest
sudo pip3 install MAVProxy
mavproxy.py --version
-------------------------------------------
#Add the following line to .bashrc file and source
gedit ~/.bashrc
export PATH=$PATH:/path/to/mavproxy
source ~/.bashrc
-------------------------------------------
------------------------------------------------------------------------
#####TESTING
#Run the following commands to test SITL with different options
./sim_vehicle.py -v ArduCopter -w
./sim_vehicle.py -v ArduCopter --console --map
./sim_vehicle.py -v ArduCopter -L KSFO --console --map
./sim_vehicle.py -v ArduPlane -f quadplane --console --map --osd
./sim_vehicle.py -v ArduCopter -f quadcopter --console --map --osd
------------------------------------------------------------------------
#ROS2 with SITL
source /opt/ros/humble/setup.bash
cd ~/ros2_ws/
colcon build --packages-up-to ardupilot_sitl
source ~/ros2_ws/install/setup.bash
###TESTING
ros2 launch ardupilot_sitl sitl_dds_udp.launch.py transport:=udp4 refs:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/dds_xrce_profile.xml synthetic_clock:=True wipe:=False model:=quad speedup:=1 slave:=0 instance:=0 defaults:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/copter.parm,$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/dds_udp.parm sim_address:=127.0.0.1 master:=tcp:127.0.0.1:5760 sitl:=127.0.0.1:5501
#ROS2 with SITL in GAZEBO
cd ~/ros2_ws
vcs import --input https://raw.githubusercontent.com/ArduPilot/ardupilot_gz/main/ros2_gz.repos --recursive src
-------------------------------------------
#Add the following line to .bashrc file and source
gedit ~/.bashrc
export GZ_VERSION=harmonic
source ~/.bashrc
-------------------------------------------
cd ~/ros2_ws
source /opt/ros/humble/setup.bash
sudo apt update
rosdep update
rosdep install -y --from-paths src --ignore-src -r
cd ~/ros2_ws
colcon build --packages-up-to ardupilot_gz_bringup
cd ~/ros2_ws
source install/setup.bash
colcon test --packages-select ardupilot_sitl ardupilot_dds_tests ardupilot_gazebo ardupilot_gz_applications ardupilot_gz_description ardupilot_gz_gazebo ardupilot_gz_bringup
colcon test-result --all --verbose
##TESING
#Terminal-1
cd ~/ros2_ws
source install/setup.bash
ros2 launch ardupilot_gz_bringup iris_runway.launch.py
#Terminal-2
mavproxy.py --console --map --aircraft test --master=:14550