-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·63 lines (53 loc) · 1.48 KB
/
setup.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
#!/bin/bash
#set -x
set -e
unset AMENT_PREFIX_PATH
export ROS_DISTRO=humble
# Choose only 1 board type:
#board=esp32_devkitc_wroom
#board=esp32c3_devkitm
board=rpi_pico_w
app=ping_pong
while getopts "a:b:r:gh" OPTION; do
case $OPTION in
a)
app=$OPTARG
;;
b)
board=$OPTARG
;;
h)
echo "Usage: setup -a <app> -b <board>"
exit 0
;;
*)
echo "Usage: setup -a <app> -b <board>"
exit -1
;;
esac
done
echo Board: $board app: $app
tmpname=`readlink -f $0`
prgdir=`dirname $tmpname`
$prgdir/install_microros.sh ${board}
pushd microros_ws/firmware/zephyr_apps/apps
if [ ${board} = "rpi_pico_w" ]; then
git clone --recursive -b main https://github.com/beechwoods-software/zephyr-cyw43-driver
cp -r zephyr-cyw43-driver/drivers $app
cp -r zephyr-cyw43-driver/dts $app
cat zephyr-cyw43-driver/Kconfig >> $app/Kconfig
cat zephyr-cyw43-driver/CMakeLists.txt >> $app/CMakeLists.txt
fi
cp ~/local.conf $app
popd
pushd microros_ws/firmware/mcu_ws
popd
pushd microros_ws
source /opt/ros/$ROS_DISTRO/setup.bash
source install/local_setup.bash
ros2 run micro_ros_setup configure_firmware.sh $app --transport udp
ros2 run micro_ros_setup build_firmware.sh 2>&1 | tee /tmp/microros_build_zephyr_${board}.log
ros2 run micro_ros_setup create_agent_ws.sh
ros2 run micro_ros_setup build_agent.sh --cmake-args -Wno-dev
popd
echo "To Start the micro ros agent please run \"ros2 run micro_ros_agent micro_ros_agent udp4 -p 8888\""