diff --git a/deploy_config/ISR.Dockerfile b/deploy_config/ISR.Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..64c500f4e53a44506de1b46d8c135f7572d66dfd --- /dev/null +++ b/deploy_config/ISR.Dockerfile @@ -0,0 +1,101 @@ +FROM nvidia/cuda:11.3.0-base-ubuntu16.04 + +WORKDIR /root/ws +ENV ROS_DISTRO melodic + +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + +# nvidia-container-runtime +ENV NVIDIA_VISIBLE_DEVICES \ + ${NVIDIA_VISIBLE_DEVICES:-all} +ENV NVIDIA_DRIVER_CAPABILITIES \ + ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics + +# install basic packages +RUN apt-get update && apt-get install -q -y --no-install-recommends \ + dirmngr \ + gnupg2 \ + lsb-release \ + sudo \ + ocl-icd-libopencl1 \ + clinfo \ + && rm -rf /var/lib/apt/lists/* + +RUN mkdir -p /etc/OpenCL/vendors && \ + echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd + +# Setup environment +RUN apt-get update && 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 + +# Setup sources.list +RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' +RUN apt-get -y install --no-install-recommends \ + curl +RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - + +RUN apt-get update && apt-get install -y \ + ros-kinetic-desktop-full + +# Configure apt and install packages +RUN apt-get -y install --no-install-recommends \ + apt-transport-https \ + ca-certificates \ + software-properties-common \ + gnupg-agent \ + apt-utils dialog 2>&1 \ + git \ + nano \ + less \ + iproute2 \ + procps \ + lsb-release \ + curl \ + cmake \ + openssh-client \ + python-catkin-tools \ + python-osrf-pycommon \ + python-rosdep \ + python-rosinstall \ + python-rosinstall-generator \ + python-wstool \ + build-essential \ + ros-${ROS_DISTRO}-rosmon \ + xterm \ + wget \ + clinfo \ + && rm -rf /var/lib/apt/lists/* + +# Add private sources +ARG ARTIFACT_CI_USER +ARG ARTIFACT_CI_TOKEN +ARG ARTIFACT_DEBIAN_KEY_ID +RUN \ + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys "${ARTIFACT_DEBIAN_KEY_ID}" && \ + echo "deb https://${ARTIFACT_CI_USER}:${ARTIFACT_CI_TOKEN}@artifact.tecnalia.com/artifactory/tecnalia-robotics-debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/tecnalia.list && \ + # Add the private rosdep mapping yaml + rosdep init || true && \ + echo "yaml https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/rosdistro/rosdep_tecnalia.yaml" >> /etc/ros/rosdep/sources.list.d/10-tecnalia.list + +# 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 + +# Configure rosdep +RUN rosdep init || true +RUN sh -c "echo 'yaml https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/rosdistro/rosdep_tecnalia.yaml' \ + >> /etc/ros/rosdep/sources.list.d/20-default.list" +RUN rosdep update --include-eol-distros --rosdistro ${ROS_DISTRO} + +RUN mkdir -p /ws/src && \ + cd /ws/src + +COPY . /ws/src/iiwa_state_recorder/ + +CMD ["bash"] + +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND= \ No newline at end of file diff --git a/deploy_config/README.md b/deploy_config/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2a1901feb52e86c7c3296312a69d4d539815eddb --- /dev/null +++ b/deploy_config/README.md @@ -0,0 +1,56 @@ +# IIWA state recorder + +* Download the [iiwa_state_recorder package](https://git.code.tecnalia.com/tecnalia_robotics/kuka_sunrise/iiwa_state_recorder.git): + + ```bash + mkdir -p ~/ros/melodic/iiwa_ws/src + cd ~/ros/melodic/iiwa_ws/src + git clone git@git.code.tecnalia.com:tecnalia_robotics/kuka_sunrise/iiwa_state_recorder.git + ``` + +* Install the additional ros packages using .rosinstall: + + ```bash + cd ~/ros/melodic/iiwa_ws/src + + wstool init + wstool merge iiwa_state_recorder/.rosinstall + wstool update + rosdep install -iy --from-paths . + + catkin build + ``` + +## Docker image + +Command to build the docker image to work on a host with Ubuntu 20.04: + +```bash +docker build -t iiwa_simulator --build-arg USER_API_KEY_ARTIFACTS_TECNALIA="$(cat ~/.ssh/user_api_key_artifacts_tecnalia)" -f ISR.Dockerfile . +``` + +<!-- Testing ddeploy +Using [ddeploy](https://git.code.tecnalia.com/tecnalia_robotics/flexbotics/flexbotics_utils/ddeploy) + +ddeploy --name scan_and_plan_nvidia --distro kinetic -b tecnalia-robotics-docker.artifact.tecnalia.com/flexbotics-base-nvidia-devel:kinetic -s . --keep-source +Generates: clinfo error + +ddeploy --name scan_and_plan_nvidia_cuda --distro kinetic -b nvidia/cuda:11.3.0-base-ubuntu16.04 -s . --keep-sources +Generate: Missing sources etc... +--> + +Command to launch the docker image using [rocker](https://github.com/osrf/rocker) + +```bash +rocker --privileged --devices /dev/bus/usb --nvidia --x11 --home --git --ssh <docker_image> +``` + +<!-- If --user flag is passed as argument when the container is launched with rocker then sudo privileged is required to access to the Zivid camera. --> + +Commands to launch the demo: + +```bash +source /opt/ros/melodic/setup.bash +source ~/ros/melodic/iiwa_ws/devel/setup.bash +roslaunch iiwa_state_recorder iiwa_simulator.launch +``` diff --git a/deploy_config/build_docker.bash b/deploy_config/build_docker.bash new file mode 100644 index 0000000000000000000000000000000000000000..ff90a76e4a1888e86a50002a97dc6db32ad04673 --- /dev/null +++ b/deploy_config/build_docker.bash @@ -0,0 +1,60 @@ +#!/bin/bash + +set -e # To fail on errors + +DIR_THIS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +deploy_distro=${1:-melodic} +python_version=${2:-python} +docker_tag=${3:-untagged} +project_url=${4:-https://git.code.tecnalia.com} +image_version=${5:-local_build} +image_revision=${6:-local_build} + +echo "$ARTIFACT_DEBIAN_KEY_ID" > /tmp/additional_apt_keys +echo "deb https://${ARTIFACT_CI_USER}:${ARTIFACT_CI_TOKEN}@artifact.tecnalia.com/artifactory/tecnalia-robotics-debian xenial main" > /tmp/additional_apt_sources +echo "yaml https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/rosdistro/rosdep_tecnalia.yaml" > /tmp/additional_rosdeps +echo "https://$ARTIFACT_CI_USER:$ARTIFACT_CI_TOKEN@artifact.tecnalia.com" > /tmp/git_credentials +echo "$SSH_PRIVATE_KEY" > /tmp/ssh_key +echo "$SSH_SERVER_HOSTKEYS" > /tmp/ssh_hostkeys + +cd "${DIR_THIS}"/.. + +# shellcheck disable=SC2046 +DOCKER_BUILDKIT=1 docker build \ + --progress=plain \ + --secret id=additional_apt_keys,src=/tmp/additional_apt_keys \ + --secret id=additional_apt_sources,src=/tmp/additional_apt_sources \ + --secret id=additional_rosdeps,src=/tmp/additional_rosdeps \ + --build-arg BASE_IMAGE="nvidia/cuda:11.3.0-base-ubuntu16.04" \ + --secret id=git_credentials,src=/tmp/git_credentials \ + --build-arg PROJECT_NAME=iiwa_state_recorder \ + --build-arg ROS_DISTRO="$deploy_distro" \ + --secret id=ssh_key,src=/tmp/ssh_key \ + --secret id=ssh_hostkeys,src=/tmp/ssh_hostkeys \ + --build-arg PYTHON_VERSION="$python_version" \ + --build-arg USERNAME=deployuser \ + --build-arg UID=1000 \ + --build-arg GID=1000 \ + --build-arg ENTRY_COMMAND="roslaunch iiwa_state_recorder iiwa_simulator.launch" \ + --label "org.opencontainers.image.created=$(date --rfc-3339=seconds)" \ + --label "org.opencontainers.image.url=$project_url" \ + --label "org.opencontainers.image.version=$image_version" \ + --label "org.opencontainers.image.revision=$image_revision" \ + --label "org.opencontainers.image.vendor=TECNALIA" \ + --label "org.opencontainers.image.licenses=TECNALIA" \ + $(printf "%s" "$deploy_distro") \ + -t "iiwa_state_recorder:$docker_tag" . + +ret=$? + +rm /tmp/additional_apt_keys +rm /tmp/additional_apt_sources +rm /tmp/additional_rosdeps +rm /tmp/git_credentials +rm /tmp/ssh_key +rm /tmp/ssh_hostkeys + +cd - + +exit $ret diff --git a/deploy_config/iiwa_state_recorder.ddeploy.yaml b/deploy_config/iiwa_state_recorder.ddeploy.yaml new file mode 100644 index 0000000000000000000000000000000000000000..debb36fa563f3bb45366398842c68115c7866b27 --- /dev/null +++ b/deploy_config/iiwa_state_recorder.ddeploy.yaml @@ -0,0 +1,10 @@ +project_name: iiwa_state_recorder +ros_distro: melodic +project_sources: + - ./iiwa_state_recorder.rosinstall +vcs_workers: 1 +cmd: roslaunch iiwa_state_recorder iiwa_simulator_deploy.launch +after_script: apt-get update && apt-get install -y curl + && curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - + && apt-get install -y nodejs && npm -g install yarn + && bash -c "source /ros_entrypoint.sh && find /opt/ros/ -name 'build_ui.bash' -exec bash {} \;" diff --git a/deploy_config/iiwa_state_recorder.rosinstall b/deploy_config/iiwa_state_recorder.rosinstall new file mode 100644 index 0000000000000000000000000000000000000000..357c911f22af00ed2566c896d1cfe7bf79e3f37c --- /dev/null +++ b/deploy_config/iiwa_state_recorder.rosinstall @@ -0,0 +1,95 @@ +- git: + local-name: algebra_libraries + uri: 'git@git.code.tecnalia.com:tecnalia_robotics/algebra_libraries.git' + version: melodic-devel +- git: + local-name: cartesian_trajectory_analyser + uri: 'git@git.code.tecnalia.com:tecnalia_robotics/kuka_sunrise/cartesian_trajectory_analyser.git' + version: melodic-devel +- git: + local-name: flexbotics_robots_iiwa + uri: 'git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/flexbotics_robots/flexbotics_robots_iiwa.git' + version: master +- git: + local-name: gl_depth_sim + uri: https://github.com/Jmeyer1292/gl_depth_sim.git + version: master +- git: + local-name: iiwa_native_controller + uri: 'git@git.code.tecnalia.com:tecnalia_robotics/kuka_sunrise/iiwa_native_controller.git' + version: melodic-devel +- git: + local-name: iiwa_skill_manager + uri: 'git@git.code.tecnalia.com:tecnalia_robotics/kuka_sunrise/iiwa_skill_manager.git' + version: melodic-devel +- git: + local-name: iiwa_stack + uri: 'https://github.com/tecnalia-advancedmanufacturing-robotics/iiwa_stack.git' + version: master +- git: + local-name: iiwa_state_recorder + uri: 'git@git.code.tecnalia.com:tecnalia_robotics/kuka_sunrise/iiwa_state_recorder.git' + version: melodic-devel +- git: + local-name: manipulation + uri: 'git@git.code.tecnalia.com:tecnalia_robotics/manipulation.git' + version: kinetic-devel +- git: + local-name: manipulator_commander_compliant + uri: 'git@git.code.tecnalia.com:tecnalia_robotics/manipulator_commander_compliant.git' + version: melodic-devel +- git: + local-name: manipulator_commander_iiwa + uri: 'git@git.code.tecnalia.com:tecnalia_robotics/manipulator_commander_iiwa.git' + version: melodic-devel +- git: + local-name: vision_libraries + uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/vision/vision_libraries.git + version: melodic-devel +- git: + local-name: vision_libraries_additionals_tools + uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/vision/vision_libraries_additionals_tools.git + version: melodic-devel +- git: + local-name: vision_libraries_external_api + uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/vision/vision_libraries_external_api.git + version: melodic-devel +- git: + local-name: vision_object_detection_plugins + uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/vision/vision_object_detection_plugins.git + version: melodic-devel +# Packages for intergration with robouton demo +- git: + local-name: sherlock_ui + uri: git@git.code.tecnalia.com:tecnalia_robotics/sherlock/sherlock_ui.git + version: 8-add-dashboard-option +- git: + local-name: dummy_application + uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/flexbotics_test/dummy_application.git + version: main +- git: + local-name: move_base_navigation_skill + uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/flexbotics_skill_library/robot_mobility/move_base_navigation_skill.git + version: master +# Packages from dummy_application +- git: + local-name: flexbotics_action_base_classes + uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/flexbotics_skill_library/flexbotics_action_base_classes.git + version: kinetic-devel +- git: + local-name: flexbotics_configuration_manager + uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/flexbotics_configuration_manager.git + version: kinetic-devel +- git: + local-name: flexbotics_execution_manager + uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics_execution_manager.git + version: noetic-devel +- git: + local-name: generic_simple_gui + uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/generic_simple_gui.git + version: noetic-devel +- git: + local-name: smach_tutorials + uri: https://github.com/rhaschke/executive_smach_tutorials + version: indigo-devel + diff --git a/deploy_config/ros_entrypoint.sh b/deploy_config/ros_entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..19a52705f0f55dcdb644f301c298ec55c5576806 --- /dev/null +++ b/deploy_config/ros_entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +# setup ros environment +# shellcheck source=/dev/null +. "/opt/ros/${ROS_DISTRO}-extra/setup.bash" +exec "$@" diff --git a/dockerfiles/DevenvMelodic.Dockerfile b/dockerfiles/DevenvMelodic.Dockerfile index 1c4abddc3016968699df43af95e7936ec46a954c..073f5ab4dde9d707c463fc15d706f8fd317f36e7 100644 --- a/dockerfiles/DevenvMelodic.Dockerfile +++ b/dockerfiles/DevenvMelodic.Dockerfile @@ -147,7 +147,6 @@ RUN apt-get install -y \ python3-gi-cairo \ python3-numpy \ python3-pip \ - python-pip \ graphviz \ xdot \ ros-melodic-image-view \ diff --git a/dockerfiles/DevenvMelodicFlexbotics.Dockerfile b/dockerfiles/DevenvMelodicFlexbotics.Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..648c46dea42732a74708d59b55b6034896c6f7e3 --- /dev/null +++ b/dockerfiles/DevenvMelodicFlexbotics.Dockerfile @@ -0,0 +1,101 @@ +ARG FROM_IMAGE_BUILDER=tecnalia-robotics-docker.artifact.tecnalia.com/flexbotics-base-devel:melodic +ARG FROM_IMAGE_CATCHER=osrf/ros:melodic-desktop-full +ARG OVERLAY_WS=/opt/ros/remodel_app_ws + +FROM $FROM_IMAGE_CATCHER AS cacher + +################################# +# Add ssh private key +# Setup environment +RUN apt-get update && apt-get install -y \ + ssh \ + 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 + +ARG SSH_PRIVATE_KEY +RUN mkdir ~/.ssh/ +RUN echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa +RUN chmod 600 ~/.ssh/id_rsa +RUN ssh-keyscan git.code.tecnalia.com >> /root/.ssh/known_hosts && chmod 644 /root/.ssh/known_hosts + +# Configure system to look for debian packages in the Artifactory repository +ARG USER_API_KEY_ARTIFACTS_TECNALIA +RUN sh -c "echo \ + 'deb https://${USER_API_KEY_ARTIFACTS_TECNALIA}@artifact.tecnalia.com/artifactory/tecnalia-robotics-debian xenial main' \ + >> /etc/apt/sources.list.d/tecnalia.list" + +# 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 + +# Configure rosdep +RUN sh -c "echo 'yaml https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/rosdistro/rosdep_tecnalia.yaml' \ + >> /etc/ros/rosdep/sources.list.d/20-default.list" + +# clone overlay source +ARG OVERLAY_WS +WORKDIR $OVERLAY_WS/src +RUN git clone git@git.code.tecnalia.com:tecnalia_robotics/remodel/remodel_app.git +RUN cd remodel_app && git checkout real-testing +RUN cp remodel_app/.rosinstall . +RUN wstool update + +# copy manifests for caching +WORKDIR /opt +RUN mkdir -p /tmp/opt && \ + find ./ -name "package.xml" | \ + xargs cp --parents -t /tmp/opt && \ + find ./ -name "CATKIN_IGNORE" | \ + xargs cp --parents -t /tmp/opt || true + +# multi-stage for building +FROM $FROM_IMAGE_BUILDER AS builder + +ENV ROS_DISTRO melodic +ENV RUNNING_IN_DOCKER true + +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive + +# install overlay dependencies +# finish rosdep command with true because some dependencies are not found +ARG OVERLAY_WS +WORKDIR $OVERLAY_WS +COPY --from=cacher /tmp/$OVERLAY_WS/src ./src +RUN rosdep update +RUN . /opt/ros/$ROS_DISTRO/setup.sh && \ + apt-get update && rosdep install -y \ + --from-paths \ + src \ + --ignore-src \ + || true \ + && rm -rf /var/lib/apt/lists/* + +# build overlay source +COPY --from=cacher $OVERLAY_WS/src ./src +RUN . /opt/ros/$ROS_DISTRO/setup.sh \ + && catkin config \ + --extend /opt/ros/"$ROS_DISTRO" \ + --install \ + --cmake-args -DCMAKE_BUILD_TYPE=Release \ + && catkin build \ + --summarize + +# install python3 dependencies +RUN apt-get update && apt-get install -y \ + python3-pip + +RUN pip3 install sqlite_utils + +# Set entrypoint +COPY ./ros_entrypoint.sh / +RUN chmod a+x /ros_entrypoint.sh + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["zsh"] +ENV SHELL /usr/bin/zsh + +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND= diff --git a/dotfiles/.gitconfig b/dotfiles/.gitconfig index df0f3f4bcbc4ea117ae5f48b00d155e8a052110a..c1ed3323b8ed69bb56e86e189cf1dcf03934b8dc 100644 --- a/dotfiles/.gitconfig +++ b/dotfiles/.gitconfig @@ -7,4 +7,4 @@ name = Andres Montano email = andres.montano@tecnalia.com [credential] - helper = "!f() { /home/andres/.vscode-server/bin/da76f93349a72022ca4670c1b84860304616aaa2/node /tmp/vscode-remote-containers-5a60cb1da759d14ee4cea752b3a5b9093efdb2c8.js $*; }; f" + helper = cache --timeout=3600 diff --git a/dotfiles/.zshrc b/dotfiles/.zshrc index d7b6aa4e12361411a20d58040115fab52042425b..9631ebe176f475fe113b37e1c3446b4043332454 100644 --- a/dotfiles/.zshrc +++ b/dotfiles/.zshrc @@ -11,40 +11,13 @@ export PATH=$HOME/.local/bin:$PATH # Path to your oh-my-zsh installation. export ZSH="/home/andres/.oh-my-zsh" -# Use modern completion system -# autoload -Uz compinit -# compinit - -# zstyle ':completion:*' auto-description 'specify: %d' -# zstyle ':completion:*' completer _expand _complete _correct _approximate -# zstyle ':completion:*' format 'Completing %d' -# zstyle ':completion:*' group-name '' -# zstyle ':completion:*' menu select=2 -# eval "$(dircolors -b)" -# zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} -# zstyle ':completion:*' list-colors '' -# zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s -# zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' -# zstyle ':completion:*' menu select=long -# zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s -# zstyle ':completion:*' use-compctl false -# zstyle ':completion:*' verbose true -# zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' -# zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd' - # Set name of the theme to load --- if set to "random", it will # load a random theme each time oh-my-zsh is loaded, in which case, # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes -#ZSH_THEME="robbyrussell" -#ZSH_THEME="avit" -#ZSH_THEME="dst" -#ZSH_THEME="bira" -#ZSH_THEME="agnoster" ZSH_THEME="powerlevel10k/powerlevel10k" # Set up the prompt - autoload -Uz promptinit promptinit prompt adam1 @@ -52,12 +25,6 @@ prompt adam1 setopt histignorealldups # sharehistory setopt no_share_history -# Set list of themes to pick from when loading at random -# Setting this variable when ZSH_THEME=random will cause zsh to load -# a theme from this variable instead of looking in $ZSH/themes/ -# If set to an empty array, this variable will have no effect. -# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) - # Uncomment the following line to enable command auto-correction. ENABLE_CORRECTION="true" @@ -80,7 +47,7 @@ HIST_STAMPS="dd/mm/yyyy" # Custom plugins may be added to $ZSH_CUSTOM/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(sudo git last-working-dir zsh-syntax-highlighting globalias zsh-autosuggestions ) #history-substring-search +plugins=(zsh-syntax-highlighting sudo git last-working-dir globalias you-should-use zsh-autosuggestions history-substring-search) source $ZSH/oh-my-zsh.sh @@ -104,6 +71,7 @@ source ${HOME}/srcs/development_environment/dotfiles/system.bash eval "$(direnv hook zsh)" +# Add fuzzy search app [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. @@ -112,4 +80,3 @@ eval "$(direnv hook zsh)" # Finalize Powerlevel10k instant prompt. Should stay at the bottom of ~/.zshrc. (( ! ${+functions[p10k-instant-prompt-finalize]} )) || p10k-instant-prompt-finalize - diff --git a/dotfiles/docker.bash b/dotfiles/docker.bash index b4a068c2ddb15dc8fa57b67541544de39094dddc..dfd71c599dc8509af64f35937cfaa7693b140184 100644 --- a/dotfiles/docker.bash +++ b/dotfiles/docker.bash @@ -1,6 +1,6 @@ # Poining to pip venv # alias rocker="~/.venv/rocker/bin/rocker" -alias ddeploy="~/.venv/ddeploy/bin/ddeploy" +# alias ddeploy="~/.venv/ddeploy/bin/ddeploy" # docker common commands alias dim="docker images" @@ -20,6 +20,10 @@ function dsr() { docker stop $1;docker rm $1 } +function runremodel() { + rocker --x11 --nvidia --privileged --network=host --name remodel_docker --oyr-run-arg " -v iiwa_state_recorder:/home/remodel/iiwa_state_recorder -v /home/andres/test/remodel_shared:/home/remodel/remodel_shared" -- remodel_app:melodic bash -c "'roslaunch remodel_app remodel_app.launch use_sim:=true docker:=true skill_manager:=true collision_detector:=true ui:=true cad:=true joystick:=false'" +} + function rundoc() { rocker --home --user --nvidia --pulse --x11 --ssh --git --volume /dev/video0:/dev/video0 --privileged --name melodic --network host devenv:melodic $1 } @@ -60,6 +64,10 @@ function datnoetic() { docker exec -it noetic -c "cd ~/ros/noetic/$1 && $ext" } +function datremodel() { + docker exec -it remodel_docker bash +} + function datkinetic() { docker exec -it kinetic -c "cd ~/ros/kinetic/$1 && $ext" } diff --git a/dotfiles/ros.bash b/dotfiles/ros.bash index 553744ad111d920a28f98e34b2d686b8e89e775c..e38d40282428e95dfa1f481d130a71ad9d52148b 100644 --- a/dotfiles/ros.bash +++ b/dotfiles/ros.bash @@ -3,7 +3,7 @@ ################################################################### # Define ROS_DISTRO before source ROS -# if [ -z $ROS_DISTRO ]; then export ROS_DISTRO=noetic; fi +if [ -z $ROS_DISTRO ]; then export ROS_DISTRO=noetic; fi # Determine shell extension if [ -z $SHELL ]; then echo "SHELL not set"; else ext=$(basename ${SHELL}); fi @@ -55,15 +55,15 @@ function cib(){ } # If terminal starts in a ws, auto source it (useful for vscode) -#pwd_init=${PWD} -#cropped=${PWD#${HOME}/ros/${ROS_DISTRO}/} -#WS_name=${cropped%%/*} -#WS_path=${HOME}/ros/${ROS_DISTRO}/${WS_name} -#FILE=${WS_path}/devel/setup.${ext} -#if [[ -f $FILE ]]; then -# cd ${WS_path} -# source $FILE -# cd ${pwd_init} -#else -# source /opt/ros/${ROS_DISTRO}/setup.${ext} -#fi +pwd_init=${PWD} +cropped=${PWD#${HOME}/ros/${ROS_DISTRO}/} +WS_name=${cropped%%/*} +WS_path=${HOME}/ros/${ROS_DISTRO}/${WS_name} +FILE=${WS_path}/devel/setup.${ext} +if [[ -f $FILE ]]; then + cd ${WS_path} + source $FILE + cd ${pwd_init} +else + source /opt/ros/${ROS_DISTRO}/setup.${ext} +fi diff --git a/dotfiles/system.bash b/dotfiles/system.bash index aa045a799d25d2d24ae37ea692e9b5b2b28b3ee9..3972e99b05c5afcda29d079998c9b43e1968ada5 100644 --- a/dotfiles/system.bash +++ b/dotfiles/system.bash @@ -16,6 +16,9 @@ then fi # Python -alias ipy='ipython' +if command -v ipython &> /dev/null +then + alias ipy='ipython' +fi alias mountT='sudo mount -t cifs //tri.lan/tri /mnt/T --verbose -o username=110343,password=FarrukMontano\#8657,workgroup=TRI.LAN' diff --git a/srcs_list.txt b/srcs_list.txt index 05b748b27fb0dd4b15007abaf66a7e27ccead428..ffc1bd7436935ba2614a954825e37b8ef30d05bd 100644 --- a/srcs_list.txt +++ b/srcs_list.txt @@ -1,3 +1,6 @@ +checkingplaneitor +git@git.code.tecnalia.com:unai.antero/checkingplaneitor.git + gdm-tools https://github.com/realmazharhussain/gdm-tools.git @@ -19,8 +22,6 @@ https://github.com/emanuele-scarsella/vortex-ubuntu-plymouth-theme.git disk-usage-space https://github.com/anfemosa/disk-usage-space.git -powerlevel10k - roscon_2015 https://github.com/ros-industrial-consortium/roscon_2015.git @@ -38,3 +39,16 @@ 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