diff --git a/desktop_config/change-gdm-background b/desktop_config/change-gdm-background new file mode 100755 index 0000000000000000000000000000000000000000..0b0f3207bb84ae5413fb7fecc7e6ecdb3f1355b3 --- /dev/null +++ b/desktop_config/change-gdm-background @@ -0,0 +1,215 @@ +#!/usr/bin/env bash +# Autor: Thiago Silva +# Contact: thiagos.dasilva@gmail.com +# URL: https://github.com/thiggy01/change-gdm-background +# =================================================================== # + +# Check if script is run by root. +if [ "$(id -u)" -ne 0 ] ; then + echo 'This script must be run as root or with the sudo command.' + exit 1 +fi + +# Check what linux distro is being used. +distro="$(lsb_release -c | cut -f 2)" +if ! [[ "$distro" =~ (focal|groovy|hirsute) ]]; then + echo 'Sorry, this script only works with focal, groovy or hirsute distros.' + exit 1 +fi + +# Check if glib 2.0 development libraries are installed. +if [ ! -x "$(command -v glib-compile-resources)" ]; then + echo 'Additional glib 2.0 libraries need to be installed.' + read -p 'Type y or Y to proceed. Any other key to exit: ' -n 1 + if [[ "$REPLY" =~ ^[yY]$ ]]; then + apt install libglib2.0-dev-bin + else + echo "This tool can't run without required libraries" + echo "Exiting." + echo + exit 1 + fi +fi + +# Assign the default gdm theme file path. +if [ "$(lsb_release -i | awk '{print $3}')" == 'Ubuntu' ]; then + gdm3Resource=/usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource +elif [ "$(lsb_release -i | awk '{print $3}')" == 'Pop' ]; then + gdm3Resource=/usr/share/gnome-shell/theme/Pop/gnome-shell-theme.gresource +fi + +# Create a backup file of the original theme if there isn't one. +[ ! -f "$gdm3Resource"~ ] && cp "$gdm3Resource" "$gdm3Resource~" + +# Restore backup function. +restore () { +mv "$gdm3Resource~" "$gdm3Resource" +if [ "$?" -eq 0 ]; then + chmod 644 "$gdm3Resource" + echo 'GDM background sucessfully restored.' + read -p 'Do you want to restart gdm to apply change? (y/n):' -n 1 + echo + if [[ "$REPLY" =~ ^[yY]$ ]]; then + service gdm restart + else + echo 'Restart GDM service to apply change.' + exit 0 + fi +fi +} + +# Restore the original gdm3 theme. +[ "$1" == "--restore" ] && restore + +#Define main variables. +gdm3xml=$(basename "$gdm3Resource").xml +workDir="/tmp/gdm3-theme" + +# Create directories from resource list. +CreateDirs() { +for resource in `gresource list "$gdm3Resource~"`; do + resource="${resource#\/org\/gnome\/shell\/}" + if [ ! -d "$workDir"/"${resource%/*}" ]; then + mkdir -p "$workDir"/"${resource%/*}" + fi +done +} + +# Extract resources from binary file. +ExtractRes() { +for resource in `gresource list "$gdm3Resource~"`; do + gresource extract "$gdm3Resource~" "$resource" > \ + "$workDir"/"${resource#\/org\/gnome\/shell\/}" +done +} + +# Compile resources into a gresource binary file. +CompileRes() { +glib-compile-resources --sourcedir=$workDir/theme/ $workDir/theme/"$gdm3xml" +} + +# Moves the newly created resource to its default place. +MoveRes() { +mv $workDir/theme/gnome-shell-theme.gresource $gdm3Resource +} + +# Check if gresource was sucessfuly moved to its default folder. +Check() { +if [ "$?" -eq 0 ]; then +# Solve a permission change issue (thanks to @huepf from github). + chmod 644 "$gdm3Resource" + echo 'GDM background sucessfully changed.' + read -p 'Do you want to restart gdm to apply change? (y/n):' -n 1 + echo + # If change was successful apply ask for gdm restart. + if [[ "$REPLY" =~ ^[yY]$ ]]; then + service gdm restart + else + echo "Change will be applied only after restarting gdm" + echo + fi +else + # If something went wrong, restore backup file. + echo 'something went wrong.' + restore + echo 'No changes were applied.' +fi +} + +CleanUp() { + # Remove temporary directories and files. + rm -r "$workDir" + exit 0 +} + +# Test if argument is an image file. +if [[ $(file --mime-type -b "$1") == image/*g ]]; then + + # Define image variables. + gdmBgImg=$(realpath "$1") + imgFile=$(basename "$gdmBgImg") + + # Call procedures to create directories and extract resources to them. + CreateDirs + ExtractRes + + # Copy selected image to the resources directory. + cp "$gdmBgImg" "$workDir"/theme + + # Change gdm background to the image you submited. + oldBg="#lockDialogGroup \{.*?\}" + newBg="#lockDialogGroup { + background: url('resource:\/\/\/org\/gnome\/shell\/theme\/$imgFile'); + background-size: cover; }" + perl -i -0777 -pe "s/$oldBg/$newBg/s" "$workDir"/theme/gdm3.css + + # Generate gresource xml file. + echo '<?xml version="1.0" encoding="UTF-8"?> +<gresources> + <gresource prefix="/org/gnome/shell/theme">' > "$workDir"/theme/"$gdm3xml" + for file in `gresource list "$gdm3Resource~"`; do + echo " <file>${file#\/org\/gnome/shell\/theme\/}</file>" \ + >> "$workDir"/theme/"$gdm3xml" + done + echo " <file>$imgFile</file>" >> "$workDir"/theme/"$gdm3xml" + echo ' </gresource> +</gresources>' >> "$workDir"/theme/"$gdm3xml" + + # Compile the new gresource. + CompileRes + + # Move gresource to the default place. + MoveRes + + # Check if everything was successful. + Check + + # Remove temporary files and exit. + CleanUp + +# Change background colors. +elif [[ "$1" =~ ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ ]]; then + + # Store selected background color. + BgColor="$1" + + CreateDirs + ExtractRes + + # Change gdm background to the color you submited. + oldBg="#lockDialogGroup \{.*?\}" + newBg="#lockDialogGroup { + background: $BgColor; + background-size: cover; }" + perl -i -0777 -pe "s/$oldBg/$newBg/s" "$workDir"/theme/gdm3.css + + # Generate the gresource xml file. + echo '<?xml version="1.0" encoding="UTF-8"?> +<gresources> + <gresource prefix="/org/gnome/shell/theme">' > "$workDir"/theme/"$gdm3xml" + for file in `gresource list "$gdm3Resource~"`; do + echo " <file>${file#\/org\/gnome/shell\/theme\/}</file>" \ + >> "$workDir"/theme/"$gdm3xml" + done + echo ' </gresource> +</gresources>' >> "$workDir"/theme/"$gdm3xml" + + # Compile the new gresource. + CompileRes + + # Move gresource to the default place. + MoveRes + + # Remove temporary files and exit. + CleanUp + +else + + # If no file was submited or file submited isn't an image, + # show this message. + echo 'Image file not found or wrong color hex code.' + echo 'Please, submit a .jpg or .png image file or a valid hex code.' + echo 'Usage: sudo ./ubuntu-20.04-change-gdm-background /path/to/image.*g' + echo 'Usage: sudo ./ubuntu-20.04-change-gdm-background \#yourhexcode' + +fi diff --git a/desktop_config/powerlevel10k/fonts/MesloLGS NF Bold Italic.ttf b/desktop_config/powerlevel10k/fonts/MesloLGS NF Bold Italic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..be059c0cb6815e8f63b99809040c1fc0b70ffdef Binary files /dev/null and b/desktop_config/powerlevel10k/fonts/MesloLGS NF Bold Italic.ttf differ diff --git a/desktop_config/powerlevel10k/fonts/MesloLGS NF Bold.ttf b/desktop_config/powerlevel10k/fonts/MesloLGS NF Bold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..6142dd042c3d38e757f648f7a2864c73c158257f Binary files /dev/null and b/desktop_config/powerlevel10k/fonts/MesloLGS NF Bold.ttf differ diff --git a/desktop_config/powerlevel10k/fonts/MesloLGS NF Italic.ttf b/desktop_config/powerlevel10k/fonts/MesloLGS NF Italic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..90ca569664d9ad469fd82c9a2b2673c05400af77 Binary files /dev/null and b/desktop_config/powerlevel10k/fonts/MesloLGS NF Italic.ttf differ diff --git a/desktop_config/powerlevel10k/fonts/MesloLGS NF Regular.ttf b/desktop_config/powerlevel10k/fonts/MesloLGS NF Regular.ttf new file mode 100644 index 0000000000000000000000000000000000000000..e9e4de5fb0c771853d123da3c872b188caab3340 Binary files /dev/null and b/desktop_config/powerlevel10k/fonts/MesloLGS NF Regular.ttf differ diff --git a/desktop_config/srcs_list.txt b/desktop_config/srcs_list.txt new file mode 100644 index 0000000000000000000000000000000000000000..cb2e1600f2e409517ddf387e238af33ce8b8db32 --- /dev/null +++ b/desktop_config/srcs_list.txt @@ -0,0 +1,57 @@ +checkingplaneitor +git@git.code.tecnalia.com:unai.antero/checkingplaneitor.git + +gdm-tools +https://github.com/realmazharhussain/gdm-tools.git + +pdfmixtool +git@gitlab.com:scarpetta/pdfmixtool.git + +plymouth-theme +https://github.com/pop-os/plymouth-theme.git + +pop-fonts +https://github.com/pop-os/fonts.git + +pop-theme +https://github.com/pop-os/gtk-theme + +vortex-ubuntu-plymouth-theme +https://github.com/emanuele-scarsella/vortex-ubuntu-plymouth-theme.git + +disk-usage-space +https://github.com/anfemosa/disk-usage-space.git + +roscon_2015 +https://github.com/ros-industrial-consortium/roscon_2015.git + +roscon_workshop_2021 +https://github.com/ros-industrial-consortium/roscon_workshop_2021 + +ros_tutorial +https://github.com/anfemosa/ros_tutorial.git + +bat +https://github.com/sharkdp/bat.git + +iscan-bundle +https://support.epson.net/linux/en/iscan_c.php?version=2.30.4 + +lsd +https://github.com/Peltoche/lsd.git + +powerlevel10k +https://github.com/mattmc3/antidote +https://phuctm97.com/blog/zsh-antigen-ohmyzsh +https://github.com/romkatv/powerlevel10k +https://github.com/zsh-users +https://github.com/mattmc3/zdotdir + +Antidote +git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-~}/.antidote + +zsh-you-shuould-use +https://github.com/MichaelAquilina/zsh-you-should-use.git + +git@git.code.tecnalia.com:miguel.prada/rosem.git +git@git.code.tecnalia.com:miguel.prada/gitlab_templates.git diff --git a/neurondones/README.md b/neurondones/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fe5cfd02abb7fc1444ebc267af129b47bddbfc6d --- /dev/null +++ b/neurondones/README.md @@ -0,0 +1,36 @@ +# ROS Development Environment + +Docker file to generate docker images for neurondones project. + +## Prerequisites + +### Rocker + +[**rocker**](https://github.com/osrf/rocker) is a tool to run docker images with customized local support injected for things like nvidia video cards support. + +#### rocker installation + +```bash +sudo apt-get install python3-rocker +``` + +#### OYR (off-your-rocker) pluging for rocker + +[**OYR**](https://github.com/sloretz/off-your-rocker) is a plugin for rocker that allows to run docker images with extra parameteers and configurations. +In this project OYR is used to launch a docker container with a named volume, not supported by rocker. + +```bash +pip3 install git+https://github.com/sloretz/off-your-rocker.git +``` + +## Build image + +```bash +docker build -t neurondones:noetic --build-arg ROS_DISTRO=noetic -f neurondones.Dockerfile . +``` + +## Launch container + +```bash +rocker --home --ssh --git --user --privileged --nvidia --volume /dev:/dev --x11 --network host --name neurondones neurondones:noetic bash +``` diff --git a/neurondones/extra_libs/noetic_libs.txt b/neurondones/extra_libs/noetic_libs.txt new file mode 100644 index 0000000000000000000000000000000000000000..3dd61a51c2e6e67035fb79b82234f387d06b955b --- /dev/null +++ b/neurondones/extra_libs/noetic_libs.txt @@ -0,0 +1,7 @@ +# Lits of the particular libs to install in noetic docker image +#libk4a1.4_1.4.1_amd64.deb +https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4a1.4/libk4a1.4_1.4.1_amd64.deb +#libk4a1.4-dev_1.4.1_amd64.deb +https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4a1.4-dev/libk4a1.4-dev_1.4.1_amd64.deb +#k4a-tools_1.4.1_amd64.deb +https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/k/k4a-tools/k4a-tools_1.4.1_amd64.deb diff --git a/neurondones/neurondones.Dockerfile b/neurondones/neurondones.Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..cd3d465bb313a5e74d5b6317d2fc66e9b8f0593a --- /dev/null +++ b/neurondones/neurondones.Dockerfile @@ -0,0 +1,128 @@ +ARG ROS_DISTRO +FROM osrf/ros:${ROS_DISTRO}-desktop-full + +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive + +# Import the key in order to be able to use the packages from the repository +# RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7E72C5B4111A50084C63C9489E7A9B1D990CF897 +# NOV - 2023 +RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B63CF8FDE49746E98FA01DDAD19BAB3CBF125EA + +# Setup environment +RUN apt-get update && apt-get install -y apt-utils + +RUN apt-get install -y \ + locales \ + && sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + +# Configure apt and install ubuntu-base packages +RUN apt-get update && \ + apt-get -y install --no-install-recommends \ + apt-transport-https \ + ca-certificates \ + curl \ + dbus-x11 \ + gnupg-agent \ + software-properties-common \ + dialog 2>&1 \ + checkinstall \ + # clang + clang-format clang-tidy clang-tools clang \ + libc++-dev libc++1 libc++abi-dev \ + libc++abi1 libclang-dev libclang1 \ + libomp-dev libomp5 lld lldb \ + llvm-dev llvm-runtime llvm \ + # ccmake + cmake-curses-gui \ + direnv \ + gawk \ + gdb \ + git \ + git-lfs \ + less \ + nano \ + net-tools \ + openssh-client \ + trash-cli \ + valgrind \ + wget \ + xterm + +# Install pip3 and packages +RUN apt-get install -y \ + python3-pip \ + && pip3 install sqlite_utils \ + && pip3 install transforms3d + +# Install conan for Kortex driver +RUN if [ "$ROS_DISTRO" = "noetic" ]; \ + then \ + pip3 install conan==1.59 \ + && conan config set general.revisions_enabled=1 \ + && conan profile new default --detect > /dev/null \ + && conan profile update settings.compiler=gcc default; \ + fi + +# Copy the requirements.txt file into the container +WORKDIR /tmp/dependencies/ +COPY /ws_dependencies/* ./ + +# Install the packages listed in ${ROS_DISTRO}_requirements.txt +RUN if [ -f "${ROS_DISTRO}_requirements.txt" ]; \ + then \ + apt-get update && \ + awk '/^# APT-GET PACKAGES/,/^# PIP PACKAGES/' ${ROS_DISTRO}_requirements.txt | grep -v '^#' | xargs apt-get install -y && \ + apt-get clean; \ + fi + +# Install pip packages +RUN if [ -f "${ROS_DISTRO}_requirements.txt" ]; \ + then \ + awk '/^# PIP PACKAGES/,0' ${ROS_DISTRO}_requirements.txt | grep -v '^#' | xargs -r -n1 pip install ;\ + fi + +RUN rm -rf * + +# Install extra libs from .deb files +WORKDIR /tmp/srcs/ +COPY /extra_libs/* ./ + +# Workaround for Azure Kinect +RUN if [ "$ROS_DISTRO" = "noetic" ]; \ + then \ + echo 'libk4a1.4 libk4a1.4/accepted-eula-hash string 0f5d5c5de396e4fee4c0753a21fee0c1ed726cf0316204edda484f08cb266d76' | debconf-set-selections \ + && echo 'libk4abt1.0 libk4abt1.0/accepted-eula-hash string 03a13b63730639eeb6626d24fd45cf25131ee8e8e0df3f1b63f552269b176e38' | debconf-set-selections \ + && wget https://raw.githubusercontent.com/microsoft/Azure-Kinect-Sensor-SDK/develop/scripts/99-k4a.rules \ + && mkdir -p udev/rules.d \ + && mv 99-k4a.rules udev/rules.d/ \ + && cp --parents udev/rules.d/99-k4a.rules /etc; \ + fi + +# Extra libs, e.g. vtk-7.1_20221201-1_amd64.deb +RUN if [ -f "${ROS_DISTRO}_libs.txt" ]; \ + then \ + grep -v '^#' ${ROS_DISTRO}_libs.txt | xargs wget \ + && dpkg -i *.deb;\ + fi + +RUN rm -rf * + +# Update this date to re-run the image final update +LABEL image.date=09-01-2024 + +# Set entrypoint +COPY ./ros_entrypoint.sh / +RUN chmod a+x /ros_entrypoint.sh + +ENV ROS_DISTRO "${ROS_DISTRO}" + +ENV RUNNING_IN_DOCKER true + +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND= + +ENTRYPOINT ["/ros_entrypoint.sh"] \ No newline at end of file diff --git a/neurondones/ros_entrypoint.sh b/neurondones/ros_entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a33870bfda3926a3ed362adef2bcd9b91791c8b --- /dev/null +++ b/neurondones/ros_entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# Setup ros environment +source "/opt/ros/$ROS_DISTRO/setup.bash" +exec "$@" \ No newline at end of file diff --git a/neurondones/ws_dependencies/noetic_requirements.txt b/neurondones/ws_dependencies/noetic_requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..6b448ad1c8ad3b36180ae1a8d398b436e5c46f1b --- /dev/null +++ b/neurondones/ws_dependencies/noetic_requirements.txt @@ -0,0 +1,47 @@ +# APT-GET PACKAGES +# Base +python3-catkin-tools +ipython3 +python-is-python3 +python3-click +python3-numpy +python3-osrf-pycommon +python3-vcstool +python3-pip +clangd +liblldb-dev +libllvm-ocaml-dev +python3-clang +ros-noetic-catkin +ros-noetic-plotjuggler +ros-noetic-plotjuggler-ros +ros-noetic-rosmon +ros-noetic-rqt-controller-manager +ros-noetic-rqt-joint-trajectory-controller +ros-noetic-code-coverage +# Neurondones +ros-noetic-libpcan +ros-noetic-moveit-ros-move-group +ros-noetic-moveit-fake-controller-manager +ros-noetic-moveit-kinematics +ros-noetic-moveit-planners-ompl +ros-noetic-moveit-ros-visualization +ros-noetic-moveit-setup-assistant +ros-noetic-ros-control +ros-noetic-ros-controllers +ros-noetic-moveit-ros-planning-interface +ros-noetic-moveit-commander +ros-noetic-moveit-planners +ros-noetic-moveit-simple-controller-manager +ros-noetic-moveit-ros-control-interface +ros-noetic-moveit-msgs +ros-noetic-ros-control-boilerplate +ros-noetic-joy +ros-noetic-spacenav-node +spacenavd +# -- vision +libgflags-dev +libsoundio1 +ros-noetic-aruco-ros +# PIP PACKAGES +# EOF \ No newline at end of file