#!/bin/bash set -e host=$(cat /etc/hostname) echo "127.0.0.1 $host" | sudo tee -a /etc/hosts > /dev/null 2>1 sudo chown $UID:$UID $XDG_RUNTIME_DIR chmod 700 $XDG_RUNTIME_DIR export WORKSPACE_DIR="\$HOME/uuv/ros2" export UNDERLAY_DIR="\$HOME/uuv/ros2_underlay" echo "alias build_ros=\"env -i HOME=\$HOME USER=\$USER TERM=xterm-256color bash -l -c 'source $UNDERLAY_DIR/install/setup.bash && cd $WORKSPACE_DIR && colcon build --symlink-install --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON'\"" >> ~/.zshrc echo "alias build_underlay=\"env -i HOME=\$HOME USER=\$USER TERM=xterm-256color bash -l -c 'source /opt/ros/$ROS_DISTR/setup.bash && cd $UNDERLAY_DIR && colcon build'\"" >> ~/.zshrc echo "alias rosdep-ros2=\"env -i HOME=\$HOME USER=\$USER TERM=xterm-256color UNDERLAY_DIR=\$UNDERLAY_DIR bash -l -c 'source \$UNDERLAY_DIR/install/setup.bash && cd $WORKSPACE_DIR && rosdep install --from-paths src -y --ignore-src'\"" >> ~/.zshrc echo "alias rosdep-underlay=\"env -i UNDERLAY_DIR=\$UNDERLAY_DIR HOME=\$HOME USER=\$USER TERM=xterm-256color bash -l -c 'source /opt/ros/$ROS_DISTR/setup.bash && cd $UNDERLAY_DIR && rosdep install --from-paths src -y --ignore-src'\"" >> ~/.zshrc echo 'source $HOME/uuv/ros2_underlay/install/setup.zsh' >> ~/.zshrc echo 'source $HOME/uuv/ros2/install/local_setup.zsh' >> ~/.zshrc echo 'export RCUTILS_COLORIZED_OUTPUT=1' >> ~/.zshrc echo 'eval "$(register-python-argcomplete ros2)"' >> ~/.zshrc echo 'eval "$(register-python-argcomplete colcon)"' >> ~/.zshrc echo 'eval "$(register-python-argcomplete build-ros)"' >> ~/.zshrc echo 'eval "$(register-python-argcomplete clean-ros)"' >> ~/.zshrc echo "bindkey '^ ' autosuggest-toggle" >> ~/.zshrc # required to make the daemon/CLI work properly # might be fixed in ros jazzy according to https://github.com/ros2/ros2/issues/1531 ulimit -n 1024 exec $@