-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_microros.sh
executable file
·45 lines (35 loc) · 1.08 KB
/
install_microros.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
#!/bin/bash
#set -x
set -e
if [ -z ${ROS_DISTRO} ]; then
echo ROS_DISTRO not set
exit -1
fi
board=esp32
if [ -n "${1}" ]; then
board=$1
fi
tmpname=`readlink -f $0`
prgdir=`dirname $tmpname`
# Source the ROS 2 installation
source /opt/ros/$ROS_DISTRO/setup.bash
# Create a workspace and download the micro-ROS tools
mkdir -p microros_ws
cd microros_ws
[ -d src/micro_ros_setup ] || git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup
pushd src/micro_ros_setup
for x in $prgdir/micro_ros_setup/* ; do
echo "`pwd` patch -p 1 < $x"
patch -p 1 < $x
done
popd
# Update dependencies using rosdep
echo put this back sudo apt update && rosdep update
rosdep install --from-paths src --ignore-src -y
# Install pip
echo put this back sudo apt-get install python3-pip
# Build micro-ROS tools and source them
colcon build
source install/local_setup.bash
ros2 run micro_ros_setup create_firmware_ws.sh zephyr $board 2>&1 | tee /tmp/microros-zephyr-$board.log
$prgdir/patch_microros.sh ${board} 2>&1 | tee /tmp/microros-zephyr-$board-patches.log