├── .gitignore
├── .gitmodules
├── README.md
├── TODO.md
├── blender
├── blender2.79
│ └── Dockerfile
├── blender3.0
│ └── Dockerfile
├── blender4.4
│ └── Dockerfile
└── first_run.sh
├── composers
└── docker-compose.yml
├── dl
├── dl-cv
│ ├── c_vit_pose
│ │ ├── Dockerfile
│ │ └── first_run_cont.sh
│ ├── conda
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ └── first_run_cont.sh
│ ├── dream
│ │ ├── Dockerfile
│ │ ├── first_run.sh
│ │ └── to_copy
│ │ │ ├── aliases
│ │ │ ├── keyboard
│ │ │ ├── nanorc
│ │ │ ├── ranger
│ │ │ └── tmux
│ ├── hpe
│ │ ├── README.md
│ │ ├── alphapose
│ │ │ ├── Dockerfile
│ │ │ ├── README.md
│ │ │ └── first_run.sh
│ │ ├── openpose_arm
│ │ │ ├── Dockerfile
│ │ │ ├── README.md
│ │ │ └── first_run.sh
│ │ ├── openpose_x64
│ │ │ ├── Dockerfile
│ │ │ ├── Dockerfile.save
│ │ │ ├── README.md
│ │ │ ├── build_docker.sh
│ │ │ └── first_run.sh
│ │ ├── pytorch0.4
│ │ │ └── Dockerfile
│ │ └── pytorch1.7
│ │ │ ├── Dockerfile
│ │ │ └── first_run_cont.sh
│ └── ros2-tensorflow
│ │ ├── .gitignore
│ │ ├── CONTRIBUTING.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── data
│ │ └── detection.png
│ │ ├── docker
│ │ ├── Dockerfile
│ │ ├── build.sh
│ │ ├── run.sh
│ │ └── scripts
│ │ │ ├── build_opencv.sh
│ │ │ ├── coco
│ │ │ └── Makefile
│ │ │ └── label_map_util.patch
│ │ └── ros2-tensorflow
│ │ ├── ros2_tensorflow
│ │ ├── CHANGELOG.rst
│ │ ├── CMakeLists.txt
│ │ └── package.xml
│ │ ├── ros2_tf_core
│ │ ├── CHANGELOG.rst
│ │ ├── package.xml
│ │ ├── resource
│ │ │ └── ros2_tf_core
│ │ ├── ros2_tf_core
│ │ │ ├── __init__.py
│ │ │ ├── img_conversion.py
│ │ │ ├── models.py
│ │ │ ├── qos.py
│ │ │ └── tensorflow_node.py
│ │ ├── setup.cfg
│ │ ├── setup.py
│ │ └── test
│ │ │ ├── __init__.py
│ │ │ ├── ros2_tf_core
│ │ │ └── __init__,py
│ │ │ ├── test_copyright.py
│ │ │ ├── test_flake8.py
│ │ │ └── test_pep257.py
│ │ ├── tf_classification_py
│ │ ├── CHANGELOG.rst
│ │ ├── package.xml
│ │ ├── resource
│ │ │ └── tf_classification_py
│ │ ├── setup.cfg
│ │ ├── setup.py
│ │ ├── test
│ │ │ ├── __init__.py
│ │ │ ├── test_copyright.py
│ │ │ ├── test_flake8.py
│ │ │ └── test_pep257.py
│ │ └── tf_classification_py
│ │ │ ├── __init__.py
│ │ │ ├── classification_node.py
│ │ │ ├── examples
│ │ │ ├── __init__.py
│ │ │ ├── client_test.py
│ │ │ └── server.py
│ │ │ └── models.py
│ │ ├── tf_detection_py
│ │ ├── CHANGELOG.rst
│ │ ├── package.xml
│ │ ├── resource
│ │ │ └── tf_detection_py
│ │ ├── setup.cfg
│ │ ├── setup.py
│ │ ├── test
│ │ │ ├── __init__.py
│ │ │ ├── test_copyright.py
│ │ │ ├── test_flake8.py
│ │ │ └── test_pep257.py
│ │ └── tf_detection_py
│ │ │ ├── __init__.py
│ │ │ ├── detection_models.py
│ │ │ ├── detection_node.py
│ │ │ ├── examples
│ │ │ ├── __init__.py
│ │ │ ├── client_test.py
│ │ │ ├── face_detection.py
│ │ │ └── server.py
│ │ │ └── models.py
│ │ └── tf_interfaces
│ │ ├── CHANGELOG.rst
│ │ ├── CMakeLists.txt
│ │ ├── package.xml
│ │ └── srv
│ │ ├── ImageClassification.srv
│ │ └── ImageDetection.srv
└── dl-nlp
│ └── deepspeech
│ ├── Dockerfile
│ ├── README.md
│ ├── aplay_out.txt
│ ├── arecord_out.txt
│ ├── entrypoint.sh
│ ├── first_run.sh
│ ├── pa_stable_candidate_v190700_rc2_20210331.tgz
│ └── pulse-client.conf
├── ros
├── captoglove
│ ├── Dockerfile
│ ├── README.md
│ ├── configuration.sh
│ ├── docker_entrypoint.sh
│ └── first_run.sh
├── ros-kinetic
│ ├── base
│ │ └── Dockerfile
│ ├── dynamixel
│ │ ├── Dockerfile
│ │ └── first_run.sh
│ └── moveit_ros
│ │ ├── Dockerfile
│ │ ├── first_run.sh
│ │ └── install_nano.sh
├── ros-melodic
│ ├── darknet
│ │ ├── Dockerfile
│ │ └── first_run.sh
│ ├── dynamixel
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ └── first_run.sh
│ ├── hpe_ros
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── copy_ssh.sh
│ │ └── first_run.sh
│ ├── mmuav_audio_ros
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── entrypoint.sh
│ │ ├── first_run.sh
│ │ ├── pa_stable_candidate_v190700_rc2_20210331.tgz
│ │ └── pulse-client.conf
│ ├── mmuav_intel_ros
│ │ ├── Dockerfile
│ │ └── first_run.sh
│ ├── mmuav_ros
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ └── first_run.sh
│ ├── moveit_intel_ros
│ │ ├── Dockerfile
│ │ ├── first_run.sh
│ │ └── install_nano.sh
│ ├── moveit_ros
│ │ ├── Dockerfile
│ │ ├── first_run.sh
│ │ └── install_nano.sh
│ ├── moveit_schunk_ros
│ │ └── Dockerfile
│ ├── raspberryPi
│ │ └── README.txt
│ ├── realsense_ros
│ │ ├── Dockerfile
│ │ ├── Dockerfile.armv7
│ │ ├── README.md
│ │ └── first_run.sh
│ ├── schunk_lwa4p_ros
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ └── first_run.sh
│ ├── tcp_ip_comm
│ │ ├── .README.md.swp
│ │ ├── Dockerfile
│ │ └── first_run.sh
│ ├── tello
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ └── first_run.sh
│ ├── uam_ros_stack
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ └── first_run.sh
│ ├── uav_ros_stack
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ └── first_run.sh
│ └── virtual_uav_bag
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── entrypoint.sh
│ │ └── first_run.sh
└── ros-noetic
│ ├── bebop_autonomy
│ ├── Dockerfile
│ ├── README.md
│ ├── first_run.sh
│ └── keyboard
│ ├── for_course_lab
│ ├── or2223
│ │ ├── Dockerfile
│ │ ├── first_run.sh
│ │ └── to_copy
│ │ │ ├── aliases
│ │ │ ├── keyboard
│ │ │ ├── nanorc
│ │ │ ├── ranger
│ │ │ └── tmux
│ └── or2324
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── first_run.sh
│ │ └── to_copy
│ │ ├── aliases
│ │ ├── keyboard
│ │ ├── nanorc
│ │ ├── ranger
│ │ └── tmux
│ ├── moveit_ros
│ ├── Dockerfile
│ ├── Dockerfile.save
│ ├── first_run.sh
│ ├── keyboard
│ └── vimrc
│ ├── mrs_course_project
│ ├── Dockerfile
│ ├── first_run.sh
│ └── to_copy
│ │ ├── aliases
│ │ ├── keyboard
│ │ ├── nanorc
│ │ ├── ranger
│ │ └── tmux
│ ├── px4-sitl
│ ├── Dockerfile
│ └── keyboard
│ ├── realsense_ros
│ ├── Dockerfile
│ ├── README.md
│ └── first_run.sh
│ ├── speech-recog
│ ├── Dockerfile
│ ├── first_run.sh
│ └── pa_stable_candidate_v190700_rc2_20210331.tgz
│ ├── uam_ros_stack
│ ├── Dockerfile
│ ├── README.md
│ └── first_run.sh
│ ├── ur
│ ├── Dockerfile
│ ├── README.md
│ ├── docker_build.sh
│ ├── docker_run.sh
│ └── keyboard
│ └── watchplant_demo
│ ├── Dockerfile
│ ├── README.md
│ ├── first_run.sh
│ └── to_copy
│ ├── aliases
│ ├── keyboard
│ ├── nanorc
│ ├── ranger
│ ├── ros_setup
│ └── tmux
├── ros1ros2
└── ros-noetic-foxy
│ └── base_image
│ ├── Dockerfile
│ ├── README.md
│ ├── run_docker.sh
│ ├── start_docker.sh
│ └── to_copy
│ ├── aliases
│ ├── build_bridge.sh
│ ├── keyboard
│ ├── nanorc
│ ├── ranger
│ ├── run_bridge.sh
│ └── tmux
├── ros2
├── ros2-foxy
│ ├── Dockerfile
│ ├── README.md
│ ├── first_run.sh
│ └── to_copy
│ │ ├── aliases
│ │ ├── keyboard
│ │ ├── nanorc
│ │ ├── ranger
│ │ └── tmux
├── ros2-galactic
│ ├── Dockerfile
│ └── first_run.sh
├── ros2-humble
│ ├── crazyflies-sitl
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── first_run.sh
│ │ ├── install_ros.sh
│ │ └── to_copy
│ │ │ ├── 99-bitcraze.rules
│ │ │ ├── CMakeLists.txt
│ │ │ ├── _setup.sh
│ │ │ ├── aliases
│ │ │ ├── crazyflies.yaml
│ │ │ ├── keyboard
│ │ │ ├── nanorc
│ │ │ ├── ranger
│ │ │ ├── ros_comm.patch
│ │ │ ├── rosconsole.patch
│ │ │ ├── session.yml
│ │ │ ├── session_bridge.yml
│ │ │ ├── start.sh
│ │ │ └── tmux
│ ├── custom
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── run_docker.sh
│ │ ├── start_docker.sh
│ │ └── to_copy
│ │ │ ├── aliases
│ │ │ ├── keyboard
│ │ │ ├── nanorc
│ │ │ ├── ranger
│ │ │ └── tmux
│ ├── moveit2
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── run_docker.sh
│ │ └── to_copy
│ │ │ ├── aliases
│ │ │ ├── keyboard
│ │ │ ├── nanorc
│ │ │ ├── ranger
│ │ │ └── tmux
│ ├── official
│ │ ├── README.md
│ │ └── first_run.sh
│ ├── piper
│ │ ├── Dockerfile
│ │ ├── run_docker.sh
│ │ └── to_copy
│ │ │ ├── aliases
│ │ │ ├── keyboard
│ │ │ ├── nanorc
│ │ │ ├── ranger
│ │ │ └── tmux
│ ├── px4-sitl
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── px4_ros_start.yml
│ │ ├── run_docker.sh
│ │ └── to_copy
│ │ │ ├── aliases
│ │ │ ├── keyboard
│ │ │ ├── nanorc
│ │ │ ├── ranger
│ │ │ └── tmux
│ └── robots
│ │ ├── Dockerfile
│ │ ├── Dockerfile.save
│ │ ├── README.md
│ │ ├── run_docker.sh
│ │ └── to_copy
│ │ ├── aliases
│ │ ├── keyboard
│ │ ├── nanorc
│ │ ├── ranger
│ │ └── tmux
└── ros2-jazzy
│ └── crazyflies
│ ├── Dockerfile
│ ├── README.md
│ ├── first_run.sh
│ └── to_copy
│ ├── 99-bitcraze.rules
│ ├── 99-lps.rules
│ ├── _setup.sh
│ ├── aliases
│ ├── keyboard
│ ├── nanorc
│ ├── ranger
│ ├── session.yml
│ ├── start.sh
│ └── tmux
└── utils
├── README.md
├── assets
├── figure1.png
└── figure2.png
├── bash_scripts
├── control_tmuxinator.sh
├── copy_ssh.sh
├── first_run.sh
├── install_nano.sh
├── shell_scripts.sh
└── start_tmuxinator_n_times.sh
├── c_cpp_properties.json
└── tmuxinator_scripts
└── px4_ros_start.yml
/.gitignore:
--------------------------------------------------------------------------------
1 | # These are some examples of commonly ignored file patterns.
2 | # You should customize this list as applicable to your project.
3 | # Learn more about .gitignore:
4 | # https://www.atlassian.com/git/tutorials/saving-changes/gitignore
5 |
6 | # Node artifact files
7 | node_modules/
8 | dist/
9 |
10 | # Compiled Java class files
11 | *.class
12 |
13 | # Compiled Python bytecode
14 | *.py[cod]
15 |
16 | # Log files
17 | *.log
18 |
19 | # Package files
20 | *.jar
21 |
22 | # Maven
23 | target/
24 | dist/
25 |
26 | # JetBrains IDE
27 | .idea/
28 |
29 | # Unit test reports
30 | TEST*.xml
31 |
32 | # Generated by MacOS
33 | .DS_Store
34 |
35 | # Generated by Windows
36 | Thumbs.db
37 |
38 | # Applications
39 | *.app
40 | *.exe
41 | *.war
42 |
43 | # Large media files
44 | *.mp4
45 | *.tiff
46 | *.avi
47 | *.flv
48 | *.mov
49 | *.wmv
50 |
51 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "mbzirc"]
2 | path = mbzirc
3 | url = git@github.com:fzoric8/mbzirc.git
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # How to use this repo?
2 |
3 | As of May 2024, documentation has been migrated to the repository [wiki](https://github.com/larics/docker_files/wiki).
4 |
5 | ## Suggestions
6 |
7 | If you have any suggestions how to make this repository better, please don't hesitate to reach out to: `filip.zoric@fer.hr`,
8 | or raise an issue.
9 |
--------------------------------------------------------------------------------
/TODO.md:
--------------------------------------------------------------------------------
1 |
2 | ## TODO:
3 |
4 | - [x] Create example docker files with different hardware accelerations
5 | - [x] Create base images for ROS/Gazebo combinations (Kinetic/Gazebo9, Kinetic/Gazebo11, Melodic/Gazebo9, Melodic/Gazebo11)
6 | - [x] Add BUILD_ARGS -> ide for now
7 | - [x] Add image for decoupled NVIDIA + pytorch support for OpenPose
8 | - [x] Build base blende image
9 | - [x] Create intial compose
10 | - [x] Add cloning of Github repo with ssh keys - this [issue](https://github.com/moby/buildkit/issues/2315)
11 | - [x] Create init documentation
12 | - [x] Add branch protection
13 | - [ ] Refactor images to be multistage (production)
14 | - [ ] Build image with [GAZEBO gym](https://github.com/erlerobot/gym-gazebo)
15 | - [ ] Build image with [AirSim](https://microsoft.github.io/AirSim/docker_ubuntu/)
16 | - [ ] Check integration of Github actions for CI/CD
17 |
--------------------------------------------------------------------------------
/blender/blender2.79/Dockerfile:
--------------------------------------------------------------------------------
1 | # syntax=docker/dockerfile:1.3
2 | FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu18.04
3 | LABEL maintainer filip.zoric@fer.hr
4 |
5 | # Setup environment
6 | ENV LANG C.UTF-8
7 | ENV LC_AL C.UTF-8
8 | ENV DEBIAN_FRONTEND noninteractive
9 | ENV NVIDIA_VISIBLE_DEVICES all
10 | ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
11 |
12 | # Setup timezone (fix interactive package installation)
13 | RUN ln -snf /usr/share/zoneinfo*${TZ} /etc/localtime && echo ${TZ} >/etc/timezone
14 |
15 | RUN apt-get update && \
16 | apt-get install -y \
17 | curl \
18 | git \
19 | libfreetype6 \
20 | libglu1-mesa \
21 | libxi6 \
22 | libxrender1 \
23 | nano \
24 | sudo \
25 | xz-utils \
26 | wget
27 | # apt-get -y autoremove && \
28 | # rm -rf /var/lib/apt/lists/*
29 |
30 | ENV BLENDER_MAJOR 2.79
31 | ENV BLENDER_VERSION 2.79
32 | ENV BLENDER_URL https://download.blender.org/release/Blender${BLENDER_MAJOR}/blender-${BLENDER_VERSION}-linux-glibc219-x86_64.tar.bz2
33 |
34 | # https://github.com/luvres/blender
35 | # Index of blender releases
36 | #ENV BLENDER_URL https://download.blender.org/release/Blender${BLENDER_MAJOR}/blender-${BLENDER_VERSION}-linux64.tar.xz
37 |
38 | WORKDIR /home
39 | RUN wget ${BLENDER_URL}
40 | RUN tar xvf blender-${BLENDER_VERSION}-linux-glibc219-x86_64.tar.bz2
41 | RUN mv blender-${BLENDER_VERSION}-linux-glibc219-x86_64 blender && \
42 | rm blender-${BLENDER_VERSION}-linux-glibc219-x86_64.tar.bz2
43 |
44 | #RUN curl -L ${BLENDER_URL} | tar -xJ -C /usr/local/ && \
45 | # mv /usr/local/blender-${BLENDER_VERSION}-linux64 /usr/local/blender
46 |
47 | #RUN curl -L ${BLENDER_URL} | tar jxf - -C /opt
48 | #RUN ls -la
49 | # tar -xf blender*
50 | #| tar -xJ -C /usr/local/ && \
51 | # mv /usr/local/blender-${BLENDER_VERSION}-linux64 /usr/local/blender
52 |
53 | #VOLUME /media
54 | #ENTRYPOINT ["/usr/local/blender/blender", "-b"]
55 | CMD ["/bin/bash"]
56 |
--------------------------------------------------------------------------------
/blender/blender3.0/Dockerfile:
--------------------------------------------------------------------------------
1 | # syntax=docker/dockerfile:1.3
2 | FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu18.04
3 | LABEL maintainer filip.zoric@fer.hr
4 |
5 | # Setup environment
6 | ENV LANG C.UTF-8
7 | ENV LC_AL C.UTF-8
8 | ENV DEBIAN_FRONTEND noninteractive
9 | ENV NVIDIA_VISIBLE_DEVICES all
10 | ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
11 |
12 | # Setup timezone (fix interactive package installation)
13 | RUN ln -snf /usr/share/zoneinfo*${TZ} /etc/localtime && echo ${TZ} >/etc/timezone
14 |
15 | RUN apt-get update && \
16 | apt-get install -y \
17 | curl \
18 | git \
19 | libfreetype6 \
20 | libglu1-mesa \
21 | libxi6 \
22 | libxrender1 \
23 | nano \
24 | sudo \
25 | xz-utils \
26 | wget
27 |
28 | RUN apt-get update && \
29 | apt-get install -y \
30 | subversion \
31 | cmake \
32 | libx11-dev \
33 | libxxf86vm-dev \
34 | libxcursor-dev \
35 | libxi-dev \
36 | libxrandr-dev \
37 | libxinerama-dev
38 |
39 |
40 | RUN apt-get install --reinstall ca-certificates
41 | RUN mkdir /home/blender-git
42 | WORKDIR /home/blender-git
43 | RUN git clone https://git.blender.org/blender.git
44 | WORKDIR /home/blender-git/blender
45 | RUN git checkout tags/v2.80
46 |
47 | WORKDIR /home/blender-git/lib
48 | RUN svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64
49 |
50 | RUN apt-get install -y software-properties-common
51 | RUN add-apt-repository ppa:ubuntu-toolchain-r/test
52 | RUN apt update
53 | RUN apt install -y gcc-9
54 | RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9
55 | RUN apt-get install -y \
56 | python3 \
57 | build-essential
58 |
59 | WORKDIR /home/blender-git/blender
60 | RUN make update
61 | RUN make -j7
62 |
63 |
64 | CMD ["/bin/bash"]
65 |
--------------------------------------------------------------------------------
/blender/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name blender_cont \
39 | blender_img:latest
40 |
41 |
--------------------------------------------------------------------------------
/composers/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3.9"
2 | services:
3 | arm-control:
4 | build:
5 | context: ../ros-melodic/schunk_lwa4p_ros/
6 | network: host
7 | shm_size: '12gb'
8 | dockerfile: Dockerfile
9 | args:
10 | - ide=0
11 | volumes:
12 | - /dev:/dev
13 | command: "--gpus all --privileged"
14 | entrypoint: ["source /home/developer/catkin_ws/devel/setup.bash; roslaunch schunk_lwa4p_gazebo lwa4p_real_robot.launch"]
15 | tool-control:
16 | build:
17 | context: ../ros-melodic/dynamixel/
18 | network: host
19 | shm_size: '4gb'
20 | dockerfile: Dockerfile
21 | volumes:
22 | - /dev:/dev
23 | command: "--privileged"
24 |
25 |
--------------------------------------------------------------------------------
/dl/dl-cv/c_vit_pose/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ros_noetic_conda:latest
2 |
3 | ENV DEBIAN_FRONTEND=noninteractive
4 |
5 | RUN conda create -y -n vit_pose python=3.7
6 |
7 |
8 | SHELL ["conda", "run", "-n", "vit_pose", "/bin/bash", "-c"]
9 | WORKDIR /root
10 | RUN git clone https://github.com/open-mmlab/mmcv.git
11 |
12 | # Install mmcv
13 | WORKDIR /root/mmcv
14 | RUN git checkout v1.3.9 && \
15 | MMCV_WITH_OPS=1 pip install -e .
16 |
17 | WORKDIR /root/
18 | RUN git clone https://github.com/ViTAE-Transformer/ViTPose.git
19 | WORKDIR /root/ViTPose
20 | RUN pip install -v -e .
21 |
22 | # Don't know why is this expose here?
23 | #EXPOSE 5003
24 | #ENTRYPOINT ["conda", "activate", "vit_pose"]
25 | CMD ["bash"]
26 |
--------------------------------------------------------------------------------
/dl/dl-cv/c_vit_pose/first_run_cont.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 |
3 | # export DATA_PATH=$PWD in correct folder /home/Work/data
4 | docker run -it --network host --privileged --gpus all \
5 | -e DISPLAY=$DISPLAY \
6 | -v /dev:/dev \
7 | -v /tmp/.X11-unix:/tmp/.X11-unix \
8 | --name vit_pose_cont vit_pose:noetic
9 |
--------------------------------------------------------------------------------
/dl/dl-cv/conda/Dockerfile:
--------------------------------------------------------------------------------
1 | # Base image: Ubuntu 20.04 (required for ROS Noetic)
2 | FROM ubuntu:20.04
3 |
4 | # Set environment variables to avoid manual timezone prompts
5 | ENV DEBIAN_FRONTEND=noninteractive
6 | ENV NVIDIA_VISIBLE_DEVICES all
7 | ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
8 |
9 |
10 | # Install necessary system dependencies and utilities
11 | RUN apt-get update && apt-get install -y \
12 | curl \
13 | wget \
14 | lsb-release \
15 | gnupg \
16 | build-essential \
17 | python3-pip \
18 | git \
19 | locales \
20 | && rm -rf /var/lib/apt/lists/*
21 |
22 | # Set locale
23 | RUN locale-gen en_US.UTF-8
24 | ENV LANG=en_US.UTF-8
25 | ENV LC_ALL=en_US.UTF-8
26 |
27 | # Add ROS Noetic repository and install ROS Noetic Desktop Full
28 | RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
29 |
30 | RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
31 | RUN apt-get update && apt-get install -y ros-noetic-ros-base
32 |
33 | # Add ROS environment to bashrc
34 | RUN echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
35 |
36 | # Install Miniconda (simple Conda)
37 | RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \
38 | bash /tmp/miniconda.sh -b -p /opt/miniconda && \
39 | rm /tmp/miniconda.sh && \
40 | /opt/miniconda/bin/conda init bash
41 |
42 | # Add Conda to PATH
43 | ENV PATH="/opt/miniconda/bin:$PATH"
44 |
45 | # Verify ROS and Conda installation
46 | RUN echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc && \
47 | echo "export PATH=/opt/miniconda/bin:$PATH" >> ~/.bashrc
48 |
49 | # Set entry point to bash
50 | CMD ["bash"]
51 |
--------------------------------------------------------------------------------
/dl/dl-cv/conda/README.md:
--------------------------------------------------------------------------------
1 | # ROS-conda
2 |
3 | Combination of ROS and conda is implemented because most of the
4 | SOTA DL algorithms use conda to setup environment.
5 |
6 | With the clever setup of the shebang, we can configure ROS
7 | nodes to run on conda python, therefore enabling easier
8 | setup and inclusion of the DL models in the ROS nodes.
9 |
--------------------------------------------------------------------------------
/dl/dl-cv/conda/first_run_cont.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 |
3 | # export DATA_PATH=$PWD in correct folder /home/Work/data
4 | docker run -it --network host --privileged --gpus all \
5 | -e DISPLAY=$DISPLAY \
6 | -v /dev:/dev \
7 | -v /tmp/.X11-unix:/tmp/.X11-unix \
8 | --name ros_conda_cont
9 |
--------------------------------------------------------------------------------
/dl/dl-cv/dream/Dockerfile:
--------------------------------------------------------------------------------
1 | # syntax=docker/dockerfile:1.3
2 | FROM ubuntu:focal
3 |
4 | # Setup environment
5 | ENV LANG C.UTF-8
6 | ENV LC_AL C.UTF-8
7 | ENV ROS_DISTRO noetic
8 | ENV DEBIAN_FRONTEND noninteractive
9 | ENV NVIDIA_VISIBLE_DEVICES all
10 | ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
11 | ENV TZ=Europe/Zagreb
12 | ENV ROSCONSOLE_FORMAT '[${severity}] [${time}] [${node}]: ${message}'
13 |
14 | # Mitigate interactive prompt for choosing keyboard type
15 | COPY ./to_copy/keyboard /etc/default/keyboard
16 |
17 | # Setup timezone (fix interactive package installation)
18 | RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone
19 |
20 | RUN apt-get update
21 |
22 | # Install necessary packages for ROS and Gazebo
23 | RUN apt-get update && apt-get install -q -y \
24 | apt-utils \
25 | build-essential \
26 | bc \
27 | cmake \
28 | curl \
29 | git \
30 | lsb-release \
31 | libboost-dev \
32 | sudo \
33 | nano \
34 | net-tools \
35 | tmux \
36 | tmuxinator \
37 | wget \
38 | ranger \
39 | htop \
40 | libgl1-mesa-glx \
41 | libgl1-mesa-dri \
42 | rfkill \
43 | python3-pip
44 |
45 | # Install older torch to support (older) CUDA 11.4
46 | RUN pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113
47 |
48 | # Create CONDA directory
49 | #ENV CONDA_DIR /opt/conda
50 | #RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
51 | # /bin/bash ~/miniconda.sh -b -p /opt/conda
52 | # Create PATH variable
53 | #ENV PATH=$CONDA_DIR/bin:$PATH
54 |
55 | # Clone DREAM
56 | WORKDIR /root/home
57 | RUN git clone https://github.com/NVlabs/DREAM.git
58 | # Install DREAM
59 | WORKDIR /root/home/DREAM
60 | RUN pip install . -r requirements.txt
61 |
62 | WORKDIR /root/home
63 | CMD ["bash"]
64 |
--------------------------------------------------------------------------------
/dl/dl-cv/dream/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="TERM=xterm-256color" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix" \
34 | --volume="/dev:/dev" \
35 | --volume="/var/run/dbus/:/var/run/dbus/:z" \
36 | --net=host \
37 | --privileged \
38 | --gpus all \
39 | --name dream_cont \
40 | dream_img:latest
41 |
--------------------------------------------------------------------------------
/dl/dl-cv/dream/to_copy/aliases:
--------------------------------------------------------------------------------
1 | alias re-source='source ~/.bashrc'
2 | alias ra='. ranger'
3 | alias cbt='catkin build --this'
4 |
5 | # allows killing process with all its children
6 | killp() {
7 |
8 | if [ $# -eq 0 ]; then
9 | echo "The command killp() needs an argument, but none was provided!"
10 | return
11 | else
12 | pes=$1
13 | fi
14 |
15 | for child in $(ps -o pid,ppid -ax | \
16 | awk "{ if ( \$2 == $pes ) { print \$1 }}")
17 | do
18 | # echo "Killing child process $child because ppid = $pes"
19 | killp $child
20 | done
21 |
22 | # echo "killing $1"
23 | kill -9 "$1" > /dev/null 2> /dev/null
24 | }
25 |
26 | waitForRos() {
27 | until rostopic list > /dev/null 2>&1; do
28 | echo "waiting for ros"
29 | sleep 1;
30 | done
31 | }
--------------------------------------------------------------------------------
/dl/dl-cv/dream/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/dl/dl-cv/dream/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/dl/dl-cv/dream/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/dl/dl-cv/dream/to_copy/tmux:
--------------------------------------------------------------------------------
1 | ## remap prefix from 'C-b' to 'C-a'
2 | # set-option -g prefix C-a
3 |
4 | ## Terminal colors
5 | set -g default-terminal "screen-256color"
6 | set -g terminal-overrides "xterm-color256:smcup@:rmcup@"
7 |
8 | ## Mouse support
9 | # set -g mouse on
10 |
11 | ## Shortcuts
12 | bind -n S-Left previous-window
13 | bind -n S-Right next-window
14 | bind -n C-Left select-pane -L
15 | bind -n C-Right select-pane -R
16 | bind -n C-Up select-pane -U
17 | bind -n C-Down select-pane -D
18 |
19 | # Remap kill button to ^K
20 | bind-key k \
21 | split-window \; \
22 | setw synchronize-panes on \; \
23 | send-keys "sleep 1; pwd >> /tmp/tmux_restore_path.txt; tmux list-panes -s -F \"#{pane_pid} #{pane_current_command}\" | grep -v tmux | awk '{print $1}' | while read in; do killp \$in; done" C-m exit C-m
24 |
25 | # Toggle synchronize-panes with ^S m
26 | bind s \
27 | set synchronize-panes \;\
28 | display "Sync #{?synchronize-panes,ON,OFF}"
29 |
30 |
31 | ## Status bar design
32 | # Info on left (I don't have a session display for now)
33 | set -g status-left ''
34 |
35 | # loud or quiet?
36 | set-option -g visual-activity off
37 | set-option -g visual-bell off
38 | set-option -g visual-silence off
39 | set-window-option -g monitor-activity off
40 | set-option -g bell-action none
41 |
42 | set -g default-terminal "screen-256color"
43 |
44 | # The modes {
45 | setw -g clock-mode-colour colour135
46 | # }
47 |
48 | # The statusbar {
49 | set -g status-position bottom
50 |
51 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
52 | set -g status-bg colour234
53 | set -g status-fg colour15
54 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
55 |
56 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
57 | set -g status-left "#[fg=colour15,bg=colour26] #S #[fg=colour103,bg=colour236,nobold,nounderscore,noitalics]"
58 | set -g status-right "#[fg=colour239] #(echo $ROS_MASTER_URI) #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour248,bg=colour239] %H:%M #[fg=colour15,bg=colour26] #H"
59 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
60 |
61 | set -g status-right-length 50
62 | set -g status-left-length 20
63 |
64 | setw -g window-status-current-format "#[fg=colour236,bg=colour239,nobold,nounderscore,noitalics]#[fg=colour253,bg=colour239] #I |#[fg=colour253,bg=colour239] #W #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]" # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
65 |
66 | setw -g window-status-format "#[fg=colour244,bg=colour236] #I |#[fg=colour244,bg=colour236] #W " # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
67 | # }
--------------------------------------------------------------------------------
/dl/dl-cv/hpe/README.md:
--------------------------------------------------------------------------------
1 | # OpenPose
2 |
3 | `openpose_x64` is OpenPose container for the Linux x64 (Normal PC)
4 | `openpose_arm` is OpenPose container for the ARM processor (Jetson Xavier)
5 |
6 |
7 | ## openpose_arm
8 |
9 | For the openpose_arm it is crucial to set `LD_LIBRARY_PATH` and `PATH` variable,
10 | and set in `cmake-gui` USE_CUDNN on `False` and compute_capability to `72`
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/dl/dl-cv/hpe/alphapose/README.md:
--------------------------------------------------------------------------------
1 | # AlphaPose
2 |
3 | [Link](https://github.com/MVIG-SJTU/AlphaPose/issues/1162) to download weights
4 | for the detector.
5 |
6 | Command to test inference:
7 | ```
8 | ./scripts/inference.sh configs/coco/resnet/256x192_res50_lr1e-3_1x.yaml pretrained_models/fast_res50_256x192.pth /root/test_humans1.mp4
9 | ```
10 |
--------------------------------------------------------------------------------
/dl/dl-cv/hpe/alphapose/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 |
3 | # export DATA_PATH=$PWD in correct folder /home/Work/data
4 | docker run -it --network host --privileged --gpus all \
5 | -e DISPLAY=$DISPLAY \
6 | -v /dev:/dev \
7 | -v /tmp/.X11-unix:/tmp/.X11-unix \
8 | --name alphapose_cont alphapose_img:latest
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/dl/dl-cv/hpe/openpose_arm/README.md:
--------------------------------------------------------------------------------
1 | ## Building openpose
2 |
3 |
4 | Building Openpose on Jetson Orin.
5 |
6 | 1. Corrected `--gpu` flag which is not supported on the PCs that have arm processor.
7 |
8 |
--------------------------------------------------------------------------------
/dl/dl-cv/hpe/openpose_arm/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --runtime nvidia \
38 | --name openpose_cont \
39 | openpose:arm
40 |
41 |
42 |
--------------------------------------------------------------------------------
/dl/dl-cv/hpe/openpose_x64/README.md:
--------------------------------------------------------------------------------
1 | # OpenPose docker
2 |
3 | Most of the info was gathered from this [link](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation/1_prerequisites.md)
4 | which states prerequisites for building OpenPose from source.
5 |
6 |
7 | # Reinstall CUDNN stuff
8 |
9 | Because of reinstall it's neccessary to swap between available cudnn7 installations.
10 | You can do that with following command:
11 | ```
12 | sudo update-alternatives --config libcudnn
13 | ```
14 |
15 |
16 | # Documentation
17 |
18 | You can find FAQs and all related documentation for openpose [here](https://cmu-perceptual-computing-lab.github.io/openpose/web/html/doc/md_doc_05_faq.html)
19 |
20 | Building OpenPose from source can be found [here](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation/0_index.md#compiling-and-running-openpose-from-source).
21 |
22 |
23 | # Out of Memory Error
24 |
25 | If you get following error:
26 | ```
27 | I get an error similar to: Check failed: error == cudaSuccess (2 vs. 0) out of memory.
28 |
29 | ```
30 |
31 | Make sure you have a GPU with at least 4 GB of memory. If your GPU is between 2 and 4 GB, it should be fine for body-only settings,
32 | but you can also reduce the --net_resolution if it does not fit (check Speed Up, Memory Reduction, and Benchmark for the consequences of this).
33 |
34 | # HOWTO start OpenPose with GPU with 2 GB of VRAM?
35 |
36 | You can test OpenPose on weaker GPUs by reducing net resolution and using COCO model.
37 |
38 | This command uses up to 2GB of memory.
39 |
40 | ```
41 |
42 | ./build/examples/openpose/openpose.bin --model-pose COCO --net-resolution 256x256
43 |
44 | ```
45 |
46 |
--------------------------------------------------------------------------------
/dl/dl-cv/hpe/openpose_x64/build_docker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | BOOST_VERSION="$1"
4 | BOOST_VERSION_=${BOOST_VERSION//./_}
5 |
6 | docker build . -t openpose_img:${BOOST_VERSION} --build-arg BOOST_VERSION=${BOOST_VERSION} \
7 | --build-arg BOOST_VERSION_=${BOOST_VERSION_}
8 |
--------------------------------------------------------------------------------
/dl/dl-cv/hpe/openpose_x64/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name openpose_cont \
39 | openpose_img:latest
40 |
41 |
42 |
--------------------------------------------------------------------------------
/dl/dl-cv/hpe/pytorch1.7/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM pytorch/pytorch:1.7.0-cuda11.0-cudnn8-devel
2 |
3 | LABEL maintainer filip.zoric@fer.hr
4 |
5 | # Set arguments
6 | ARG USER=developer
7 | ARG UID=1000
8 | ARG GID=1000
9 | ARG PW=developer
10 |
11 | # Install necessary software packages
12 | RUN apt-get update && \
13 | apt-get install -y --no-install-recommends \
14 | build-essential \
15 | feh \
16 | git \
17 | nano \
18 | python \
19 | python-pip \
20 | python3 \
21 | python3-pip \
22 | software-properties-common \
23 | sudo \
24 | wget
25 |
26 | # Add developer user / remove neccessity to type password for sudo command
27 | RUN adduser --disabled-password \
28 | --gecos '' ${USER}
29 | RUN adduser ${USER} sudo
30 | RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
31 |
32 | # Install packages neccessary for training and testing neural networks
33 | RUN conda install -c anaconda \
34 | scipy \
35 | configargparse \
36 | cython
37 |
38 | RUN conda install -c conda-forge \
39 | progress \
40 | json_tricks \
41 | tensorboardx \
42 | easydict \
43 | opencv \
44 | pycocotools
45 |
46 | # Clone human pose estimation from microsoft
47 | WORKDIR /home/${USER}
48 | RUN git clone https://1179f5263f30983555405406fd4722fd537126f7@github.com/larics/hpe-pytorch.git
49 |
50 | # Create input data directory
51 | RUN mkdir data
52 |
53 | # Add pycharm for faster development and testing
54 | ENV version 2020.2.3
55 | RUN wget -O /home/developer/pycharm.tar.gz "https://download.jetbrains.com/python/pycharm-community-$version.tar.gz"
56 | RUN tar -xvf /home/developer/pycharm.tar.gz && rm -rf /home/developer/pycharm.tar.gz
57 | RUN echo 'alias pycharm=/home/developer/pycharm-community-$version/bin/pycharm.sh' >> /home/developer/.bashrc
58 |
59 | CMD ["bash"]
60 |
--------------------------------------------------------------------------------
/dl/dl-cv/hpe/pytorch1.7/first_run_cont.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 |
3 | # export DATA_PATH=$PWD in correct folder /home/Work/data
4 | docker run -it --network host --privileged --gpus all \
5 | -e DISPLAY=$DISPLAY \
6 | -v /dev:/dev \
7 | -v /tmp/.X11-unix:/tmp/.X11-unix \
8 | --name hpe_cont hpe_full_img:latest
9 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | *.egg-info/
24 | .installed.cfg
25 | *.egg
26 | MANIFEST
27 |
28 | # PyInstaller
29 | # Usually these files are written by a python script from a template
30 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
31 | *.manifest
32 | *.spec
33 |
34 | # Installer logs
35 | pip-log.txt
36 | pip-delete-this-directory.txt
37 |
38 | # Unit test / coverage reports
39 | htmlcov/
40 | .tox/
41 | .coverage
42 | .coverage.*
43 | .cache
44 | nosetests.xml
45 | coverage.xml
46 | *.cover
47 | .hypothesis/
48 | .pytest_cache/
49 |
50 | # Translations
51 | *.mo
52 | *.pot
53 |
54 | # Django stuff:
55 | *.log
56 | local_settings.py
57 | db.sqlite3
58 |
59 | # Flask stuff:
60 | instance/
61 | .webassets-cache
62 |
63 | # Scrapy stuff:
64 | .scrapy
65 |
66 | # Sphinx documentation
67 | docs/_build/
68 |
69 | # PyBuilder
70 | target/
71 |
72 | # Jupyter Notebook
73 | .ipynb_checkpoints
74 |
75 | # pyenv
76 | .python-version
77 |
78 | # celery beat schedule file
79 | celerybeat-schedule
80 |
81 | # SageMath parsed files
82 | *.sage.py
83 |
84 | # Environments
85 | .env
86 | .venv
87 | env/
88 | venv/
89 | ENV/
90 | env.bak/
91 | venv.bak/
92 |
93 | # Spyder project settings
94 | .spyderproject
95 | .spyproject
96 |
97 | # Rope project settings
98 | .ropeproject
99 |
100 | # mkdocs documentation
101 | /site
102 |
103 | # mypy
104 | .mypy_cache/
105 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | Any contribution that you make to this repository will
2 | be under the Apache 2 License, as dictated by that
3 | [license](http://www.apache.org/licenses/LICENSE-2.0.html):
4 |
5 | ~~~
6 | 5. Submission of Contributions. Unless You explicitly state otherwise,
7 | any Contribution intentionally submitted for inclusion in the Work
8 | by You to the Licensor shall be under the terms and conditions of
9 | this License, without any additional terms or conditions.
10 | Notwithstanding the above, nothing herein shall supersede or modify
11 | the terms of any separate license agreement you may have executed
12 | with Licensor regarding such Contributions.
13 | ~~~
14 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/data/detection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-cv/ros2-tensorflow/data/detection.png
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/docker/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # @author Alberto Soragna (alberto dot soragna at gmail dot com)
4 | # @2018
5 |
6 | IMG_NAME="ros2_tensorflow_gpu"
7 |
8 | if [[ $1 == "--force" ]]; then
9 | CLEAN_CMD="--no-cache"
10 | else
11 | CLEAN_CMD=""
12 | fi
13 |
14 | docker pull osrf/ros:foxy-desktop
15 | docker build $CLEAN_CMD -t $IMG_NAME .
16 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/docker/run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # @author Alberto Soragna (alberto dot soragna at gmail dot com)
4 | # @2020
5 |
6 | THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
7 |
8 | IMG_NAME="ros2_tensorflow_gpu"
9 |
10 | NETWORK_SETTINGS="--net=host --privileged"
11 |
12 | # --runtime=nvidia
13 | XSOCK=/tmp/.X11-unix
14 | DISPLAY_SETTINGS="-e DISPLAY=$DISPLAY -v $XSOCK:$XSOCK -v $XAUTHORITY:/root/.Xauthority"
15 |
16 | DEV_SETTINGS="-v $THIS_DIR/..:/root/ros2-tensorflow"
17 |
18 | ENTRY_CMD="bash"
19 |
20 | # Start Docker container
21 | docker run -it --rm \
22 | $NETWORK_SETTINGS \
23 | $DISPLAY_SETTINGS \
24 | $DEV_SETTINGS \
25 | $IMG_NAME \
26 | $ENTRY_CMD
27 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/docker/scripts/build_opencv.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # @author Alberto Soragna (alberto dot soragna at gmail dot com)
4 | # @2020
5 |
6 | cmake \
7 | -D CMAKE_BUILD_TYPE=RELEASE \
8 | -D CMAKE_INSTALL_PREFIX=/usr/local \
9 | -D INSTALL_PYTHON_EXAMPLES=OFF \
10 | -D OPENCV_EXTRA_MODULES_PATH=$HOME/opencv_contrib/modules \
11 | -D BUILD_EXAMPLES=OFF \
12 | ..
13 |
14 | make -j30
15 | make install
16 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/docker/scripts/coco/Makefile:
--------------------------------------------------------------------------------
1 |
2 | all:
3 | # install pycocotools locally
4 | python3 setup.py build_ext --inplace
5 | rm -rf build
6 |
7 | install:
8 | # install pycocotools to the Python site-packages
9 | python3 setup.py build_ext install
10 | rm -rf build
11 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/docker/scripts/label_map_util.patch:
--------------------------------------------------------------------------------
1 | --- a/research/object_detection/utils/label_map_util.py
2 | +++ b/research/object_detection/utils/label_map_util.py
3 | @@ -135,7 +135,7 @@ def load_labelmap(path):
4 | Returns:
5 | a StringIntLabelMapProto
6 | """
7 | - with tf.gfile.GFile(path, 'r') as fid:
8 | + with tf.io.gfile.GFile(path, 'r') as fid:
9 | label_map_string = fid.read()
10 | label_map = string_int_label_map_pb2.StringIntLabelMap()
11 | try:
12 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tensorflow/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package ros2_tensorflow
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 0.1.0 (2020-06-21)
6 | ------------------
7 | * create ros2_tensorflow metapackage
8 | * Contributors: Soragna, Alberto
9 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tensorflow/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.5)
2 | project(ros2_tensorflow)
3 |
4 | if(NOT CMAKE_CXX_STANDARD)
5 | set(CMAKE_CXX_STANDARD 14)
6 | endif()
7 |
8 | find_package(ament_cmake REQUIRED)
9 |
10 | ament_package()
11 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tensorflow/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ros2_tensorflow
5 | 0.1.0
6 |
7 | ROS 2 nodes and utilities for computer vision tasks using Tensorflow
8 |
9 | Alberto Soragna
10 | Alberto Soragna
11 |
12 | Apache License 2.0
13 |
14 | ament_cmake
15 |
16 | ros2_tf_core
17 | tf_classification_py
18 | tf_detection_py
19 | tf_interfaces
20 |
21 |
22 | ament_cmake
23 |
24 |
25 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package ros2_tf_core
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 0.1.0 (2020-06-21)
6 | ------------------
7 | * rename ros2_tensorflow package to ros2_tf_core
8 | * add support for saved models in tf_detection_py
9 | * create method for publishing vision info in base class TensorflowNode
10 | * remove hardcoded tensorflow model names and create TensorflowModel wrapper class
11 | * create publisher for vision info msg in tf nodes
12 | * add copyright notice to files
13 | * move load frozen model function to utility file
14 | * fix opencv dependency in package.xml files
15 | * fix ros2_tensorflow/setup.py to avoid colcon warning
16 | WARNING:colcon.colcon_ros.task.ament_python.build:Package 'ros2_tensorflow' doesn't explicitly install a marker in the package index (colcon-ros currently does it implicitly but that fallback will be removed in the future)
17 | WARNING:colcon.colcon_ros.task.ament_python.build:Package 'ros2_tensorflow' doesn't explicitly install the 'package.xml' file (colcon-ros currently does it implicitly but that fallback will be removed in the future)
18 | * remove unused import and typographic cleanup
19 | * fix wrong tensorflow key in package xml files (`#1 `_)
20 | * updated the whole repo use ubuntu 18.04, tensorflow 2.0 and ros2 eloquent
21 | * Contributors: Soragna, Alberto
22 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ros2_tf_core
5 | 0.1.0
6 |
7 | Utilities for working with ROS 2 and Tensorflow
8 |
9 | Alberto Soragna
10 | Alberto Soragna
11 |
12 | Apache License 2.0
13 |
14 | python3-opencv
15 | python-tensorflow-pip
16 |
17 | rclpy
18 |
19 | ament_copyright
20 | ament_flake8
21 | ament_pep257
22 | python3-pytest
23 |
24 |
25 | ament_python
26 |
27 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/resource/ros2_tf_core:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/resource/ros2_tf_core
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/ros2_tf_core/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/ros2_tf_core/__init__.py
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/ros2_tf_core/img_conversion.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | import cv2
17 |
18 | import numpy as np
19 |
20 | from sensor_msgs.msg import Image as ImageMsg
21 |
22 |
23 | def image_msg_to_image_np(image_msg):
24 | n_channels = 3
25 | dtype = 'uint8'
26 | img_buf = np.asarray(image_msg.data, dtype=dtype)
27 |
28 | image_np = np.ndarray(shape=(image_msg.height, image_msg.width, n_channels),
29 | dtype=dtype, buffer=img_buf)
30 |
31 | return image_np
32 |
33 |
34 | def image_np_to_image_msg(image_np):
35 | image_msg = ImageMsg()
36 |
37 | image_msg.height = image_np.shape[0]
38 | image_msg.width = image_np.shape[1]
39 | image_msg.encoding = 'bgr8'
40 | image_msg.data = image_np.tostring()
41 | image_msg.step = len(image_msg.data) // image_msg.height
42 | image_msg.header.frame_id = 'map'
43 |
44 | return image_msg
45 |
46 |
47 | def jpg_to_image_msg(img_path):
48 |
49 | # br = CvBridge()
50 | # dtype, n_channels = br.encoding_as_cvtype2('8UC3')
51 | # image_msg = br.cv2_to_imgmsg(img)
52 |
53 | img = cv2.imread(img_path, cv2.IMREAD_COLOR)
54 |
55 | image_msg = ImageMsg()
56 | image_msg.height = img.shape[0]
57 | image_msg.width = img.shape[1]
58 | image_msg.encoding = 'rgb8'
59 | image_msg.data = img.tostring()
60 | image_msg.step = len(image_msg.data) // image_msg.height
61 |
62 | return image_msg
63 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/ros2_tf_core/qos.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | from rclpy.qos import QoSDurabilityPolicy
17 | from rclpy.qos import QoSProfile
18 |
19 | # QoS profile for publishing and subscribing vision_msgs/VisionInfo
20 | qos_profile_vision_info = QoSProfile(depth=1, durability=QoSDurabilityPolicy.TRANSIENT_LOCAL)
21 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/ros2_tf_core/tensorflow_node.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | from rclpy.node import Node
17 |
18 | from ros2_tf_core.qos import qos_profile_vision_info
19 | from vision_msgs.msg import VisionInfo
20 |
21 |
22 | class TensorflowNode(Node):
23 |
24 | def __init__(self, node_name):
25 | super().__init__(node_name)
26 |
27 | def publish_vision_info(self, tf_model):
28 |
29 | # Publish vision info message (published only once with TRANSIENT LOCAL durability)
30 | vision_info_msg = VisionInfo()
31 | vision_info_msg.method = tf_model.description
32 | vision_info_msg.database_location = tf_model.compute_label_path()
33 |
34 | vision_info_pub = self.create_publisher(
35 | VisionInfo, 'vision_info', qos_profile=qos_profile_vision_info)
36 | vision_info_pub.publish(vision_info_msg)
37 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/setup.cfg:
--------------------------------------------------------------------------------
1 | [develop]
2 | script_dir=$base/lib/ros2_tf_core
3 | [install]
4 | install_scripts=$base/lib/ros2_tf_core
5 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages
2 | from setuptools import setup
3 |
4 | package_name = 'ros2_tf_core'
5 |
6 | setup(
7 | name=package_name,
8 | version='0.0.2',
9 | packages=find_packages(exclude=['test']),
10 | data_files=[
11 | ('share/ament_index/resource_index/packages',
12 | ['resource/' + package_name]),
13 | ('share/' + package_name, ['package.xml']),
14 | ],
15 | install_requires=['setuptools'],
16 | author='Alberto Soragna',
17 | author_email='alberto.soragna@gmail.com',
18 | maintainer='Alberto Soragna',
19 | maintainer_email='alberto.soragna@gmail.com',
20 | keywords=['ROS'],
21 | classifiers=[
22 | 'Intended Audience :: Developers',
23 | 'License :: OSI Approved :: Apache Software License',
24 | 'Programming Language :: Python',
25 | 'Topic :: Software Development',
26 | ],
27 | description='Utilities for working with ROS 2 and Tensorflow',
28 | license='Apache License, Version 2.0',
29 | tests_require=['pytest'],
30 | test_suite='test',
31 | entry_points={
32 | 'console_scripts': [
33 | ],
34 | },
35 | )
36 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/test/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/test/__init__.py
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/test/ros2_tf_core/__init__,py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/test/ros2_tf_core/__init__,py
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/test/test_copyright.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | from ament_copyright.main import main
17 | import pytest
18 |
19 |
20 | @pytest.mark.copyright
21 | @pytest.mark.linter
22 | def test_copyright():
23 | rc = main(argv=['.', 'test'])
24 | assert rc == 0, 'Found errors'
25 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/test/test_flake8.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | from ament_flake8.main import main
17 | import pytest
18 |
19 |
20 | @pytest.mark.flake8
21 | @pytest.mark.linter
22 | def test_flake8():
23 | rc = main(argv=[])
24 | assert rc == 0, 'Found errors'
25 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/ros2_tf_core/test/test_pep257.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | from ament_pep257.main import main
17 | import pytest
18 |
19 |
20 | @pytest.mark.linter
21 | @pytest.mark.pep257
22 | def test_pep257():
23 | rc = main(argv=['.', 'test'])
24 | assert rc == 0, 'Found code style errors / warnings'
25 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package tf_classification_py
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 0.1.0 (2020-06-21)
6 | ------------------
7 | * rename ros2_tensorflow package to ros2_tf_core
8 | * download images for simple tests instead of using hardcoded paths
9 | * add support for saved models in tf_detection_py
10 | * store tensorflow network output in dictionary format
11 | * use ros params in tf nodes
12 | * unify server and subscriber examples
13 | * create examples directories under tf_classification_py and tf_detection_py
14 | * create method for publishing vision info in base class TensorflowNode
15 | * remove hardcoded tensorflow model names and create TensorflowModel wrapper class
16 | * create publisher for vision info msg in tf nodes
17 | * use int instead of strings for vision_msgs id filed
18 | the message use a string in master branch, but an int in the eloquent release
19 | * add copyright notice to files
20 | * use vision_msgs detection2darray in detection node
21 | * add vision_msgs as dependency and use them for classification
22 | * move load frozen model function to utility file
23 | * fix opencv dependency in package.xml files
24 | * use ros time instead of datetime in nodes
25 | * remove unused import and typographic cleanup
26 | * fix wrong tensorflow key in package xml files (`#1 `_)
27 | * updated the whole repo use ubuntu 18.04, tensorflow 2.0 and ros2 eloquent
28 | * Contributors: Soragna, Alberto
29 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | tf_classification_py
5 | 0.1.0
6 |
7 | Python nodes for image classification tasks using Tensorflow.
8 |
9 | Alberto Soragna
10 | Alberto Soragna
11 |
12 | Apache License 2.0
13 |
14 | python-tensorflow-pip
15 |
16 | rclpy
17 | sensor_msgs
18 | vision_msgs
19 |
20 | tf_interfaces
21 | ros2_tf_core
22 |
23 | ament_copyright
24 | ament_flake8
25 | ament_pep257
26 | python3-pytest
27 |
28 |
29 | ament_python
30 |
31 |
32 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/resource/tf_classification_py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/resource/tf_classification_py
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/setup.cfg:
--------------------------------------------------------------------------------
1 | [develop]
2 | script_dir=$base/lib/tf_classification_py
3 | [install]
4 | install_scripts=$base/lib/tf_classification_py
5 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages
2 | from setuptools import setup
3 |
4 | package_name = 'tf_classification_py'
5 |
6 | setup(
7 | name=package_name,
8 | version='0.0.2',
9 | packages=find_packages(exclude=['test']),
10 | data_files=[
11 | ('share/ament_index/resource_index/packages',
12 | ['resource/' + package_name]),
13 | ('share/' + package_name, ['package.xml']),
14 | ],
15 | install_requires=['setuptools'],
16 | zip_safe=True,
17 | author='Alberto Soragna',
18 | author_email='alberto.soragna@gmail.com',
19 | maintainer='Alberto Soragna',
20 | maintainer_email='alberto.soragna@gmail.com',
21 | keywords=['ROS'],
22 | classifiers=[
23 | 'Intended Audience :: Developers',
24 | 'License :: OSI Approved :: Apache Software License',
25 | 'Programming Language :: Python',
26 | 'Topic :: Software Development',
27 | ],
28 | description=(
29 | 'Python nodes for image classification tasks using Tensorflow.'
30 | ),
31 | license='Apache License, Version 2.0',
32 | tests_require=['pytest'],
33 | entry_points={
34 | 'console_scripts': [
35 | 'server = tf_classification_py.examples.server:main',
36 | 'client_test = tf_classification_py.examples.client_test:main'
37 | ],
38 | },
39 | )
40 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/test/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/test/__init__.py
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/test/test_copyright.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | from ament_copyright.main import main
17 | import pytest
18 |
19 |
20 | @pytest.mark.copyright
21 | @pytest.mark.linter
22 | def test_copyright():
23 | rc = main(argv=['.', 'test'])
24 | assert rc == 0, 'Found errors'
25 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/test/test_flake8.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | from ament_flake8.main import main
17 | import pytest
18 |
19 |
20 | @pytest.mark.flake8
21 | @pytest.mark.linter
22 | def test_flake8():
23 | rc = main(argv=[])
24 | assert rc == 0, 'Found errors'
25 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/test/test_pep257.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | from ament_pep257.main import main
17 | import pytest
18 |
19 |
20 | @pytest.mark.linter
21 | @pytest.mark.pep257
22 | def test_pep257():
23 | rc = main(argv=['.', 'test'])
24 | assert rc == 0, 'Found code style errors / warnings'
25 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/tf_classification_py/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/tf_classification_py/__init__.py
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/tf_classification_py/examples/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/tf_classification_py/examples/__init__.py
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/tf_classification_py/examples/server.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | import rclpy
17 |
18 | from tf_classification_py.classification_node import ClassificationNode
19 | from tf_classification_py.models import IMAGENET_INCEPTION
20 |
21 |
22 | def main(args=None):
23 |
24 | rclpy.init(args=args)
25 |
26 | node = ClassificationNode(IMAGENET_INCEPTION, 'classification_server')
27 | rclpy.spin(node)
28 |
29 | rclpy.shutdown()
30 |
31 |
32 | if __name__ == '__main__':
33 | main()
34 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_classification_py/tf_classification_py/models.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | import os
17 |
18 | from ros2_tf_core import models as models_utils
19 | import tensorflow as tf
20 |
21 |
22 | TENSORFLOW_IMAGENET_DIR = os.path.join(os.path.dirname(tf.__file__), 'models/image/imagenet')
23 |
24 | IMAGENET_INCEPTION = models_utils.ModelDescriptor().from_url(
25 | url='http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz',
26 | label_path=os.path.join(os.path.join(TENSORFLOW_IMAGENET_DIR, 'inception-2015-12-05'), 'imagenet_2012_challenge_label_map_proto.pbtxt'), # noqa: E501
27 | download_directory=TENSORFLOW_IMAGENET_DIR,
28 | model_filename='classify_image_graph_def.pb',
29 | save_load_format=models_utils.SaveLoadFormat.FROZEN_MODEL,
30 | description='TensorFlow inception network for image classification, trained on imagenet')
31 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package tf_detection_py
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 0.1.0 (2020-06-21)
6 | ------------------
7 | * rename ros2_tensorflow package to ros2_tf_core
8 | * add cropped image to detections msg
9 | * add face detection example
10 | * add filtering function intersection over area
11 | use it to remove overlapping bounding boxes with same class
12 | * add support for object detection masks
13 | * download images for simple tests instead of using hardcoded paths
14 | * add support for saved models in tf_detection_py
15 | * store tensorflow network output in dictionary format
16 | * use ros params in tf nodes
17 | * unify server and subscriber examples
18 | * create examples directories under tf_classification_py and tf_detection_py
19 | * create method for publishing vision info in base class TensorflowNode
20 | * remove hardcoded tensorflow model names and create TensorflowModel wrapper class
21 | * simplify location of tensorflow object detection library, assuming that it's in the pythonpath
22 | * create publisher for vision info msg in tf nodes
23 | * use int instead of strings for vision_msgs id filed
24 | the message use a string in master branch, but an int in the eloquent release
25 | * add copyright notice to files
26 | * use vision_msgs detection2darray in detection node
27 | * move load frozen model function to utility file
28 | * use provided function for creating category index
29 | * fix opencv dependency in package.xml files
30 | * use ros time instead of datetime in nodes
31 | * remove unused import and typographic cleanup
32 | * fix wrong tensorflow key in package xml files (`#1 `_)
33 | * updated the whole repo use ubuntu 18.04, tensorflow 2.0 and ros2 eloquent
34 | * Contributors: Soragna, Alberto
35 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | tf_detection_py
5 | 0.1.0
6 |
7 | Python nodes for image detection tasks using Tensorflow
8 |
9 | Alberto Soragna
10 | Alberto Soragna
11 |
12 | Apache License 2.0
13 |
14 | python-tensorflow-pip
15 |
16 | rclpy
17 | sensor_msgs
18 | vision_msgs
19 |
20 | tf_interfaces
21 | ros2_tf_core
22 |
23 | ament_copyright
24 | ament_flake8
25 | ament_pep257
26 | python3-pytest
27 |
28 |
29 | ament_python
30 |
31 |
32 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/resource/tf_detection_py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/resource/tf_detection_py
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/setup.cfg:
--------------------------------------------------------------------------------
1 |
2 | [develop]
3 | script_dir=$base/lib/tf_detection_py
4 | [install]
5 | install_scripts=$base/lib/tf_detection_py
6 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages
2 | from setuptools import setup
3 |
4 | package_name = 'tf_detection_py'
5 |
6 | setup(
7 | name=package_name,
8 | version='0.0.2',
9 | packages=find_packages(exclude=['test']),
10 | data_files=[
11 | ('share/ament_index/resource_index/packages',
12 | ['resource/' + package_name]),
13 | ('share/' + package_name, ['package.xml']),
14 | ],
15 | install_requires=['setuptools'],
16 | zip_safe=True,
17 | author='Alberto Soragna',
18 | author_email='alberto.soragna@gmail.com',
19 | maintainer='Alberto Soragna',
20 | maintainer_email='alberto.soragna@gmail.com',
21 | keywords=['ROS'],
22 | classifiers=[
23 | 'Intended Audience :: Developers',
24 | 'License :: OSI Approved :: Apache Software License',
25 | 'Programming Language :: Python',
26 | 'Topic :: Software Development',
27 | ],
28 | description=(
29 | 'Python nodes for image detection tasks using Tensorflow.'
30 | ),
31 | license='Apache License, Version 2.0',
32 | tests_require=['pytest'],
33 | entry_points={
34 | 'console_scripts': [
35 | 'client_test = tf_detection_py.examples.client_test:main',
36 | 'face_detection = tf_detection_py.examples.face_detection:main',
37 | 'server = tf_detection_py.examples.server:main',
38 | ],
39 | },
40 | )
41 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/test/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/test/__init__.py
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/test/test_copyright.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | from ament_copyright.main import main
17 | import pytest
18 |
19 |
20 | @pytest.mark.copyright
21 | @pytest.mark.linter
22 | def test_copyright():
23 | rc = main(argv=['.', 'test'])
24 | assert rc == 0, 'Found errors'
25 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/test/test_flake8.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | from ament_flake8.main import main
17 | import pytest
18 |
19 |
20 | @pytest.mark.flake8
21 | @pytest.mark.linter
22 | def test_flake8():
23 | rc = main(argv=[])
24 | assert rc == 0, 'Found errors'
25 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/test/test_pep257.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | from ament_pep257.main import main
17 | import pytest
18 |
19 |
20 | @pytest.mark.linter
21 | @pytest.mark.pep257
22 | def test_pep257():
23 | rc = main(argv=['.', 'test'])
24 | assert rc == 0, 'Found code style errors / warnings'
25 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/tf_detection_py/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/tf_detection_py/__init__.py
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/tf_detection_py/examples/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/tf_detection_py/examples/__init__.py
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/tf_detection_py/examples/face_detection.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | import rclpy
17 | from ros2_tf_core import models as models_utils
18 | from tf_detection_py.detection_node import DetectionNode
19 | from tf_detection_py.models import TENSORFLOW_OBJECT_DETECTION_DIR
20 |
21 |
22 | def main(args=None):
23 |
24 | # Download a model and labels for face detections
25 | # Courtesy of https://github.com/yeephycho/tensorflow-face-detection
26 | model_path = models_utils.maybe_download_and_extract(
27 | 'https://docs.google.com/uc?export=download&id=0B5ttP5kO_loUdWZWZVVrN2VmWFk',
28 | TENSORFLOW_OBJECT_DETECTION_DIR,
29 | 'frozen_inference_graph_face.pb',
30 | extract=False)
31 | label_path = models_utils.maybe_download_and_extract(
32 | 'https://raw.githubusercontent.com/yeephycho/tensorflow-face-detection/master/protos/face_label_map.pbtxt', # noqa: E501
33 | TENSORFLOW_OBJECT_DETECTION_DIR,
34 | 'face_label_map.pbtxt',
35 | extract=False)
36 |
37 | # Create a descriptor for the just downloaded network
38 | SSD_FACE_DETECTION = models_utils.ModelDescriptor().from_path(
39 | model_path=model_path,
40 | label_path=label_path,
41 | save_load_format=models_utils.SaveLoadFormat.FROZEN_MODEL,
42 | description='TensorFlow SSD Face Detection, trained on WIDERFACE dataset. Produces boxes')
43 |
44 | rclpy.init(args=args)
45 |
46 | node = DetectionNode(SSD_FACE_DETECTION, 'detection_server')
47 | rclpy.spin(node)
48 |
49 | rclpy.shutdown()
50 |
51 |
52 | if __name__ == '__main__':
53 | main()
54 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_detection_py/tf_detection_py/examples/server.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 Alberto Soragna. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ==============================================================================
15 |
16 | import rclpy
17 |
18 | from tf_detection_py.detection_node import DetectionNode
19 | from tf_detection_py.models import COCO_MOBILENET
20 |
21 |
22 | def main(args=None):
23 |
24 | rclpy.init(args=args)
25 |
26 | node = DetectionNode(COCO_MOBILENET, 'detection_server')
27 | rclpy.spin(node)
28 |
29 | rclpy.shutdown()
30 |
31 |
32 | if __name__ == '__main__':
33 | main()
34 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_interfaces/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package tf_interfaces
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 0.1.0 (2020-06-21)
6 | ------------------
7 | * interface package minor cleanup
8 | * use vision_msgs detection2darray in detection node
9 | * add vision_msgs as dependency and use them for classification
10 | * minor cleanup of package.xml files
11 | * updated the whole repo use ubuntu 18.04, tensorflow 2.0 and ros2 eloquent
12 | * Contributors: Soragna, Alberto
13 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_interfaces/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.5)
2 |
3 | project(tf_interfaces)
4 |
5 | # Default to C++14
6 | if(NOT CMAKE_CXX_STANDARD)
7 | set(CMAKE_CXX_STANDARD 14)
8 | endif()
9 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
10 | add_compile_options(-Wall -Wextra -Wpedantic)
11 | endif()
12 |
13 | find_package(ament_cmake REQUIRED)
14 | find_package(rosidl_default_generators REQUIRED)
15 | find_package(sensor_msgs REQUIRED)
16 | find_package(vision_msgs REQUIRED)
17 |
18 | set(srv_files
19 | "srv/ImageClassification.srv"
20 | "srv/ImageDetection.srv"
21 | )
22 |
23 | rosidl_generate_interfaces(${PROJECT_NAME}
24 | ${srv_files}
25 | DEPENDENCIES sensor_msgs vision_msgs
26 | ADD_LINTER_TESTS
27 | )
28 |
29 | ament_export_dependencies(rosidl_default_runtime)
30 |
31 | ament_package()
32 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_interfaces/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | tf_interfaces
5 | 0.1.0
6 |
7 | Message and service interfaces for ROS 2 Tensorflow
8 |
9 | Alberto Soragna
10 | Alberto Soragna
11 |
12 | Apache License 2.0
13 |
14 | ament_cmake
15 | rosidl_default_generators
16 |
17 | sensor_msgs
18 | vision_msgs
19 |
20 | rosidl_default_runtime
21 | sensor_msgs
22 | vision_msgs
23 |
24 | rosidl_interface_packages
25 |
26 |
27 | ament_cmake
28 |
29 |
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_interfaces/srv/ImageClassification.srv:
--------------------------------------------------------------------------------
1 | sensor_msgs/Image image
2 | ---
3 | vision_msgs/Classification2D classification
--------------------------------------------------------------------------------
/dl/dl-cv/ros2-tensorflow/ros2-tensorflow/tf_interfaces/srv/ImageDetection.srv:
--------------------------------------------------------------------------------
1 | sensor_msgs/Image image
2 | ---
3 | vision_msgs/Detection2DArray detections
--------------------------------------------------------------------------------
/dl/dl-nlp/deepspeech/aplay_out.txt:
--------------------------------------------------------------------------------
1 | **** List of PLAYBACK Hardware Devices ****
2 | card 0: sofhdadsp [sof-hda-dsp], device 0: HDA Analog (*) []
3 | Subdevices: 0/1
4 | Subdevice #0: subdevice #0
5 | card 0: sofhdadsp [sof-hda-dsp], device 1: HDA Digital (*) []
6 | Subdevices: 1/1
7 | Subdevice #0: subdevice #0
8 | card 0: sofhdadsp [sof-hda-dsp], device 3: HDMI1 (*) []
9 | Subdevices: 1/1
10 | Subdevice #0: subdevice #0
11 | card 0: sofhdadsp [sof-hda-dsp], device 4: HDMI2 (*) []
12 | Subdevices: 1/1
13 | Subdevice #0: subdevice #0
14 | card 0: sofhdadsp [sof-hda-dsp], device 5: HDMI3 (*) []
15 | Subdevices: 1/1
16 | Subdevice #0: subdevice #0
17 |
--------------------------------------------------------------------------------
/dl/dl-nlp/deepspeech/arecord_out.txt:
--------------------------------------------------------------------------------
1 | **** List of CAPTURE Hardware Devices ****
2 | card 0: sofhdadsp [sof-hda-dsp], device 0: HDA Analog (*) []
3 | Subdevices: 1/1
4 | Subdevice #0: subdevice #0
5 | card 0: sofhdadsp [sof-hda-dsp], device 1: HDA Digital (*) []
6 | Subdevices: 1/1
7 | Subdevice #0: subdevice #0
8 | card 0: sofhdadsp [sof-hda-dsp], device 6: DMIC (*) []
9 | Subdevices: 1/1
10 | Subdevice #0: subdevice #0
11 | card 0: sofhdadsp [sof-hda-dsp], device 7: DMIC16kHz (*) []
12 | Subdevices: 1/1
13 | Subdevice #0: subdevice #0
14 |
--------------------------------------------------------------------------------
/dl/dl-nlp/deepspeech/entrypoint.sh:
--------------------------------------------------------------------------------
1 | # Cleanup to be "stateless" on startup, otherwise pulseaudio daemon can't start
2 | rm -rf /var/run/pulse /var/lib/pulse /root/.config/pulse
3 |
4 | # Start pulseaudio as system wide daemon; for debugging it helps to start in non-daemon mode
5 | pulseaudio -D --verbose --exit-idle-time=-1 --system --disallow-exit
6 |
7 | # Create a virtual audio source; fixed by adding source master and format
8 | #echo "Creating virtual audio source: "; -> not needed currently
9 | #pactl load-module module-virtual-source master=auto_null.monitor format=s16le source_name=VirtualMic
10 |
11 | # Set VirtualMic as default input source;
12 | #echo "Setting default source: "; -> not needed currently
13 | #pactl set-default-source alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_6__source
14 |
15 | # whatever you'd like to do next
16 | # e.g. npm run start
17 | su - developer
18 |
--------------------------------------------------------------------------------
/dl/dl-nlp/deepspeech/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix" \
34 | --volume="/dev:/dev" \
35 | --volume="/dev/snd:/dev/snd" \
36 | --volume="/etc/machine-id:/etc/machine-id" \
37 | --volume="/run/user/$UID/pulse:/run/user/1000/pulse" \
38 | --volume="/var/lib/dbus:/var/lib/dbus" \
39 | --device /dev/snd \
40 | --net=host \
41 | --privileged \
42 | --gpus all \
43 | --name deepspeech_cont \
44 | deepspeech_img:latest
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/dl/dl-nlp/deepspeech/pa_stable_candidate_v190700_rc2_20210331.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/dl/dl-nlp/deepspeech/pa_stable_candidate_v190700_rc2_20210331.tgz
--------------------------------------------------------------------------------
/dl/dl-nlp/deepspeech/pulse-client.conf:
--------------------------------------------------------------------------------
1 | # Connect to the host's server using the mounted UNIX socket
2 | default-server = unix:/run/user/1000/pulse/native
3 |
4 | # Prevent a server running in the container
5 | autospawn = no
6 | daemon-binary = /bin/true
7 |
8 | # Prevent the use of shared memory
9 | enable-shm = false
10 |
--------------------------------------------------------------------------------
/ros/captoglove/README.md:
--------------------------------------------------------------------------------
1 | # Resources for enabling BLTE
2 | https://www.jaredwolff.com/get-started-with-bluetooth-low-energy/
3 |
--------------------------------------------------------------------------------
/ros/captoglove/configuration.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ./configure -prefix /home/Qt \
3 | -skip qt3d \
4 | -skip qtactiveqt \
5 | -skip qtandroidextras \
6 | -skip qtdatavis3d \
7 | -skip qtdeclarative \
8 | -skip qtgamepad \
9 | -skip qtgraphicaleffects \
10 | -skip qtimageformats \
11 | -skip qtlocation \
12 | -skip qtlottie \
13 | -skip qtmacextras \
14 | -skip qtmultimedia \
15 | -skip qtpurchasing \
16 | -skip qtquick3d \
17 | -skip qtquickcontrols \
18 | -skip qtquickcontrols2 \
19 | -skip qtquicktimeline \
20 | -skip qtremoteobjects \
21 | -skip qtscript \
22 | -skip qtscxml \
23 | -skip qtspeech \
24 | -skip qtsvg \
25 | -skip qttranslations \
26 | -skip qtvirtualkeyboard \
27 | -skip qtwayland \
28 | -skip qtwebchannel \
29 | -skip qtwebengine \
30 | -skip qtwebglplugin \
31 | -skip qtwebsockets \
32 | -skip qtwebview \
33 | -skip qtwinextras \
34 | -skip qtxmlpatterns
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/ros/captoglove/docker_entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | service dbus start
4 | bluetoothd &
5 |
6 | rfkill block bluetooth
7 | service bluetooth stop
8 | rfkill unblock bluetooth
9 | service bluetooth start
10 |
11 | /bin/bash
12 | cd /home/developer
13 |
--------------------------------------------------------------------------------
/ros/captoglove/first_run.sh:
--------------------------------------------------------------------------------
1 | GNU nano 4.8 first_run_cont.sh
2 | #!/usr/bin/bash
3 |
4 | docker run -it --network host --privileged --gpus all \
5 | -e DISPLAY=$DISPLAY \
6 | -v /dev:/dev \
7 | -v /tmp/.X11-unix:/tmp/.X11-unix \
8 | --name captoglove_cont captoglove_img:latest
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ros/ros-kinetic/dynamixel/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 |
3 | docker run -it --network host --privileged --gpus all \
4 | --device=/dev/ttyUSB0 \
5 | -e DISPLAY=$DISPLAY \
6 | -v /dev:/dev \
7 | -v /tmp/.X11-unix:/tmp/.X11-unix \
8 | --name dynamixel_cont dynamixel:kinetic
9 |
--------------------------------------------------------------------------------
/ros/ros-kinetic/moveit_ros/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
33 | --volume="/dev:/dev" \
34 | --net=host \
35 | --privileged \
36 | --gpus all \
37 | --name schunk_kinetic_cont3 \
38 | moveit_gazebo9_img:latest
39 |
40 |
--------------------------------------------------------------------------------
/ros/ros-kinetic/moveit_ros/install_nano.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | wget https://mirror.easyname.at/gnu/nano/nano-4.8.tar.gz
4 | tar -xf nano-4.8.tar.gz
5 | cd nano-4.8
6 | ./configure --enable-utf8
7 | make
8 | sudo apt-get remove nano
9 | sudo make install
10 | source ~/.bashrc
11 |
12 |
--------------------------------------------------------------------------------
/ros/ros-melodic/darknet/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name darknet_ros_cont \
39 | darknet_ros_img:latest
40 |
--------------------------------------------------------------------------------
/ros/ros-melodic/dynamixel/README.md:
--------------------------------------------------------------------------------
1 | # Dynamixel
2 |
3 | This Dockerfile is used to create necessary environment for tasting dynamixel motors.
4 |
5 | ## How to connect motors?
6 |
7 | Connect motors with PC using following [instructions](https://emanual.robotis.com/docs/en/parts/interface/u2d2/),
8 | especially part [2.1.](https://emanual.robotis.com/docs/en/parts/interface/u2d2/#pc-to-dynamixel).
9 |
10 | ## Setup motors
11 |
12 | In order to setup motors, you need to setup motors with [Dynamixel Wizard](https://www.robotis.com/service/download.php?no=1671)
13 | or with RoboPlus manager. After downloading binary of Dynamixel Wizard, install it as follows:
14 |
15 | ```
16 | cd /home/$USER/Downloads
17 | chmod +x DynamixelWizard2Setup_x64
18 | sudo ./DynamixelWizardSetup_x64
19 | ```
20 |
21 | Keep in mind that Dynamixel Wizard has to be used with sudo command in order to be
22 | able to access USB ports.
23 |
24 | ## Setup baudrate and ID for each motor
25 |
26 | In order to use motor controller and other related packages it's neccessary to establish
27 | communication with dynamixel motors and address each properly. To do that, run **Scan**
28 | in Dynamixel Wizard (connect motors properly beforehand) to detect available motors,
29 | their BaudRates and their IDs.
30 |
31 |
32 | ## Connect to motors
33 |
34 | After connecting to motors, you can build and test some stuff in Dockerfile.
35 | In order to do so, run following:
36 | ```
37 | docker build -t dynamixel_img:melodic .
38 | ```
39 |
40 | When image is built, run as follows:
41 | ```
42 | ./first_run.sh
43 | ```
44 |
45 | ## Dynamixels
46 |
47 | In order to check if there are dynamixels present, run following command:
48 |
49 | ```
50 | rosrun dynamixel_workbench_controllers find_dynamixel /dev/ttyUSB0
51 | ```
52 |
53 | ## Manual for dynamixel XL430-W250-T
54 |
55 | [Here](https://emanual.robotis.com/docs/en/dxl/x/xm430-w350/)
56 |
57 | ## Different operating modes
58 |
59 | [Here](https://emanual.robotis.com/docs/en/dxl/x/xm430-w350/#operating-mode11) you can find list of all possible operating modes for Dynamixel.
60 |
61 |
62 |
--------------------------------------------------------------------------------
/ros/ros-melodic/dynamixel/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 |
3 | docker run -it --network host --privileged --gpus all \
4 | -e DISPLAY=$DISPLAY \
5 | -v /dev:/dev \
6 | -v /tmp/.X11-unix:/tmp/.X11-unix \
7 | --name dynamixel_cont dynamixel_img:latest
8 |
--------------------------------------------------------------------------------
/ros/ros-melodic/hpe_ros/README.md:
--------------------------------------------------------------------------------
1 | # Weights
2 |
3 |
4 | Download weights into models folder inside of src folder of hpe_ros_pkg from following [link](https://onedrive.live.com/?authkey=%21AFkTgCsr3CT9%2D%5FA&id=56B9F9C97F261712%2110302&cid=56B9F9C97F261712).
5 |
--------------------------------------------------------------------------------
/ros/ros-melodic/hpe_ros/copy_ssh.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "What's the name of the container where you want to copy ssh keys?"
4 |
5 | read cont_name
6 |
7 | echo "Container name where ssh_config is copied is: $cont_name"
8 |
9 | docker cp /home/$USER/.ssh/id_rsa $cont_name:/root/.ssh
10 |
11 |
--------------------------------------------------------------------------------
/ros/ros-melodic/hpe_ros/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name hpe_ros_cont \
39 | hpe_ros_img:latest
40 |
41 |
42 |
--------------------------------------------------------------------------------
/ros/ros-melodic/mmuav_audio_ros/entrypoint.sh:
--------------------------------------------------------------------------------
1 | # Cleanup to be "stateless" on startup, otherwise pulseaudio daemon can't start
2 | rm -rf /var/run/pulse /var/lib/pulse /root/.config/pulse
3 |
4 | # Start pulseaudio as system wide daemon; for debugging it helps to start in non-daemon mode
5 | pulseaudio -D --verbose --exit-idle-time=-1 --system --disallow-exit
6 |
7 | # Create a virtual audio source; fixed by adding source master and format
8 | #echo "Creating virtual audio source: "; -> not needed currently
9 | #pactl load-module module-virtual-source master=auto_null.monitor format=s16le source_name=VirtualMic
10 |
11 | # Set VirtualMic as default input source;
12 | #echo "Setting default source: "; -> not needed currently
13 | #pactl set-default-source alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_6__source
14 |
15 | # whatever you'd like to do next
16 | # e.g. npm run start
17 | su - developer
18 |
--------------------------------------------------------------------------------
/ros/ros-melodic/mmuav_audio_ros/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix" \
34 | --volume="/dev:/dev" \
35 | --volume="/dev/snd:/dev/snd" \
36 | --volume="/etc/machine-id:/etc/machine-id" \
37 | --volume="/run/user/1000/pulse:/run/user/1000/pulse" \
38 | --volume="/var/lib/dbus:/var/lib/dbus" \
39 | --device /dev/snd \
40 | --net=host \
41 | --privileged \
42 | --gpus all \
43 | --name mmuav_audio_cont \
44 | mmuav_audio_img:latest
45 |
46 |
47 |
48 | #https://stackoverflow.com/questions/64037579/running-pulseaudio-inside-docker-container-to-record-system-audio
49 |
--------------------------------------------------------------------------------
/ros/ros-melodic/mmuav_audio_ros/pa_stable_candidate_v190700_rc2_20210331.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/ros/ros-melodic/mmuav_audio_ros/pa_stable_candidate_v190700_rc2_20210331.tgz
--------------------------------------------------------------------------------
/ros/ros-melodic/mmuav_audio_ros/pulse-client.conf:
--------------------------------------------------------------------------------
1 | # Connect to the host's server using the mounted UNIX socket
2 | default-server = unix:/run/user/1000/pulse/native
3 |
4 | # Prevent a server running in the container
5 | autospawn = no
6 | daemon-binary = /bin/true
7 |
8 | # Prevent the use of shared memory
9 | enable-shm = false
10 |
--------------------------------------------------------------------------------
/ros/ros-melodic/mmuav_intel_ros/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --volume="/dev/dri:/dev/dri" \
36 | --net=host \
37 | --privileged \
38 | --name mmuav_intel_cont \
39 | mmuav_intel_img:latest
40 |
41 |
42 |
--------------------------------------------------------------------------------
/ros/ros-melodic/mmuav_ros/README.md:
--------------------------------------------------------------------------------
1 | # mmuav_gazebo
2 |
3 | This Dockerfile is used to start mmuav_gazebo simulation with corresponding
4 | UAVs.
5 |
6 | # Repos used:
7 |
8 | Main repositories used in this docker are:
9 | * [mmuav_gazebo](https://github.com/larics/mmuav_gazebo.git)
10 | * [rotors_simulator](https://github.com/larics/rotors_simulator.git)
11 | * [mav_comm](https://github.com/larics/mav_comm)
12 |
13 | There is `first_run.sh` script which runs (first time) docker container with GUI
14 | support.
15 |
16 | # Instructions:
17 |
18 | Build Docker image with following command when you're located in folder
19 | containing this Dockerfile:
20 | ```
21 | docker build -t mmuav_img:latest .
22 | ```
23 | After building image, run first_run.sh script to start container `mmuav_cont`
24 | ```
25 | ./first_run.sh
26 | ```
27 |
28 | When you've run (create + start) container, something like this should be
29 | visible:
30 | ```
31 | Permissions:
32 | -rw-r--r-- 1 your_pc_name your_pc_name 52 mar 26 11:53 /tmp/.docker.xauth
33 |
34 | Running docker...
35 | developer@:~/catkin_ws$
36 |
37 | ```
38 |
39 | After that you may need to source `catkin_ws` as follows:
40 | ```
41 | source /home/developer/catkin_ws/devel/setup.bash
42 | ```
43 |
44 | When you've sourced workspace, you can run following launches which
45 | should launch simulation and hoovering example:
46 |
47 | ```
48 | roslaunch mmuav_gazebo uav_attitude_position.launch manipulator_type:="none" manipulator_tool:="none" z:=1.0
49 | ```
50 |
51 | Or if you want manipulator mounted on uav, run following:
52 | ```
53 | roslaunch mmuav_gazebo uav_attitude_position.launch manipulator_type:="wp_manipulator" start_gazebo:=true z:=1.0 manipulator_tool:="rod"
54 | ```
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/ros/ros-melodic/mmuav_ros/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name mmuav_cont \
39 | mmuav_img:latest
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/ros/ros-melodic/moveit_intel_ros/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --device=/dev/dri:/dev/dri \
36 | --net=host \
37 | --privileged \
38 | --gpus all \
39 | --name schunk_melodic_cont2 \
40 | moveit_melodic_img:latest
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/ros/ros-melodic/moveit_intel_ros/install_nano.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | wget https://mirror.easyname.at/gnu/nano/nano-4.8.tar.gz
4 | tar -xf nano-4.8.tar.gz
5 | cd nano-4.8
6 | ./configure --enable-utf8
7 | make
8 | sudo apt-get remove nano
9 | sudo make install
10 | source ~/.bashrc
11 |
--------------------------------------------------------------------------------
/ros/ros-melodic/moveit_ros/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name moveit_melodic_cont \
39 | moveit_melodic_img:latest
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/ros/ros-melodic/moveit_ros/install_nano.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | wget https://mirror.easyname.at/gnu/nano/nano-4.8.tar.gz
4 | tar -xf nano-4.8.tar.gz
5 | cd nano-4.8
6 | ./configure --enable-utf8
7 | make
8 | sudo apt-get remove nano
9 | sudo make install
10 | source ~/.bashrc
11 |
--------------------------------------------------------------------------------
/ros/ros-melodic/raspberryPi/README.txt:
--------------------------------------------------------------------------------
1 | Dockers are not used widely on raspberryPi. Therefore I won't use it for know because they're lacking GUI support which is
2 | absolutely crucial for HMI project for which I plan to use this raspberry.
3 |
4 | There is [this link](https://blog.tomhanoldt.info/dev/docker/docker-on-raspberry-with-gui/) that explains how to setup GUI with docker with portainer, but it could possibly introduce too much of a latency.
5 |
6 | Currently used Raspbian is Buster and I've installed ROS melodic.
7 |
--------------------------------------------------------------------------------
/ros/ros-melodic/realsense_ros/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:bionic
2 |
3 | # Use ARG - persists only during docker build
4 | # https://github.com/moby/moby/issues/4032#issuecomment-192327844
5 | ARG CATKIN_WORKSPACE=catkin_ws
6 | ARG DEBIAN_FRONTEND=noninteractive
7 | ARG HOME=/root
8 | ARG ROS_DISTRO=melodic
9 |
10 |
11 | # Install all the things to stop docker build from breaking
12 | RUN ln -fs /usr/share/zoneinfo/Europe/Zagreb /etc/localtime && \
13 | apt-get update && apt-get install -q -y \
14 | git \
15 | sudo \
16 | lsb-release \
17 | gnupg2 \
18 | apt-utils \
19 | dialog \
20 | curl \
21 | tzdata && \
22 | dpkg-reconfigure --frontend noninteractive tzdata
23 |
24 | # Install ROS
25 | RUN curl https://raw.githubusercontent.com/larics/uav_ros_stack/main/installation/dependencies/ros.sh | bash
26 |
27 | # Install General ROS things
28 | RUN curl https://raw.githubusercontent.com/larics/uav_ros_stack/main/installation/dependencies/general.sh | bash
29 |
30 |
31 | # Install Realsense specific dependencies
32 | RUN apt-get update && \
33 | apt-get install -y \
34 | openssh-server \
35 | libmysqlclient-dev \
36 | ros-$ROS_DISTRO-realsense2-camera \
37 | ros-$ROS_DISTRO-rgbd-launch \
38 | ros-$ROS_DISTRO-realsense2-description \
39 | libglew-dev \
40 | libglfw3 \
41 | libglfw3-dev \
42 | nano
43 |
44 |
45 | # Agent forwarding during docker build https://stackoverflow.com/questions/43418188/ssh-agent-forwarding-during-docker-build
46 | # install ssh client and git
47 | RUN apt-get install openssh-client git
48 |
49 | # download public key for github.com
50 | RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
51 |
52 | # Install workspace
53 | RUN curl https://raw.githubusercontent.com/larics/uav_ros_stack/main/installation/workspace_setup.sh | bash -s $CATKIN_WORKSPACE
54 |
55 | # Set realsesnse rules
56 | RUN curl https://raw.githubusercontent.com/IntelRealSense/librealsense/master/config/99-realsense-libusb.rules >> /etc/udev/rules.d/99-realsense-libusb.rules
57 |
--------------------------------------------------------------------------------
/ros/ros-melodic/realsense_ros/Dockerfile.armv7:
--------------------------------------------------------------------------------
1 | FROM arm32v7/ubuntu:bionic
2 |
3 | # Use ARG - persists only during docker build
4 | # https://github.com/moby/moby/issues/4032#issuecomment-192327844
5 | ARG CATKIN_WORKSPACE=catkin_ws
6 | ARG DEBIAN_FRONTEND=noninteractive
7 | ARG HOME=/root
8 | ARG ROS_DISTRO=melodic
9 |
10 |
11 | # Install all the things to stop docker build from breaking
12 | RUN ln -fs /usr/share/zoneinfo/Europe/Zagreb /etc/localtime && \
13 | apt-get update && apt-get install -q -y \
14 | git \
15 | sudo \
16 | lsb-release \
17 | gnupg2 \
18 | apt-utils \
19 | dialog \
20 | curl \
21 | tzdata && \
22 | dpkg-reconfigure --frontend noninteractive tzdata
23 |
24 | # Install ROS
25 | RUN curl https://raw.githubusercontent.com/larics/uav_ros_stack/main/installation/dependencies/ros.sh | bash
26 |
27 | # Install General ROS things
28 | RUN curl https://raw.githubusercontent.com/larics/uav_ros_stack/main/installation/dependencies/general.sh | bash
29 |
30 |
31 | # Install Realsense specific dependencies
32 | RUN apt-get update && \
33 | apt-get install -y \
34 | openssh-server \
35 | libmysqlclient-dev \
36 | ros-$ROS_DISTRO-realsense2-camera \
37 | ros-$ROS_DISTRO-rgbd-launch \
38 | ros-$ROS_DISTRO-realsense2-description \
39 | libglew-dev \
40 | libglfw3 \
41 | libglfw3-dev \
42 | nano
43 |
44 |
45 | # Agent forwarding during docker build https://stackoverflow.com/questions/43418188/ssh-agent-forwarding-during-docker-build
46 | # install ssh client and git
47 | RUN apt-get install openssh-client git
48 |
49 | # download public key for github.com
50 | RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
51 |
52 | # Install workspace
53 | RUN curl https://raw.githubusercontent.com/larics/uav_ros_stack/main/installation/workspace_setup.sh | bash -s $CATKIN_WORKSPACE
54 |
55 | # Set realsesnse rules
56 | RUN curl https://raw.githubusercontent.com/IntelRealSense/librealsense/master/config/99-realsense-libusb.rules >> /etc/udev/rules.d/99-realsense-libusb.rules
57 |
--------------------------------------------------------------------------------
/ros/ros-melodic/realsense_ros/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | # Hook to the current SSH_AUTH_LOCK - since it changes
20 | # https://www.talkingquickly.co.uk/2021/01/tmux-ssh-agent-forwarding-vs-code/
21 | ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
22 |
23 | echo "Done."
24 | echo ""
25 | echo "Verifying file contents:"
26 | file $XAUTH
27 | echo "--> It should say \"X11 Xauthority data\"."
28 | echo ""
29 | echo "Permissions:"
30 | ls -FAlh $XAUTH
31 | echo ""
32 | echo "Running docker..."
33 |
34 | docker run -it \
35 | --env="DISPLAY=$DISPLAY" \
36 | --env="QT_X11_NO_MITSHM=1" \
37 | --env SSH_AUTH_SOCK=/ssh-agent \
38 | --env XAUTHORITY=${XAUTH} \
39 | --env TERM=xterm-256color \
40 | --volume="/dev:/dev" \
41 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
42 | --volume ~/.ssh/ssh_auth_sock:/ssh-agent \
43 | --volume $XSOCK:$XSOCK:rw \
44 | --volume $XAUTH:$XAUTH:rw \
45 | --net=host \
46 | --privileged \
47 | --gpus all \
48 | --name ros_realsense_cont \
49 | ros_realsense_img:latest
50 |
51 |
--------------------------------------------------------------------------------
/ros/ros-melodic/schunk_lwa4p_ros/Dockerfile:
--------------------------------------------------------------------------------
1 | # Inheriting ROS melodic image with ROS/Gazebo, can be found in moveit_ros folder
2 | FROM moveit_melodic_img:latest
3 |
4 | RUN sudo apt-get update
5 |
6 | RUN sudo apt-get install -y --no-install-recommends \
7 | ros-${ROS_DISTRO}-canopen-chain-node \
8 | ros-${ROS_DISTRO}-canopen-motor-node \
9 | ros-${ROS_DISTRO}-ros-canopen \
10 | ros-${ROS_DISTRO}-openzen-sensor
11 |
12 | WORKDIR /home/developer/moveit_ws/src
13 |
14 | # Download driver for schunk lwa4p
15 | RUN git clone -b melodic-devel --single-branch https://github.com/fzoric8/schunk_robots.git
16 |
17 | # Download driver for IMUs
18 | RUN git clone --recurse-submodules https://bitbucket.org/lpresearch/openzenros.git
19 |
20 | # Donwload custom ROS package for IMUs
21 | RUN git clone https://github.com/fzoric8/openzen_acore_imu.git
22 |
23 | # Add privileges to serial ports that are used for IMUs --> Needs to be executed everytime when plugged/unpluged - add it to entrypoint script
24 | #RUN sudo chmod 777 /dev/ttyUSB0
25 | #RUN sudo chmod 777 /dev/ttyUSB1
26 | #RUN sudo chmod 777 /dev/ttyUSB2
27 |
28 | # Download driver for tool
29 | WORKDIR /home/developer/moveit_ws/src
30 | RUN bash -c "source /opt/ros/melodic/setup.bash; catkin build"
31 |
32 |
33 | CMD ["bash"]
34 |
--------------------------------------------------------------------------------
/ros/ros-melodic/schunk_lwa4p_ros/README.md:
--------------------------------------------------------------------------------
1 | # Multistage docker image
2 |
3 | Utilizes other Docker image for succesful build.
4 | Image is located in `/docker_files/ros-melodic/moveit_ros` and built under name
5 | `moveit_melodic_img:latest`.
6 |
7 | In order to build this Dockerfile you must build `moveit_melodic_img:latest`
8 | as follows:
9 | ```
10 | cd /docker_files/ros_melodic/moveit_ros
11 | docker build -t moveit_melodic_img:latest .
12 | ```
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ros/ros-melodic/schunk_lwa4p_ros/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name schunk_lwa4p_cont \
39 | schunk_lwa4p_img:latest
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/ros/ros-melodic/tcp_ip_comm/.README.md.swp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/ros/ros-melodic/tcp_ip_comm/.README.md.swp
--------------------------------------------------------------------------------
/ros/ros-melodic/tcp_ip_comm/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
33 | --volume="/dev:/dev" \
34 | --net=host \
35 | --privileged \
36 | --gpus all \
37 | --name danieli_tcp_cont \
38 | danieli_tcp_img:latest
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/ros/ros-melodic/tello/README.md:
--------------------------------------------------------------------------------
1 | #### tello-docker
2 |
3 | This Dockerfile is used to control the dji-tello UAV.
4 |
5 | ## Docker
6 | Install Docker using installation instruction found [here](https://docs.docker.com/engine/install/ubuntu/).
7 |
8 | ## Run Tello in the Docker container
9 |
10 | Clone the [repository](https://github.com/larics/docker_files):
11 | ```
12 | git clone https://github.com/larics/docker_files.git
13 |
14 | ```
15 | Navigate to `ros_melodic` folder:
16 | ```
17 | cd docker_files/ros-melodic
18 |
19 | ```
20 | Add to `~/.bashrc` and source it, or type in the current terminal:
21 | ```
22 | export DOCKER_BUILDKIT=1
23 | ```
24 |
25 | Run Dockerfile from the project root directory using the following commands:
26 | ```bash
27 | # Build a Dockerfile
28 | docker build -t tello_img:latest tello
29 |
30 | # Run the tello_cont container for the fist time
31 | ./tello/first_run.sh
32 |
33 | # This will create docker container tello_cont and position you into the container
34 |
35 | # Start the tello_cont:
36 | docker start -i tello_cont
37 |
38 | # Execute container in terminal while already started in another terminal:
39 | docker exec -it tello_cont bash
40 |
41 | # Stop the conatainer
42 | docker stop tello_cont
43 |
44 | # Delete the container
45 | docker rm tello_cont
46 |
47 | ```
48 | Launch tello_driver in the container:
49 | ```
50 | roslaunch tello_driver tello_node.launch
51 | ```
52 |
53 | Tello driver node is described in [Running the Driver](http://wiki.ros.org/tello_driver).
54 |
55 | You can send commands to tello with joystick with running this node:
56 |
57 | ```
58 | roslaunch med_uav_control tello_joy_override.launch
59 | ```
60 |
--------------------------------------------------------------------------------
/ros/ros-melodic/tello/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --name tello_cont \
38 | tello_img:latest
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/ros/ros-melodic/uam_ros_stack/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM fzoric8/uav_ros_img:latest
2 |
3 | ARG CATKIN_WORKSPACE=uav_ws
4 | ARG DEBIAN_FRONTEND=noninteractive
5 | ARG HOME=/root
6 | ARG ROS_DISTRO=melodic
7 |
8 | ENV NVIDIA_VISIBLE_DEVICES all
9 | ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
10 |
11 | # Install apt packages
12 | RUN apt-get install -y \
13 | nano
14 |
15 | # Install ROS packages
16 | RUN apt-get install -y \
17 | ros-${ROS_DISTRO}-mav-msgs \
18 | ros-${ROS_DISTRO}-moveit \
19 | ros-${ROS_DISTRO}-moveit-core \
20 | ros-${ROS_DISTRO}-moveit-ros-planning \
21 | ros-${ROS_DISTRO}-moveit-ros-planning-interface \
22 | ros-${ROS_DISTRO}-moveit-ros-perception \
23 | ros-${ROS_DISTRO}-moveit-visual-tools \
24 | ros-${ROS_DISTRO}-dynamixel-workbench-msgs \
25 | ros-${ROS_DISTRO}-moveit-ros-visualization \
26 | ros-${ROS_DISTRO}-ros-controllers \
27 | ros-${ROS_DISTRO}-joint-trajectory-controller
28 |
29 | # Create new workspace for aerial manipulator
30 | RUN mkdir -p $HOME/uam_ws/src
31 | WORKDIR $HOME/uam_ws/src
32 | # ardupilot_models
33 | RUN --mount=type=ssh git clone git@github.com:larics/ardupilot_gazebo -b fzoric/devel
34 | # uam_ctl
35 | RUN echo "TEST"
36 | RUN --mount=type=ssh git clone git@github.com:fzoric8/uam_ros_pkg.git
37 | # aerial_manipulators
38 | RUN --mount=type=ssh git clone git@github.com:larics/aerial_manipulators -b fzoric/devel
39 | WORKDIR $HOME/uam_ws/
40 | RUN bash -c "source /opt/ros/melodic/setup.bash; source ~/.bashrc; catkin build"
41 |
42 | # Add localhost for it
43 | RUN echo "export ROS_MASTER_URI=http://127.0.0.1:11311" >> ~/.bashrc
44 | RUN echo "export ROS_HOSTNAME=127.0.0.1" >> ~/.bashrc
45 | RUN echo "source /root/uam_ws/devel/setup.bash" >> ~/.bashrc
46 |
47 | CMD ["bash"]
48 |
49 |
--------------------------------------------------------------------------------
/ros/ros-melodic/uam_ros_stack/README.md:
--------------------------------------------------------------------------------
1 | # How to build image with SSH keys
2 |
3 |
4 | In order to build docker image with SSH keys, you can use this command:
5 |
6 | ```
7 | DOCKER_BUILDKIT=1 docker build -t --ssh default=${SSH_AUTH_SOCK} .
8 | ```
9 |
10 | You can use ${SSH_AUTH_SOCK} after executing following commands:
11 | ```
12 | eval $(ssh-agent)
13 | ssh-add ~/.ssh/id_rsa
14 | ```
15 |
16 | which basically add your private keys during docker image build.
17 |
18 | # TODO:
19 | - [ ] Move meshes from aerial_manipulators to the uam_ros_pkg
20 | - [ ] Try and run `single_kopterworx` with aerial_manipulator
21 | - [ ] Use it as base image for aerial_manipulation for students
22 |
23 |
--------------------------------------------------------------------------------
/ros/ros-melodic/uam_ros_stack/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name uam_ros_cont \
39 | uam_ros_img:latest
40 |
--------------------------------------------------------------------------------
/ros/ros-melodic/uav_ros_stack/README.md:
--------------------------------------------------------------------------------
1 | # How to build image with SSH keys
2 |
3 |
4 | In order to build docker image with SSH keys, you can use this command:
5 |
6 | ```
7 | DOCKER_BUILDKIT=1 docker build -t --ssh default=${SSH_AUTH_SOCK} .
8 | ```
9 |
10 | You can use ${SSH_AUTH_SOCK} after executing following commands:
11 | ```
12 | eval $(ssh-agent)
13 | ssh-add ~/.ssh/id_rsa
14 | ```
15 |
16 | which basically add your private keys during docker image build.
17 |
18 |
19 | ## TODO:
20 | - [x] Build image with SSH
21 | - [x] Decouple build commands (if one fails, everything fails) (install/catkin build)
22 | - [ ] Squash image and push it on Dockerhub for students
23 | - [ ] Use it as base image for aerial_manipulation for students
24 |
25 |
--------------------------------------------------------------------------------
/ros/ros-melodic/uav_ros_stack/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name new_uav_ros_cont \
39 | uav_ros_img:latest
40 |
--------------------------------------------------------------------------------
/ros/ros-melodic/virtual_uav_bag/README.md:
--------------------------------------------------------------------------------
1 | ## Docker
2 | Install Docker using installation instruction found [here](https://docs.docker.com/engine/install/ubuntu/).
3 |
4 | Run Dockerfile from the project root directory using the following commands:
5 | ```bash
6 | # Build a Dockerfile
7 | docker build -t virtual_uav_bag .
8 |
9 | # Run the virtual_uav_bag_cont container for the fist time
10 | export DOCKER_BUILDKIT=1
11 | ./first_run.sh
12 |
13 | # Run the container
14 | docker start -i virtual_uav_bag_cont
15 |
16 | # Stop the conatainer
17 | docker stop virtual_uav_bag_cont
18 |
19 | # Delete the container
20 | docker rm virtual_uav_bag_cont
21 | ```
--------------------------------------------------------------------------------
/ros/ros-melodic/virtual_uav_bag/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | bash -c "source /opt/ros/melodic/setup.bash; source /root/catkin_ws/devel/setup.bash; roslaunch uav_ros_bridge virtual_uav_mqtt.launch" & \
3 | bash -c "sleep 4; source /opt/ros/melodic/setup.bash; source /root/catkin_ws/devel/setup.bash; rosbag play -l virtual_uav_minimal.bag" & \
4 | bash -c "sleep 4; source /opt/ros/melodic/setup.bash; source /root/catkin_ws/devel/setup.bash; rosbag play -l virtual_uav_video.bag" & \
5 | bash -c "sleep 8; source /opt/ros/melodic/setup.bash; source /root/catkin_ws/devel/setup.bash; rosrun image_transport republish compressed in:=/usb_cam/image_raw raw out:=/usb_cam/image_raw" & \
6 | bash -c "sleep 4; source /opt/ros/melodic/setup.bash; source /root/catkin_ws/devel/setup.bash; rosbag play -l virtual_uav_qr_code.bag"
--------------------------------------------------------------------------------
/ros/ros-melodic/virtual_uav_bag/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | # Hook to the current SSH_AUTH_LOCK - since it changes
20 | # https://www.talkingquickly.co.uk/2021/01/tmux-ssh-agent-forwarding-vs-code/
21 | #ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
22 |
23 | echo "Done."
24 | echo ""
25 | echo "Verifying file contents:"
26 | file $XAUTH
27 | echo "--> It should say \"X11 Xauthority data\"."
28 | echo ""
29 | echo "Permissions:"
30 | ls -FAlh $XAUTH
31 | echo ""
32 | echo "Running docker..."
33 |
34 | docker run -it \
35 | --net=host \
36 | --privileged \
37 | --name virtual_uav_bag_cont \
38 | virtual_uav_bag:latest
--------------------------------------------------------------------------------
/ros/ros-noetic/bebop_autonomy/README.md:
--------------------------------------------------------------------------------
1 | ## Docker
2 | Install Docker using installation instruction found [here](https://docs.docker.com/engine/install/ubuntu/).
3 |
4 | ## Run Parrot Bebop in the Docker container
5 |
6 | Clone the [repository](https://github.com/larics/docker_files):
7 | ```
8 | git clone https://github.com/larics/docker_files.git
9 |
10 | ```
11 | Navigate to `ros_noetic` folder:
12 | ```
13 | cd docker_files/ros-noetic
14 |
15 | ```
16 | Add to `~/.bashrc` and source it, or type in the current terminal:
17 | ```
18 | export DOCKER_BUILDKIT=1
19 | ```
20 |
21 | Run Dockerfile from the project root directory using the following commands:
22 | ```bash
23 | # Build a Dockerfile
24 | docker build -t bebop_img bebop_autonomy
25 |
26 | # Run the bebop_cont container for the fist time
27 | ./bebop_autonomy/first_run.sh
28 |
29 | # This will create docker container bebop_cont and position you into the container
30 |
31 | # Start the bebop_cont:
32 | docker start -i bebop_cont
33 |
34 | # Stop the conatainer
35 | docker stop bebop_cont
36 |
37 | # Delete the container
38 | docker rm bebop_cont
39 |
40 | ```
41 | Launch bebop_driver in the container:
42 | ```
43 | roslaunch bebop_driver bebop_node.launch
44 | ```
45 | General information about Parrot Bebop can be found [here](https://bebop-autonomy.readthedocs.io/en/latest/).
46 |
47 | Bebop driver node is described in [Running the Driver](https://bebop-autonomy.readthedocs.io/en/latest/running.html).
48 |
49 | You can send commands to Bebop as shown in [Sending Commands to Bebop](https://bebop-autonomy.readthedocs.io/en/latest/piloting.html).
--------------------------------------------------------------------------------
/ros/ros-noetic/bebop_autonomy/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name bebop_cont \
39 | bebop_img:latest
40 |
41 |
42 |
--------------------------------------------------------------------------------
/ros/ros-noetic/bebop_autonomy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
11 |
--------------------------------------------------------------------------------
/ros/ros-noetic/for_course_lab/or2223/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="TERM=xterm-256color" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix" \
34 | --volume="/dev:/dev" \
35 | --volume="/var/run/dbus/:/var/run/dbus/:z" \
36 | --net=host \
37 | --privileged \
38 | --gpus all \
39 | --name for_cont \
40 | for_img:latest
41 |
--------------------------------------------------------------------------------
/ros/ros-noetic/for_course_lab/or2223/to_copy/aliases:
--------------------------------------------------------------------------------
1 | alias re-source='source ~/.bashrc'
2 | alias ra='. ranger'
3 | alias cbt='catkin build --this'
4 |
5 | # allows killing process with all its children
6 | killp() {
7 |
8 | if [ $# -eq 0 ]; then
9 | echo "The command killp() needs an argument, but none was provided!"
10 | return
11 | else
12 | pes=$1
13 | fi
14 |
15 | for child in $(ps -o pid,ppid -ax | \
16 | awk "{ if ( \$2 == $pes ) { print \$1 }}")
17 | do
18 | # echo "Killing child process $child because ppid = $pes"
19 | killp $child
20 | done
21 |
22 | # echo "killing $1"
23 | kill -9 "$1" > /dev/null 2> /dev/null
24 | }
25 |
26 | waitForRos() {
27 | until rostopic list > /dev/null 2>&1; do
28 | echo "waiting for ros"
29 | sleep 1;
30 | done
31 | }
--------------------------------------------------------------------------------
/ros/ros-noetic/for_course_lab/or2223/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/ros/ros-noetic/for_course_lab/or2223/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/ros/ros-noetic/for_course_lab/or2223/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/ros/ros-noetic/for_course_lab/or2324/README.md:
--------------------------------------------------------------------------------
1 | # Fundamentals of Robotics 2023/2024
2 |
3 | This folder contains Dockerfile for the Fundamentals of Robotics 2023/2024.
4 |
5 | You can build docker image from Dockerfile with:
6 | ```
7 | docker build -t for_img .
8 | ```
9 |
10 | After building docker image, you can use `first_run.sh` script to create container.
11 | Bash script `first_run.sh` has all arguments needed to enable starting gazebo, using USB/other
12 | PC input/outputs as well as access to internet.
13 |
14 | After creating container, you can start it with:
15 | ```
16 | docker start -i for_2324_cont
17 | ```
18 |
19 | When you've started container, you can open it in your bash window with:
20 | ```
21 | docker exec -it for_2324_cont bash
22 | ```
23 |
24 | When you finish working with docker image, you can close it with:
25 | ```
26 | docker stop for_2324_cont
27 | ```
28 |
29 |
--------------------------------------------------------------------------------
/ros/ros-noetic/for_course_lab/or2324/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="TERM=xterm-256color" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix" \
34 | --volume="/dev:/dev" \
35 | --volume="/var/run/dbus/:/var/run/dbus/:z" \
36 | --net=host \
37 | --privileged \
38 | --gpus all \
39 | --name for_2324_cont \
40 | for_img:latest
41 |
--------------------------------------------------------------------------------
/ros/ros-noetic/for_course_lab/or2324/to_copy/aliases:
--------------------------------------------------------------------------------
1 | alias re-source='source ~/.bashrc'
2 | alias ra='. ranger'
3 | alias cbt='catkin build --this'
4 |
5 | # allows killing process with all its children
6 | killp() {
7 |
8 | if [ $# -eq 0 ]; then
9 | echo "The command killp() needs an argument, but none was provided!"
10 | return
11 | else
12 | pes=$1
13 | fi
14 |
15 | for child in $(ps -o pid,ppid -ax | \
16 | awk "{ if ( \$2 == $pes ) { print \$1 }}")
17 | do
18 | # echo "Killing child process $child because ppid = $pes"
19 | killp $child
20 | done
21 |
22 | # echo "killing $1"
23 | kill -9 "$1" > /dev/null 2> /dev/null
24 | }
25 |
26 | waitForRos() {
27 | until rostopic list > /dev/null 2>&1; do
28 | echo "waiting for ros"
29 | sleep 1;
30 | done
31 | }
--------------------------------------------------------------------------------
/ros/ros-noetic/for_course_lab/or2324/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/ros/ros-noetic/for_course_lab/or2324/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/ros/ros-noetic/for_course_lab/or2324/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/ros/ros-noetic/moveit_ros/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name moveit_noetic_cont \
39 | moveit_noetic_img:latest
40 |
41 |
42 |
--------------------------------------------------------------------------------
/ros/ros-noetic/moveit_ros/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
11 |
--------------------------------------------------------------------------------
/ros/ros-noetic/moveit_ros/vimrc:
--------------------------------------------------------------------------------
1 | set nocompatible " be iMproved, required
2 | filetype off " required
3 |
4 | set encoding=utf-8
5 |
6 | " set the runtime path to include Vundle and initialize
7 | set rtp+=~/.vim/bundle/Vundle.vim
8 | call vundle#begin()
9 | " alternatively, pass a path where Vundle should install plugins
10 | "call vundle#begin('~/some/path/here')
11 |
12 | " let Vundle manage Vundle, required
13 | Plugin 'VundleVim/Vundle.vim'
14 |
15 | " The following are examples of different formats supported.
16 | " Keep Plugin commands between vundle#begin/end.
17 | " plugin on GitHub repo
18 | Plugin 'tpope/vim-fugitive'
19 | " plugin from http://vim-scripts.org/vim/scripts.html
20 | " Plugin 'L9'
21 | " Git plugin not hosted on GitHub
22 | " Plugin 'git://git.wincent.com/command-t.git'
23 | " git repos on your local machine (i.e. when working on your own plugin)
24 | " Plugin 'file:///home/gmarik/path/to/plugin'
25 | " The sparkup vim script is in a subdirectory of this repo called vim.
26 | " Pass the path to set the runtimepath properly.
27 | Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
28 | " Install L9 and avoid a Naming conflict if you've already installed a
29 | " different version somewhere else.
30 | " Plugin 'ascenator/L9', {'name': 'newL9'}
31 | Plugin 'ycm-core/YouCompleteMe'
32 |
33 | Plugin 'preservim/nerdtree'
34 |
35 | " All of your Plugins must be added before the following line
36 | call vundle#end() " required
37 | filetype plugin indent on " required
38 | " To ignore plugin indent changes, instead use:
39 | "filetype plugin on
40 | "
41 | " Brief help
42 | " :PluginList - lists configured plugins
43 | " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
44 | " :PluginSearch foo - searches for foo; append `!` to refresh local cache
45 | " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
46 | "
47 | " see :h vundle for more details or wiki for FAQ
48 | " Put your non-Plugin stuff after this line
49 |
50 |
--------------------------------------------------------------------------------
/ros/ros-noetic/mrs_course_project/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="TERM=xterm-256color" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix" \
34 | --volume="/dev:/dev" \
35 | --volume="/var/run/dbus/:/var/run/dbus/:z" \
36 | --net=host \
37 | --privileged \
38 | --gpus all \
39 | --name mrs_project_2 \
40 | mrs_project_img_2:latest
41 |
--------------------------------------------------------------------------------
/ros/ros-noetic/mrs_course_project/to_copy/aliases:
--------------------------------------------------------------------------------
1 | alias re-source='source ~/.bashrc'
2 | alias ra='. ranger'
3 | alias cbt='catkin build --this'
4 |
5 | # allows killing process with all its children
6 | killp() {
7 |
8 | if [ $# -eq 0 ]; then
9 | echo "The command killp() needs an argument, but none was provided!"
10 | return
11 | else
12 | pes=$1
13 | fi
14 |
15 | for child in $(ps -o pid,ppid -ax | \
16 | awk "{ if ( \$2 == $pes ) { print \$1 }}")
17 | do
18 | # echo "Killing child process $child because ppid = $pes"
19 | killp $child
20 | done
21 |
22 | # echo "killing $1"
23 | kill -9 "$1" > /dev/null 2> /dev/null
24 | }
25 |
26 | waitForRos() {
27 | until rostopic list > /dev/null 2>&1; do
28 | echo "waiting for ros"
29 | sleep 1;
30 | done
31 | }
--------------------------------------------------------------------------------
/ros/ros-noetic/mrs_course_project/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/ros/ros-noetic/mrs_course_project/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/ros/ros-noetic/mrs_course_project/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/ros/ros-noetic/px4-sitl/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
11 |
--------------------------------------------------------------------------------
/ros/ros-noetic/realsense_ros/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | # Hook to the current SSH_AUTH_LOCK - since it changes
20 | # https://www.talkingquickly.co.uk/2021/01/tmux-ssh-agent-forwarding-vs-code/
21 | ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
22 |
23 | echo "Done."
24 | echo ""
25 | echo "Verifying file contents:"
26 | file $XAUTH
27 | echo "--> It should say \"X11 Xauthority data\"."
28 | echo ""
29 | echo "Permissions:"
30 | ls -FAlh $XAUTH
31 | echo ""
32 | echo "Running docker..."
33 |
34 | docker run -it \
35 | --env="DISPLAY=$DISPLAY" \
36 | --env="QT_X11_NO_MITSHM=1" \
37 | --env SSH_AUTH_SOCK=/ssh-agent \
38 | --env XAUTHORITY=${XAUTH} \
39 | --env TERM=xterm-256color \
40 | --volume="/dev:/dev" \
41 | --volume="/tmp/.X11-unix:/tmp/.X11-unix" \
42 | --volume ~/.ssh/ssh_auth_sock:/ssh-agent \
43 | --net=host \
44 | --privileged \
45 | --gpus all \
46 | --name realsense_ros_cont \
47 | realsense_img:noetic
48 |
49 |
--------------------------------------------------------------------------------
/ros/ros-noetic/speech-recog/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name speech_rec_cont \
39 | speech_rec:latest
40 |
--------------------------------------------------------------------------------
/ros/ros-noetic/speech-recog/pa_stable_candidate_v190700_rc2_20210331.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/ros/ros-noetic/speech-recog/pa_stable_candidate_v190700_rc2_20210331.tgz
--------------------------------------------------------------------------------
/ros/ros-noetic/uam_ros_stack/README.md:
--------------------------------------------------------------------------------
1 | # How to build image with SSH keys
2 |
3 |
4 | In order to build docker image with SSH keys, you can use this command:
5 |
6 | ```
7 | DOCKER_BUILDKIT=1 docker build -t --ssh default=${SSH_AUTH_SOCK} .
8 | ```
9 |
10 | You can use ${SSH_AUTH_SOCK} after executing following commands:
11 | ```
12 | eval $(ssh-agent)
13 | ssh-add ~/.ssh/id_rsa
14 | ```
15 | To be consistent with the `first_run.sh` run:
16 | ```
17 | DOCKER_BUILDKIT=1 docker build -t uam_ros_img:latest --ssh default=${SSH_AUTH_SOCK} .
18 | ```
19 | which enables cloning repos that require ssh keys (git@github.com format).
20 |
21 | After building docker image, you can run it with:
22 | ```
23 | ./first_run.sh
24 | ```
25 |
26 | In order to run aerial manipulator run following script
27 | ```
28 | cd /root/uav_ros_simulation/startup/kopterworx_arm_one_flying
29 | ./start.sh
30 | ```
31 |
32 | By default it starts tmuxintor.
33 |
34 | Navigate tmuxinator panes with:
35 | ```
36 | Ctrl + B and then arrow (if you want to switch between panes)
37 | Ctrl + B and then number (4 for example arm pane)
38 | ```
39 |
40 | Ctrl + B don't have to be pressed simultaneousy. Press Ctrl,
41 | and then press B.
42 |
--------------------------------------------------------------------------------
/ros/ros-noetic/uam_ros_stack/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name uam_ros_cont \
39 | uam_ros_img:latest
40 |
--------------------------------------------------------------------------------
/ros/ros-noetic/ur/docker_build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | DOCKERFILE=Dockerfile
4 | IMAGE_NAME=ur
5 |
6 | distro="noetic"
7 | ros_distro="focal"
8 | build_args=""
9 | for (( i=1; i<=$#; i++));
10 | do
11 | param="${!i}"
12 | echo $param
13 |
14 | if [ "$param" == "--bionic" ]; then
15 | distro="bionic"
16 | ros_distro="melodic"
17 | fi
18 |
19 | if [ "$param" == "--focal" ]; then
20 | distro="focal"
21 | ros_distro="noetic"
22 | fi
23 |
24 | if [ "$param" == "--dockerfile" ]; then
25 | j=$((i+1))
26 | DOCKERFILE="${!j}"
27 | fi
28 |
29 | if [ "$param" == "--image-name" ]; then
30 | j=$((i+1))
31 | IMAGE_NAME="${!j}"
32 | fi
33 |
34 | if [ "$param" == "--build-args" ]; then
35 | j=$((i+1))
36 | build_args="${!j}"
37 | fi
38 |
39 | done
40 |
41 | echo "Building $IMAGE_NAME image for $distro / $ros_distro with additional docker arguments $build_args."
42 | echo "Dockerfile: $DOCKERFILE"
43 |
44 | # export BUILDKIT_PROGRESS=plain
45 | export DOCKER_BUILDKIT=1
46 | docker build \
47 | $build_args \
48 | --build-arg ROS_DISTRO=$ros_distro \
49 | --build-arg DISTRO=$distro \
50 | --build-arg ROS_HOSTNAME=$ROS_HOSTNAME \
51 | --build-arg ROS_MASTER_URI=$ROS_MASTER_URI \
52 | --build-arg ROS_IP=$ROS_IP \
53 | -f $DOCKERFILE \
54 | --ssh default \
55 | -t $IMAGE_NAME:$distro .
56 |
--------------------------------------------------------------------------------
/ros/ros-noetic/ur/docker_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | XSOCK=/tmp/.X11-unix
4 | XAUTH=/tmp/.docker.xauth
5 | touch $XAUTH
6 | xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
7 |
8 | echo "Running Docker Container"
9 | CONTAINER_NAME=ur
10 |
11 | # Get distro of the built image
12 | distro=$(docker images $CONTAINER_NAME | tail -n1 | awk '{print $2}')
13 | run_args=""
14 |
15 | for (( i=1; i<=$#; i++));
16 | do
17 | param="${!i}"
18 |
19 | if [ "$param" == "--bionic" ]; then
20 | distro="bionic"
21 | fi
22 |
23 | if [ "$param" == "--focal" ]; then
24 | distro="focal"
25 | fi
26 |
27 | if [ "$param" == "--focal-nogpu" ]; then
28 | distro="focal-nogpu"
29 | fi
30 |
31 | if [ "$param" == "--run-args" ]; then
32 | j=$((i+1))
33 | run_args="${!j}"
34 | fi
35 |
36 | done
37 |
38 | echo "Running in $distro"
39 |
40 | # Check if there is an already running container with the same distro
41 | full_container_name="${CONTAINER_NAME}_${distro}"
42 | running_container="$(docker container ls -al | grep $full_container_name)"
43 | if [ -z "$running_container" ]; then
44 | echo "Running $full_container_name for the first time!"
45 | else
46 | echo "Found an open $full_container_name container. Starting and attaching!"
47 | eval "docker start $full_container_name"
48 | eval "docker attach $full_container_name"
49 | exit 0
50 | fi
51 |
52 | # Check if using GPU
53 | gpu_enabled="--gpus all"
54 | if [ "$distro" == "focal-nogpu" ]; then
55 | gpu_enabled=""
56 | fi
57 | run_args="$gpu_enabled $run_args"
58 |
59 | docker run \
60 | $run_args \
61 | -it \
62 | --network host \
63 | --privileged \
64 | --volume=$XSOCK:$XSOCK:rw \
65 | --volume=$XAUTH:$XAUTH:rw \
66 | --env="XAUTHORITY=${XAUTH}" \
67 | --volume /dev:/dev \
68 | --volume /tmp/.x11-unix:/tmp/.x11-unix \
69 | --volume ~/.ssh/ssh_auth_sock:/ssh-agent \
70 | --volume $HOME/bags:/root/bags \
71 | --volume $HOME/rosbag_default:/root/rosbag_default \
72 | --env SSH_AUTH_SOCK=/ssh-agent \
73 | --env DISPLAY=$DISPLAY \
74 | --env TERM=xterm-256color \
75 | --name $full_container_name \
76 | ur:$distro \
77 | /bin/bash
78 |
--------------------------------------------------------------------------------
/ros/ros-noetic/ur/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
11 |
--------------------------------------------------------------------------------
/ros/ros-noetic/watchplant_demo/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="TERM=xterm-256color" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --name wp_demo \
38 | wp_demo_img:latest
39 |
--------------------------------------------------------------------------------
/ros/ros-noetic/watchplant_demo/to_copy/aliases:
--------------------------------------------------------------------------------
1 | alias re-source='source ~/.bashrc'
2 | alias ra='. ranger'
3 | alias cbt='catkin build --this'
4 |
5 | # allows killing process with all its children
6 | killp() {
7 |
8 | if [ $# -eq 0 ]; then
9 | echo "The command killp() needs an argument, but none was provided!"
10 | return
11 | else
12 | pes=$1
13 | fi
14 |
15 | for child in $(ps -o pid,ppid -ax | \
16 | awk "{ if ( \$2 == $pes ) { print \$1 }}")
17 | do
18 | # echo "Killing child process $child because ppid = $pes"
19 | killp $child
20 | done
21 |
22 | # echo "killing $1"
23 | kill -9 "$1" > /dev/null 2> /dev/null
24 | }
25 |
26 | waitForRos() {
27 | until rostopic list > /dev/null 2>&1; do
28 | echo "waiting for ros"
29 | sleep 1;
30 | done
31 | }
--------------------------------------------------------------------------------
/ros/ros-noetic/watchplant_demo/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/ros/ros-noetic/watchplant_demo/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/ros/ros-noetic/watchplant_demo/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/ros/ros-noetic/watchplant_demo/to_copy/ros_setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ip=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p')
3 | export ROS_MASTER_URI=http://$ip:11311
4 | export ROS_IP=$ip
5 |
6 |
--------------------------------------------------------------------------------
/ros1ros2/ros-noetic-foxy/base_image/README.md:
--------------------------------------------------------------------------------
1 | # ROS Noetic + ROS2 Foxy on Ubuntu 20.04
2 | This Docker file does the following:
3 | - Installs ROS and ROS2 on Ubuntu 20.04. from the official repositories (apt install)
4 | - Creates empty workspaces for ROS and ROS 2.
5 | - Installs ros1_bridge from source.
6 | - Allows running ROS and ROS2 nodes in the same container, or in separate containers.
7 | - Shows how to forward an ssh agent into the container, so that you can use ssh keys from the host (i.e., you can use your ssh key to clone private repositories from inside the container).
8 | - Uses cool tools such as tmux, tmuxinator, and ranger with custom bindings (see [to_copy](to_copy)).
9 | - Uses cool aliases for ROS and ROS2 commands such as `killp`, `waitForRos`, and better `colcon` that works from anywhere in the workspace (see [aliases](to_copy/aliases)).
10 |
11 | ## Usage
12 | ### Build
13 | ```bash
14 | docker build -t ros_noetic_foxy:latest .
15 | ```
16 |
17 | ### Run
18 | ```bash
19 | bash run_docker.sh ros_noetic_foxy:latest
20 | ```
21 |
22 | ### Start
23 | ```bash
24 | bash start_docker.sh
25 | ```
26 |
27 | ### Running ros1_bridge
28 | Instructions to come. In the meantime, see [official tutorial](https://github.com/ros2/ros1_bridge/blob/master/README.md).
29 |
30 | ## Important note
31 | Due to the very specific requirements of ros1_bridge, ROS and ROS 2 are not sourced by default using the `.bashrc`. Remember to source them manually in each terminal you open. For convenience, you can use the `source_ros1`, `source_ros1ws`, `source_ros2`, and `source_ros2ws` aliases.
32 |
33 |
34 | ## TODO:
35 | - [ ] Make ROS distros configurable. Currently they are hardcoded to noetic and foxy.
--------------------------------------------------------------------------------
/ros1ros2/ros-noetic-foxy/base_image/run_docker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | CONTAINER_NAME=$1
4 | IMAGE_NAME=$2
5 |
6 | # Hook to the current SSH_AUTH_LOCK - since it changes
7 | # https://www.talkingquickly.co.uk/2021/01/tmux-ssh-agent-forwarding-vs-code/
8 | ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
9 |
10 | docker run \
11 | -it \
12 | --network host \
13 | --privileged \
14 | --volume /dev:/dev \
15 | --volume /tmp/.x11-unix:/tmp/.x11-unix \
16 | --volume ~/.ssh/ssh_auth_sock:/ssh-agent \
17 | --env SSH_AUTH_SOCK=/ssh-agent \
18 | --env display=$display \
19 | --env TERM=xterm-256color \
20 | --name $CONTAINER_NAME \
21 | $IMAGE_NAME \
22 | /bin/bash
--------------------------------------------------------------------------------
/ros1ros2/ros-noetic-foxy/base_image/start_docker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | CONTAINER_NAME=$1
4 |
5 | ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
6 | docker start $CONTAINER_NAME
7 | docker attach $CONTAINER_NAME
--------------------------------------------------------------------------------
/ros1ros2/ros-noetic-foxy/base_image/to_copy/build_bridge.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | cd ${ROS2_WS}
4 | source ${ROS2_INSTALL}/setup.bash
5 | source ${ROS2_WS}/install/local_setup.bash
6 | colcon build --packages-skip ros1_bridge
7 | source ${ROS1_INSTALL}/setup.bash
8 | source ${ROS2_INSTALL}/setup.bash
9 | source ${ROS1_WS}/devel/setup.bash
10 | source ${ROS2_WS}/install/local_setup.bash
11 | colcon build --packages-select ros1_bridge --cmake-force-configure
12 |
13 |
--------------------------------------------------------------------------------
/ros1ros2/ros-noetic-foxy/base_image/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/ros1ros2/ros-noetic-foxy/base_image/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/ros1ros2/ros-noetic-foxy/base_image/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/ros1ros2/ros-noetic-foxy/base_image/to_copy/run_bridge.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Source ROS 1 first:
4 | source ${ROS1_INSTALL}/setup.bash
5 | # Source ROS 2 next:
6 | source ${ROS2_INSTALL}/setup.bash
7 | source ${ROS2_WS}/install/local_setup.bash
8 |
9 | export ROS_MASTER_URI=http://localhost:11311
10 | ros2 run ros1_bridge dynamic_bridge --bridge-all-2to1-topics
11 |
12 |
--------------------------------------------------------------------------------
/ros2/ros2-foxy/README.md:
--------------------------------------------------------------------------------
1 | # ROS 2 foxy
2 |
3 | Docker installation of the ROS 2 foxy.
4 |
5 | ## Instructions used
6 |
7 | [ROS 2 installation instructions](https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Colcon-Tutorial.html)
8 |
9 | [Colcon build instructions](https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Colcon-Tutorial.html)
10 |
11 | ## Multi-stage build
12 |
13 | If you want to build gazebo with ROS 2, run following command:
14 | ```
15 | docker build --target ign_gazebo -t ros2_img:foxy .
16 | ```
17 |
18 |
19 | # TODO:
20 | - [x] Build init Dockerfile
21 | - [x] Add multistage build for the ignition gazebo
22 | - [x] Test gazebo
23 | - [x] Add init workspace build
24 | - [ ] Add gazebo_ros_pkgs
25 | - [ ] Add different gazebos
26 |
--------------------------------------------------------------------------------
/ros2/ros2-foxy/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="TERM=xterm-256color" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix" \
34 | --volume="/dev:/dev" \
35 | --volume="/var/run/dbus/:/var/run/dbus/:z" \
36 | --net=host \
37 | --privileged \
38 | --gpus all \
39 | --name ros2_foxy_cont \
40 | ros2_img:foxy
41 |
--------------------------------------------------------------------------------
/ros2/ros2-foxy/to_copy/aliases:
--------------------------------------------------------------------------------
1 | alias re-source='source ~/.bashrc'
2 | alias ra='. ranger'
3 | alias cbt='catkin build --this'
4 |
5 | # allows killing process with all its children
6 | killp() {
7 |
8 | if [ $# -eq 0 ]; then
9 | echo "The command killp() needs an argument, but none was provided!"
10 | return
11 | else
12 | pes=$1
13 | fi
14 |
15 | for child in $(ps -o pid,ppid -ax | \
16 | awk "{ if ( \$2 == $pes ) { print \$1 }}")
17 | do
18 | # echo "Killing child process $child because ppid = $pes"
19 | killp $child
20 | done
21 |
22 | # echo "killing $1"
23 | kill -9 "$1" > /dev/null 2> /dev/null
24 | }
25 |
26 | waitForRos() {
27 | until rostopic list > /dev/null 2>&1; do
28 | echo "waiting for ros"
29 | sleep 1;
30 | done
31 | }
--------------------------------------------------------------------------------
/ros2/ros2-foxy/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/ros2/ros2-foxy/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/ros2/ros2-foxy/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/ros2/ros2-foxy/to_copy/tmux:
--------------------------------------------------------------------------------
1 | ## remap prefix from 'C-b' to 'C-a'
2 | # set-option -g prefix C-a
3 |
4 | ## Terminal colors
5 | set -g default-terminal "screen-256color"
6 | set -g terminal-overrides "xterm-color256:smcup@:rmcup@"
7 |
8 | ## Mouse support
9 | # set -g mouse on
10 |
11 | ## Shortcuts
12 | bind -n S-Left previous-window
13 | bind -n S-Right next-window
14 | bind -n C-Left select-pane -L
15 | bind -n C-Right select-pane -R
16 | bind -n C-Up select-pane -U
17 | bind -n C-Down select-pane -D
18 |
19 | # Remap kill button to ^K
20 | bind-key k \
21 | split-window \; \
22 | setw synchronize-panes on \; \
23 | send-keys "sleep 1; pwd >> /tmp/tmux_restore_path.txt; tmux list-panes -s -F \"#{pane_pid} #{pane_current_command}\" | grep -v tmux | awk '{print $1}' | while read in; do killp \$in; done" C-m exit C-m
24 |
25 | # Toggle synchronize-panes with ^S m
26 | bind s \
27 | set synchronize-panes \;\
28 | display "Sync #{?synchronize-panes,ON,OFF}"
29 |
30 |
31 | ## Status bar design
32 | # Info on left (I don't have a session display for now)
33 | set -g status-left ''
34 |
35 | # loud or quiet?
36 | set-option -g visual-activity off
37 | set-option -g visual-bell off
38 | set-option -g visual-silence off
39 | set-window-option -g monitor-activity off
40 | set-option -g bell-action none
41 |
42 | set -g default-terminal "screen-256color"
43 |
44 | # The modes {
45 | setw -g clock-mode-colour colour135
46 | # }
47 |
48 | # The statusbar {
49 | set -g status-position bottom
50 |
51 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
52 | set -g status-bg colour234
53 | set -g status-fg colour15
54 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
55 |
56 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
57 | set -g status-left "#[fg=colour15,bg=colour26] #S #[fg=colour103,bg=colour236,nobold,nounderscore,noitalics]"
58 | set -g status-right "#[fg=colour239] #(echo $ROS_MASTER_URI) #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour248,bg=colour239] %H:%M #[fg=colour15,bg=colour26] #H"
59 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
60 |
61 | set -g status-right-length 50
62 | set -g status-left-length 20
63 |
64 | setw -g window-status-current-format "#[fg=colour236,bg=colour239,nobold,nounderscore,noitalics]#[fg=colour253,bg=colour239] #I |#[fg=colour253,bg=colour239] #W #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]" # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
65 |
66 | setw -g window-status-format "#[fg=colour244,bg=colour236] #I |#[fg=colour244,bg=colour236] #W " # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
67 | # }
--------------------------------------------------------------------------------
/ros2/ros2-galactic/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name ros2_galactic_cont \
39 | ros2_img:galactic
40 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/crazyflies-sitl/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | # Hook to the current SSH_AUTH_LOCK - since it changes
31 | # https://www.talkingquickly.co.uk/2021/01/tmux-ssh-agent-forwarding-vs-code/
32 | ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
33 |
34 | docker run -it \
35 | --env="DISPLAY=$DISPLAY" \
36 | --env="QT_X11_NO_MITSHM=1" \
37 | --env="TERM=xterm-256color" \
38 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
39 | --volume="/dev:/dev" \
40 | --volume="/var/run/dbus/:/var/run/dbus/:z" \
41 | --volume ~/.ssh/ssh_auth_sock:/ssh-agent \
42 | --env SSH_AUTH_SOCK=/ssh-agent \
43 | --net=host \
44 | --privileged \
45 | --gpus all \
46 | --name crazysim_cont \
47 | crazysim_img
48 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/crazyflies-sitl/to_copy/99-bitcraze.rules:
--------------------------------------------------------------------------------
1 | # Crazyradio (normal operation)
2 | SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev"
3 | # Bootloader
4 | SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="0101", MODE="0664", GROUP="plugdev"
5 | # Crazyflie (over USB)
6 | SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0664", GROUP="plugdev"
--------------------------------------------------------------------------------
/ros2/ros2-humble/crazyflies-sitl/to_copy/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.0.2)
2 | project(pluginlib)
3 |
4 | find_package(catkin REQUIRED COMPONENTS class_loader rosconsole roslib cmake_modules)
5 | find_package(Boost REQUIRED COMPONENTS filesystem)
6 | find_package(TinyXML2 REQUIRED)
7 |
8 | catkin_package(
9 | INCLUDE_DIRS include
10 | CATKIN_DEPENDS class_loader rosconsole roslib
11 | DEPENDS Boost TinyXML2
12 | )
13 |
14 | if(CATKIN_ENABLE_TESTING)
15 | include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TinyXML2_INCLUDE_DIRS})
16 |
17 | add_library(test_plugins EXCLUDE_FROM_ALL SHARED test/test_plugins.cpp)
18 | target_link_libraries(test_plugins ${class_loader_LIBRARIES})
19 |
20 | catkin_add_gtest(${PROJECT_NAME}_utest test/utest.cpp)
21 | if(TARGET ${PROJECT_NAME}_utest)
22 | target_link_libraries(${PROJECT_NAME}_utest ${TinyXML2_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
23 | add_dependencies(${PROJECT_NAME}_utest test_plugins)
24 | endif()
25 |
26 | include(CheckCXXCompilerFlag)
27 | check_cxx_compiler_flag("-std=c++17" COMPILER_SUPPORTS_CXX17)
28 | if(COMPILER_SUPPORTS_CXX17)
29 | catkin_add_gtest(${PROJECT_NAME}_unique_ptr_test test/unique_ptr_test.cpp)
30 | if(TARGET ${PROJECT_NAME}_unique_ptr_test)
31 | target_link_libraries(${PROJECT_NAME}_unique_ptr_test ${TinyXML2_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
32 | set_target_properties(${PROJECT_NAME}_unique_ptr_test PROPERTIES COMPILE_FLAGS -std=c++17 LINK_FLAGS -std=c++17)
33 | add_dependencies(${PROJECT_NAME}_unique_ptr_test test_plugins)
34 | endif()
35 | endif()
36 |
37 | endif()
38 |
39 | install(DIRECTORY include/pluginlib/
40 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
41 |
42 | install(PROGRAMS scripts/pluginlib_headers_migration.py
43 | DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
44 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/crazyflies-sitl/to_copy/_setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/crazyflies-sitl/to_copy/aliases:
--------------------------------------------------------------------------------
1 | alias re-source='source ~/.bashrc'
2 | alias ra='. ranger'
3 | alias cbt='catkin build --this'
4 |
5 | # allows killing process with all its children
6 | killp() {
7 |
8 | if [ $# -eq 0 ]; then
9 | echo "The command killp() needs an argument, but none was provided!"
10 | return
11 | else
12 | pes=$1
13 | fi
14 |
15 | for child in $(ps -o pid,ppid -ax | \
16 | awk "{ if ( \$2 == $pes ) { print \$1 }}")
17 | do
18 | # echo "Killing child process $child because ppid = $pes"
19 | killp $child
20 | done
21 |
22 | # echo "killing $1"
23 | kill -9 "$1" > /dev/null 2> /dev/null
24 | }
25 |
26 | waitForCfGazebo() {
27 | until gz service -l | grep cf > /dev/null 2>&1; do
28 | echo "waiting for a crazyflie in gazebo"
29 | sleep 1;
30 | done
31 | }
32 |
33 | waitForCfsGazebo() {
34 | if [[ -z "$NUM_ROBOTS" ]]; then
35 | waitForCfGazebo
36 | return
37 | fi
38 |
39 | echo "Waiting for $NUM_ROBOTS crazyflies to appear in Gazebo..."
40 |
41 | while true; do
42 | ALL_PRESENT=true
43 |
44 | for ((i=0; i /dev/null 2>&1; do
63 | echo "waiting for ros"
64 | sleep 1;
65 | done
66 | }
67 |
68 | kill_ros2() {
69 | echo "Kill all ros nodes!"
70 | ps aux | grep ros | grep -v grep | awk '{ print "kill -9", $2 }' | sh
71 | }
72 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/crazyflies-sitl/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/ros2/ros2-humble/crazyflies-sitl/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/ros2/ros2-humble/crazyflies-sitl/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/ros2/ros2-humble/crazyflies-sitl/to_copy/ros_comm.patch:
--------------------------------------------------------------------------------
1 | diff --git a/test/test_roscpp/test/src/service_exception.cpp b/test/test_roscpp/test/src/service_exception.cpp
2 | index 4b0a0a93a..5a2a97bf9 100644
3 | --- a/test/test_roscpp/test/src/service_exception.cpp
4 | +++ b/test/test_roscpp/test/src/service_exception.cpp
5 | @@ -43,7 +43,7 @@ public:
6 | protected:
7 | std::list list;
8 | };
9 | -typedef log4cxx::helpers::ObjectPtrT ListAppenderPtr;
10 | +LOG4CXX_PTR_DEF(ListAppender);
11 |
12 | static const char EXCEPTION[] = "custom exception message";
13 |
14 | @@ -64,7 +64,7 @@ TEST(roscpp, ServiceThrowingException)
15 | ros::ServiceServer service = n.advertiseService(SERVICE, throwingService);
16 |
17 | log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger("ros.roscpp");
18 | - ListAppenderPtr appender = new ListAppender();
19 | + ListAppenderPtr appender(new ListAppender());
20 | logger->addAppender(appender);
21 |
22 | ros::ServiceClient client = n.serviceClient(SERVICE, true);
23 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/crazyflies-sitl/to_copy/session.yml:
--------------------------------------------------------------------------------
1 | name: example_session
2 | root: ./
3 | startup_window: crazyflies_start
4 | pre_window: |
5 | source <%= @settings["setup_name"] %>
6 | windows:
7 | - crazyflies_start:
8 | layout: tiled
9 | panes:
10 | - bash ~/CrazySim/crazyflie-firmware/tools/crazyflie-simulation/simulator_files/gazebo/launch/sitl_multiagent_square.sh -n 4 -m crazyflie
11 | - waitForCfsGazebo;sleep 1;ros2 launch crazyflie launch.py backend:=cflib rviz:=True mocap:=False teleop:=False
12 | - history -s "ros2 bag record -s mcap --all"
13 | - history -s "ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap cmd_vel:=/cf_1/cmd_vel"
14 |
15 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/crazyflies-sitl/to_copy/session_bridge.yml:
--------------------------------------------------------------------------------
1 | name: example_session_with_bridge
2 | root: ./
3 | startup_window: crazyflies_start
4 | pre_window: |
5 | source <%= @settings["setup_name"] %>
6 | windows:
7 | - crazyflies_start:
8 | layout: tiled
9 | panes:
10 | - ros2_ws;source_ros2;bash ~/CrazySim/crazyflie-firmware/tools/crazyflie-simulation/simulator_files/gazebo/launch/sitl_multiagent_square.sh -n 4 -m crazyflie
11 | - ros2_ws;source_ros2;waitForCfsGazebo;sleep 1;ros2 launch crazyflie launch.py backend:=cflib rviz:=True mocap:=False teleop:=False
12 | - ros2_ws;source_ros2;history -s "ros2 bag record -s mcap --all"
13 | - ros2_ws;source_ros2;history -s "ros2 topic list"
14 | - ros1_bridge:
15 | layout: tiled
16 | panes:
17 | - source_ros;sleep 10;ros2_ws; ros2 run ros1_bridge dynamic_bridge --bridge-all-topics
18 | - source_ros;roscore
19 | - source_ros;history -s "rostopic list"
20 | - ros2_ws;source_ros2; ros2 launch rosbridge_server rosbridge_websocket_launch.xml #foxglove bridge
21 |
22 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/crazyflies-sitl/to_copy/start.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Absolute path to this script. /home/user/bin/foo.sh
4 | SCRIPT=$(readlink -f $0)
5 | # Absolute path this script is in. /home/user/bin
6 | SCRIPTPATH=`dirname $SCRIPT`
7 | cd "$SCRIPTPATH"
8 |
9 | # remove the old link
10 | rm .tmuxinator.yml
11 |
12 | # link the session file to .tmuxinator.yml
13 | ln session.yml .tmuxinator.yml
14 |
15 | SETUP_NAME=$1
16 | [ -z "$SETUP_NAME" ] && SETUP_NAME=_setup.sh
17 |
18 | # start tmuxinator
19 | tmuxinator example.yml setup_name=$SETUP_NAME
20 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/custom/README.md:
--------------------------------------------------------------------------------
1 | # ROS 2 Humble on Ubuntu 22.04
2 | This Docker file does the following:
3 | - Installs ROS2 on Ubuntu 22.04. from the official repositories (apt install)
4 | - Creates empty workspace for ROS 2.
5 | - Shows how to forward an ssh agent into the container, so that you can use ssh keys from the host (i.e., you can use your ssh key to clone private repositories from inside the container).
6 | - Uses cool tools such as tmux, tmuxinator, and ranger with custom bindings (see [to_copy](to_copy)).
7 | - Uses cool aliases for ROS and ROS2 commands such as `killp`, `waitForRos`, and better `colcon` that works from anywhere in the workspace (see [aliases](to_copy/aliases)).
8 |
9 | ## Usage
10 | ### Build
11 | ```bash
12 | docker build -t ros_humble:latest .
13 | ```
14 |
15 | ### Run
16 | ```bash
17 | bash run_docker.sh ros_humble:latest
18 | ```
19 |
20 | ### Start
21 | ```bash
22 | bash start_docker.sh
23 | ```
--------------------------------------------------------------------------------
/ros2/ros2-humble/custom/run_docker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | CONTAINER_NAME=$1
4 | IMAGE_NAME=$2
5 |
6 | # Hook to the current SSH_AUTH_LOCK - since it changes
7 | # https://www.talkingquickly.co.uk/2021/01/tmux-ssh-agent-forwarding-vs-code/
8 | ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
9 |
10 | docker run \
11 | -it \
12 | --network host \
13 | --privileged \
14 | --volume /dev:/dev \
15 | --volume /tmp/.x11-unix:/tmp/.x11-unix \
16 | --volume ~/.ssh/ssh_auth_sock:/ssh-agent \
17 | --env SSH_AUTH_SOCK=/ssh-agent \
18 | --env DISPLAY=$DISPLAY \
19 | --env TERM=xterm-256color \
20 | --name $CONTAINER_NAME \
21 | $IMAGE_NAME \
22 | /bin/bash
23 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/custom/start_docker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | CONTAINER_NAME=$1
4 |
5 | ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
6 | docker start $CONTAINER_NAME
7 | docker attach $CONTAINER_NAME
--------------------------------------------------------------------------------
/ros2/ros2-humble/custom/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/ros2/ros2-humble/custom/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/ros2/ros2-humble/custom/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/ros2/ros2-humble/custom/to_copy/tmux:
--------------------------------------------------------------------------------
1 | ## remap prefix from 'C-b' to 'C-a'
2 | # set-option -g prefix C-a
3 |
4 | ## Terminal colors
5 | set -g default-terminal "screen-256color"
6 | set -g terminal-overrides "xterm-color256:smcup@:rmcup@"
7 |
8 | ## Mouse support
9 | # set -g mouse on
10 |
11 | ## Shortcuts
12 | bind -n S-Left previous-window
13 | bind -n S-Right next-window
14 | bind -n C-Left select-pane -L
15 | bind -n C-Right select-pane -R
16 | bind -n C-Up select-pane -U
17 | bind -n C-Down select-pane -D
18 |
19 | # Remap kill button to ^K
20 | bind-key k \
21 | split-window \; \
22 | setw synchronize-panes on \; \
23 | send-keys "sleep 1; pwd >> /tmp/tmux_restore_path.txt; tmux list-panes -s -F \"#{pane_pid} #{pane_current_command}\" | grep -v tmux | awk '{print $1}' | while read in; do killp \$in; done" C-m exit C-m
24 |
25 | # Toggle synchronize-panes with ^S m
26 | bind s \
27 | set synchronize-panes \;\
28 | display "Sync #{?synchronize-panes,ON,OFF}"
29 |
30 |
31 | ## Status bar design
32 | # Info on left (I don't have a session display for now)
33 | set -g status-left ''
34 |
35 | # loud or quiet?
36 | set-option -g visual-activity off
37 | set-option -g visual-bell off
38 | set-option -g visual-silence off
39 | set-window-option -g monitor-activity off
40 | set-option -g bell-action none
41 |
42 | set -g default-terminal "screen-256color"
43 |
44 | # The modes {
45 | setw -g clock-mode-colour colour135
46 | # }
47 |
48 | # The statusbar {
49 | set -g status-position bottom
50 |
51 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
52 | set -g status-bg colour234
53 | set -g status-fg colour15
54 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
55 |
56 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
57 | set -g status-left "#[fg=colour15,bg=colour26] #S #[fg=colour103,bg=colour236,nobold,nounderscore,noitalics]"
58 | set -g status-right "#[fg=colour239] #(echo $ROS_MASTER_URI) #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour248,bg=colour239] %H:%M #[fg=colour15,bg=colour26] #H"
59 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
60 |
61 | set -g status-right-length 50
62 | set -g status-left-length 20
63 |
64 | setw -g window-status-current-format "#[fg=colour236,bg=colour239,nobold,nounderscore,noitalics]#[fg=colour253,bg=colour239] #I |#[fg=colour253,bg=colour239] #W #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]" # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
65 |
66 | setw -g window-status-format "#[fg=colour244,bg=colour236] #I |#[fg=colour244,bg=colour236] #W " # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
67 | # }
--------------------------------------------------------------------------------
/ros2/ros2-humble/moveit2/README.md:
--------------------------------------------------------------------------------
1 | # Dockerfile for moveit
2 |
3 | Specify target you want to build.
4 |
5 | If you want to build moveit for the Franka robot call:
6 |
7 | ```
8 | docker build --target real_robot -t : .
9 | ```
10 |
11 | If you want to build docker that has moveit and gazebo, run:
12 |
13 | ```
14 | docker build --target ign_gazebo -t :
15 | ```
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/moveit2/run_docker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | CONTAINER_NAME=$1
4 | IMAGE_NAME=$2
5 |
6 | # Hook to the current SSH_AUTH_LOCK - since it changes
7 | # https://www.talkingquickly.co.uk/2021/01/tmux-ssh-agent-forwarding-vs-code/
8 | ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
9 |
10 | docker run \
11 | -it \
12 | --network host \
13 | --privileged \
14 | --volume /dev:/dev \
15 | --volume /tmp/.x11-unix:/tmp/.x11-unix \
16 | --volume ~/.ssh/ssh_auth_sock:/ssh-agent \
17 | --env SSH_AUTH_SOCK=/ssh-agent \
18 | --env DISPLAY=$DISPLAY \
19 | --env TERM=xterm-256color \
20 | --name $CONTAINER_NAME \
21 | $IMAGE_NAME \
22 | /bin/bash
23 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/moveit2/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/ros2/ros2-humble/moveit2/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/ros2/ros2-humble/moveit2/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/ros2/ros2-humble/moveit2/to_copy/tmux:
--------------------------------------------------------------------------------
1 | ## remap prefix from 'C-b' to 'C-a'
2 | # set-option -g prefix C-a
3 |
4 | ## Terminal colors
5 | set -g default-terminal "screen-256color"
6 | set -g terminal-overrides "xterm-color256:smcup@:rmcup@"
7 |
8 | ## Mouse support
9 | # set -g mouse on
10 |
11 | ## Shortcuts
12 | bind -n S-Left previous-window
13 | bind -n S-Right next-window
14 | bind -n C-Left select-pane -L
15 | bind -n C-Right select-pane -R
16 | bind -n C-Up select-pane -U
17 | bind -n C-Down select-pane -D
18 |
19 | # Remap kill button to ^K
20 | bind-key k \
21 | split-window \; \
22 | setw synchronize-panes on \; \
23 | send-keys "sleep 1; pwd >> /tmp/tmux_restore_path.txt; tmux list-panes -s -F \"#{pane_pid} #{pane_current_command}\" | grep -v tmux | awk '{print $1}' | while read in; do killp \$in; done" C-m exit C-m
24 |
25 | # Toggle synchronize-panes with ^S m
26 | bind s \
27 | set synchronize-panes \;\
28 | display "Sync #{?synchronize-panes,ON,OFF}"
29 |
30 |
31 | ## Status bar design
32 | # Info on left (I don't have a session display for now)
33 | set -g status-left ''
34 |
35 | # loud or quiet?
36 | set-option -g visual-activity off
37 | set-option -g visual-bell off
38 | set-option -g visual-silence off
39 | set-window-option -g monitor-activity off
40 | set-option -g bell-action none
41 |
42 | set -g default-terminal "screen-256color"
43 |
44 | # The modes {
45 | setw -g clock-mode-colour colour135
46 | # }
47 |
48 | # The statusbar {
49 | set -g status-position bottom
50 |
51 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
52 | set -g status-bg colour234
53 | set -g status-fg colour15
54 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
55 |
56 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
57 | set -g status-left "#[fg=colour15,bg=colour26] #S #[fg=colour103,bg=colour236,nobold,nounderscore,noitalics]"
58 | set -g status-right "#[fg=colour239] #(echo $ROS_MASTER_URI) #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour248,bg=colour239] %H:%M #[fg=colour15,bg=colour26] #H"
59 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
60 |
61 | set -g status-right-length 50
62 | set -g status-left-length 20
63 |
64 | setw -g window-status-current-format "#[fg=colour236,bg=colour239,nobold,nounderscore,noitalics]#[fg=colour253,bg=colour239] #I |#[fg=colour253,bg=colour239] #W #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]" # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
65 |
66 | setw -g window-status-format "#[fg=colour244,bg=colour236] #I |#[fg=colour244,bg=colour236] #W " # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
67 | # }
--------------------------------------------------------------------------------
/ros2/ros2-humble/official/README.md:
--------------------------------------------------------------------------------
1 | # How to use preexisting ros-humble image
2 |
3 |
4 | First use docker pull to get ros-humble image from the dockerhub.
5 |
6 | Run following command:
7 | ```
8 | docker pull osrf/ros:humble-desktop
9 | ```
10 |
11 | Rest of the information for the tutorial can be found [here](https://ros2-industrial-workshop.readthedocs.io/en/latest/_source/basics/ROS2-Turtlesim.html).
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/official/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | docker run -it \
31 | --env="DISPLAY=$DISPLAY" \
32 | --env="QT_X11_NO_MITSHM=1" \
33 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
34 | --volume="/dev:/dev" \
35 | --net=host \
36 | --privileged \
37 | --gpus all \
38 | --name ros2_humble_cont \
39 | osrf/ros:humble-desktop
40 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/piper/run_docker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
4 | # Hook to the current SSH_AUTH_LOCK - since it changes
5 | # https://www.talkingquickly.co.uk/2021/01/tmux-ssh-agent-forwarding-vs-code/
6 | ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
7 |
8 | docker run \
9 | -it \
10 | --network host \
11 | --privileged \
12 | --volume /dev:/dev \
13 | --volume /tmp/.x11-unix:/tmp/.x11-unix \
14 | --volume ~/.ssh/ssh_auth_sock:/ssh-agent \
15 | --env SSH_AUTH_SOCK=/ssh-agent \
16 | --env DISPLAY=$DISPLAY \
17 | --env TERM=xterm-256color \
18 | --name piper_cont \
19 | piper_img:humble \
20 | /bin/bash
21 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/piper/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/ros2/ros2-humble/piper/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/ros2/ros2-humble/piper/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/ros2/ros2-humble/piper/to_copy/tmux:
--------------------------------------------------------------------------------
1 | ## remap prefix from 'C-b' to 'C-a'
2 | # set-option -g prefix C-a
3 |
4 | ## Terminal colors
5 | set -g default-terminal "screen-256color"
6 | set -g terminal-overrides "xterm-color256:smcup@:rmcup@"
7 |
8 | ## Mouse support
9 | # set -g mouse on
10 |
11 | ## Shortcuts
12 | bind -n S-Left previous-window
13 | bind -n S-Right next-window
14 | bind -n C-Left select-pane -L
15 | bind -n C-Right select-pane -R
16 | bind -n C-Up select-pane -U
17 | bind -n C-Down select-pane -D
18 |
19 | # Remap kill button to ^K
20 | bind-key k \
21 | split-window \; \
22 | setw synchronize-panes on \; \
23 | send-keys "sleep 1; pwd >> /tmp/tmux_restore_path.txt; tmux list-panes -s -F \"#{pane_pid} #{pane_current_command}\" | grep -v tmux | awk '{print $1}' | while read in; do killp \$in; done" C-m exit C-m
24 |
25 | # Toggle synchronize-panes with ^S m
26 | bind s \
27 | set synchronize-panes \;\
28 | display "Sync #{?synchronize-panes,ON,OFF}"
29 |
30 |
31 | ## Status bar design
32 | # Info on left (I don't have a session display for now)
33 | set -g status-left ''
34 |
35 | # loud or quiet?
36 | set-option -g visual-activity off
37 | set-option -g visual-bell off
38 | set-option -g visual-silence off
39 | set-window-option -g monitor-activity off
40 | set-option -g bell-action none
41 |
42 | set -g default-terminal "screen-256color"
43 |
44 | # The modes {
45 | setw -g clock-mode-colour colour135
46 | # }
47 |
48 | # The statusbar {
49 | set -g status-position bottom
50 |
51 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
52 | set -g status-bg colour234
53 | set -g status-fg colour15
54 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
55 |
56 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
57 | set -g status-left "#[fg=colour15,bg=colour26] #S #[fg=colour103,bg=colour236,nobold,nounderscore,noitalics]"
58 | set -g status-right "#[fg=colour239] #(echo $ROS_MASTER_URI) #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour248,bg=colour239] %H:%M #[fg=colour15,bg=colour26] #H"
59 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
60 |
61 | set -g status-right-length 50
62 | set -g status-left-length 20
63 |
64 | setw -g window-status-current-format "#[fg=colour236,bg=colour239,nobold,nounderscore,noitalics]#[fg=colour253,bg=colour239] #I |#[fg=colour253,bg=colour239] #W #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]" # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
65 |
66 | setw -g window-status-format "#[fg=colour244,bg=colour236] #I |#[fg=colour244,bg=colour236] #W " # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
67 | # }
--------------------------------------------------------------------------------
/ros2/ros2-humble/px4-sitl/README.md:
--------------------------------------------------------------------------------
1 | # PX4-SITL for ROS2
2 |
3 | Run tmuxinator as:
4 |
5 | tmuxinator start px4_ros_start
6 |
7 | ### Params to disable GCS check for take off
8 |
9 | ```
10 | param set NAV_RCL_ACT 0
11 | param set NAV_DLL_ACT 0
12 | ```
13 |
14 | Setting parameters enables arming and takeoff.
15 |
16 | ### Useful info:
17 |
18 | [PX4 - ROS 2 User Guide](https://docs.px4.io/main/en/ros2/user_guide.html#installation-setup)
19 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/px4-sitl/px4_ros_start.yml:
--------------------------------------------------------------------------------
1 | # /home/zozan/.config/tmuxinator/px4_ros_start.yml
2 |
3 | name: px4_ros_start
4 | root: ~/
5 |
6 | # Start local network between two PCs and enable multimaster for exchange of the body pose information
7 | # as fast as possible
8 | on_project_start:
9 | - docker start uav_px4_cont
10 | on_project_exit:
11 | - docker stop uav_px4_cont
12 | windows:
13 | - openpose:
14 | layout: tiled
15 | # Synchronize all panes of this window, can be enabled before or after the pane commands run.
16 | # 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after'
17 | # synchronize: after
18 | panes:
19 | - microagent:
20 | - waitForDockerContainer uav_px4_cont
21 | - docker exec -it uav_px4_cont bash
22 | - cd /root/sitl/PX4-Autopilot; MicroXRCEAgent udp4 -p 8888
23 | - px4_sitl:
24 | - waitForDockerContainer uav_px4_cont
25 | - docker exec -it uav_px4_cont bash
26 | - cd /root/sitl/PX4-Autopilot
27 | - sleep 3
28 | - PX4_GZ_WORLD=walls make px4_sitl gz_x500_depth
29 | - offboard_ctl:
30 | - waitForDockerContainer uav_px4_cont
31 | - docker exec -it uav_px4_cont bash
32 | - sleep 10
33 | - ros2 launch px4_ros_com offboard_control.launch.py
34 | - parameter_bridge:
35 | - waitForDockerContaienr uav_px4_cont
36 | - docker exec -it uav_px4_cont bash
37 | - sleep 10
38 | - ros2 run ros_gz_image image_bridge /world/walls/model/x500_depth_0/link/camera_link/sensor/IMX214/image /rgb_cam/image
39 | - devel_cmd:
40 | - waitForDockerContainer uav_px4_cont
41 | - docker exec -it uav_px4_cont bash
42 | - sleep 15
43 | - echo "Command UAV"
44 | - check_cam:
45 | - waitForDockerContainer uav_px4_cont
46 | - docker exec -it uav_px4_cont bash
47 | - sleep 15
48 | - echo "Check RVIZ2"
49 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/px4-sitl/run_docker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | CONTAINER_NAME=uav_px4_cont
4 | IMAGE_NAME=uav_px4_img:humble
5 |
6 | # Hook to the current SSH_AUTH_LOCK - since it changes
7 | # https://www.talkingquickly.co.uk/2021/01/tmux-ssh-agent-forwarding-vs-code/
8 | ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
9 |
10 | docker run \
11 | -it \
12 | --network host \
13 | --privileged \
14 | --volume /dev:/dev \
15 | --volume /tmp/.x11-unix:/tmp/.x11-unix \
16 | --volume ~/.ssh/ssh_auth_sock:/ssh-agent \
17 | --env SSH_AUTH_SOCK=/ssh-agent \
18 | --env DISPLAY=$DISPLAY \
19 | --env TERM=xterm-256color \
20 | --name $CONTAINER_NAME \
21 | $IMAGE_NAME \
22 | /bin/bash
23 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/px4-sitl/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/ros2/ros2-humble/px4-sitl/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/ros2/ros2-humble/px4-sitl/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/ros2/ros2-humble/px4-sitl/to_copy/tmux:
--------------------------------------------------------------------------------
1 | ## remap prefix from 'C-b' to 'C-a'
2 | # set-option -g prefix C-a
3 |
4 | ## Terminal colors
5 | set -g default-terminal "screen-256color"
6 | set -g terminal-overrides "xterm-color256:smcup@:rmcup@"
7 |
8 | ## Mouse support
9 | # set -g mouse on
10 |
11 | ## Shortcuts
12 | bind -n S-Left previous-window
13 | bind -n S-Right next-window
14 | bind -n C-Left select-pane -L
15 | bind -n C-Right select-pane -R
16 | bind -n C-Up select-pane -U
17 | bind -n C-Down select-pane -D
18 |
19 | # Remap kill button to ^K
20 | bind-key k \
21 | split-window \; \
22 | setw synchronize-panes on \; \
23 | send-keys "sleep 1; pwd >> /tmp/tmux_restore_path.txt; tmux list-panes -s -F \"#{pane_pid} #{pane_current_command}\" | grep -v tmux | awk '{print $1}' | while read in; do killp \$in; done" C-m exit C-m
24 |
25 | # Toggle synchronize-panes with ^S m
26 | bind s \
27 | set synchronize-panes \;\
28 | display "Sync #{?synchronize-panes,ON,OFF}"
29 |
30 |
31 | ## Status bar design
32 | # Info on left (I don't have a session display for now)
33 | set -g status-left ''
34 |
35 | # loud or quiet?
36 | set-option -g visual-activity off
37 | set-option -g visual-bell off
38 | set-option -g visual-silence off
39 | set-window-option -g monitor-activity off
40 | set-option -g bell-action none
41 |
42 | set -g default-terminal "screen-256color"
43 |
44 | # The modes {
45 | setw -g clock-mode-colour colour135
46 | # }
47 |
48 | # The statusbar {
49 | set -g status-position bottom
50 |
51 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
52 | set -g status-bg colour234
53 | set -g status-fg colour15
54 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
55 |
56 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
57 | set -g status-left "#[fg=colour15,bg=colour26] #S #[fg=colour103,bg=colour236,nobold,nounderscore,noitalics]"
58 | set -g status-right "#[fg=colour239] #(echo $ROS_MASTER_URI) #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour248,bg=colour239] %H:%M #[fg=colour15,bg=colour26] #H"
59 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
60 |
61 | set -g status-right-length 50
62 | set -g status-left-length 20
63 |
64 | setw -g window-status-current-format "#[fg=colour236,bg=colour239,nobold,nounderscore,noitalics]#[fg=colour253,bg=colour239] #I |#[fg=colour253,bg=colour239] #W #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]" # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
65 |
66 | setw -g window-status-format "#[fg=colour244,bg=colour236] #I |#[fg=colour244,bg=colour236] #W " # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
67 | # }
--------------------------------------------------------------------------------
/ros2/ros2-humble/robots/README.md:
--------------------------------------------------------------------------------
1 | # Dockerfile for moveit
2 |
3 | Specify target you want to build.
4 |
5 | If you want to build moveit for the Franka robot call:
6 |
7 | ```
8 | docker build --target real_robot -t : .
9 | ```
10 |
11 | If you want to build docker that has moveit and gazebo, run:
12 |
13 | ```
14 | docker build --target ign_gazebo -t :
15 | ```
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/robots/run_docker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | CONTAINER_NAME=$1
4 | IMAGE_NAME=$2
5 |
6 | # Hook to the current SSH_AUTH_LOCK - since it changes
7 | # https://www.talkingquickly.co.uk/2021/01/tmux-ssh-agent-forwarding-vs-code/
8 | ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
9 |
10 | docker run \
11 | -it \
12 | --network host \
13 | --privileged \
14 | --volume /dev:/dev \
15 | --volume /tmp/.x11-unix:/tmp/.x11-unix \
16 | --volume ~/.ssh/ssh_auth_sock:/ssh-agent \
17 | --env SSH_AUTH_SOCK=/ssh-agent \
18 | --env DISPLAY=$DISPLAY \
19 | --env TERM=xterm-256color \
20 | --name $CONTAINER_NAME \
21 | $IMAGE_NAME \
22 | /bin/bash
23 |
--------------------------------------------------------------------------------
/ros2/ros2-humble/robots/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/ros2/ros2-humble/robots/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/ros2/ros2-humble/robots/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/ros2/ros2-humble/robots/to_copy/tmux:
--------------------------------------------------------------------------------
1 | ## remap prefix from 'C-b' to 'C-a'
2 | # set-option -g prefix C-a
3 |
4 | ## Terminal colors
5 | set -g default-terminal "screen-256color"
6 | set -g terminal-overrides "xterm-color256:smcup@:rmcup@"
7 |
8 | ## Mouse support
9 | # set -g mouse on
10 |
11 | ## Shortcuts
12 | bind -n S-Left previous-window
13 | bind -n S-Right next-window
14 | bind -n C-Left select-pane -L
15 | bind -n C-Right select-pane -R
16 | bind -n C-Up select-pane -U
17 | bind -n C-Down select-pane -D
18 |
19 | # Remap kill button to ^K
20 | bind-key k \
21 | split-window \; \
22 | setw synchronize-panes on \; \
23 | send-keys "sleep 1; pwd >> /tmp/tmux_restore_path.txt; tmux list-panes -s -F \"#{pane_pid} #{pane_current_command}\" | grep -v tmux | awk '{print $1}' | while read in; do killp \$in; done" C-m exit C-m
24 |
25 | # Toggle synchronize-panes with ^S m
26 | bind s \
27 | set synchronize-panes \;\
28 | display "Sync #{?synchronize-panes,ON,OFF}"
29 |
30 |
31 | ## Status bar design
32 | # Info on left (I don't have a session display for now)
33 | set -g status-left ''
34 |
35 | # loud or quiet?
36 | set-option -g visual-activity off
37 | set-option -g visual-bell off
38 | set-option -g visual-silence off
39 | set-window-option -g monitor-activity off
40 | set-option -g bell-action none
41 |
42 | set -g default-terminal "screen-256color"
43 |
44 | # The modes {
45 | setw -g clock-mode-colour colour135
46 | # }
47 |
48 | # The statusbar {
49 | set -g status-position bottom
50 |
51 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
52 | set -g status-bg colour234
53 | set -g status-fg colour15
54 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
55 |
56 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
57 | set -g status-left "#[fg=colour15,bg=colour26] #S #[fg=colour103,bg=colour236,nobold,nounderscore,noitalics]"
58 | set -g status-right "#[fg=colour239] #(echo $ROS_MASTER_URI) #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour248,bg=colour239] %H:%M #[fg=colour15,bg=colour26] #H"
59 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
60 |
61 | set -g status-right-length 50
62 | set -g status-left-length 20
63 |
64 | setw -g window-status-current-format "#[fg=colour236,bg=colour239,nobold,nounderscore,noitalics]#[fg=colour253,bg=colour239] #I |#[fg=colour253,bg=colour239] #W #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]" # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
65 |
66 | setw -g window-status-format "#[fg=colour244,bg=colour236] #I |#[fg=colour244,bg=colour236] #W " # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
67 | # }
--------------------------------------------------------------------------------
/ros2/ros2-jazzy/crazyflies/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | XAUTH=/tmp/.docker.xauth
7 |
8 | echo "Preparing Xauthority data..."
9 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
10 | if [ ! -f $XAUTH ]; then
11 | if [ ! -z "$xauth_list" ]; then
12 | echo $xauth_list | xauth -f $XAUTH nmerge -
13 | else
14 | touch $XAUTH
15 | fi
16 | chmod a+r $XAUTH
17 | fi
18 |
19 | echo "Done."
20 | echo ""
21 | echo "Verifying file contents:"
22 | file $XAUTH
23 | echo "--> It should say \"X11 Xauthority data\"."
24 | echo ""
25 | echo "Permissions:"
26 | ls -FAlh $XAUTH
27 | echo ""
28 | echo "Running docker..."
29 |
30 | # Hook to the current SSH_AUTH_LOCK - since it changes
31 | # https://www.talkingquickly.co.uk/2021/01/tmux-ssh-agent-forwarding-vs-code/
32 | ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
33 |
34 | docker run -it \
35 | --env="DISPLAY=$DISPLAY" \
36 | --env="QT_X11_NO_MITSHM=1" \
37 | --env="TERM=xterm-256color" \
38 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
39 | --volume="/dev:/dev" \
40 | --volume="/var/run/dbus/:/var/run/dbus/:z" \
41 | --volume ~/.ssh/ssh_auth_sock:/ssh-agent \
42 | --env SSH_AUTH_SOCK=/ssh-agent \
43 | --net=host \
44 | --privileged \
45 | --gpus all \
46 | --name crazyflies_cont \
47 | crazyflies_img
48 |
--------------------------------------------------------------------------------
/ros2/ros2-jazzy/crazyflies/to_copy/99-bitcraze.rules:
--------------------------------------------------------------------------------
1 | # Crazyradio (normal operation)
2 | SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev"
3 | # Bootloader
4 | SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="0101", MODE="0664", GROUP="plugdev"
5 | # Crazyflie (over USB)
6 | SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0664", GROUP="plugdev"
--------------------------------------------------------------------------------
/ros2/ros2-jazzy/crazyflies/to_copy/99-lps.rules:
--------------------------------------------------------------------------------
1 | SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev"
--------------------------------------------------------------------------------
/ros2/ros2-jazzy/crazyflies/to_copy/_setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
--------------------------------------------------------------------------------
/ros2/ros2-jazzy/crazyflies/to_copy/aliases:
--------------------------------------------------------------------------------
1 | alias re-source='source ~/.bashrc'
2 | alias ra='. ranger'
3 | alias cbt='catkin build --this'
4 |
5 | # allows killing process with all its children
6 | killp() {
7 |
8 | if [ $# -eq 0 ]; then
9 | echo "The command killp() needs an argument, but none was provided!"
10 | return
11 | else
12 | pes=$1
13 | fi
14 |
15 | for child in $(ps -o pid,ppid -ax | \
16 | awk "{ if ( \$2 == $pes ) { print \$1 }}")
17 | do
18 | # echo "Killing child process $child because ppid = $pes"
19 | killp $child
20 | done
21 |
22 | # echo "killing $1"
23 | kill -9 "$1" > /dev/null 2> /dev/null
24 | }
25 |
26 | waitForCfGazebo() {
27 | until gz service -l | grep cf > /dev/null 2>&1; do
28 | echo "waiting for crazyflies in gazebo"
29 | sleep 1;
30 | done
31 | }
32 |
33 | waitForRos() {
34 | until rostopic list > /dev/null 2>&1; do
35 | echo "waiting for ros"
36 | sleep 1;
37 | done
38 | }
39 |
40 | kill_ros2() {
41 | echo "Kill all ros nodes!"
42 | ps aux | grep ros | grep -v grep | awk '{ print "kill -9", $2 }' | sh
43 | }
44 |
--------------------------------------------------------------------------------
/ros2/ros2-jazzy/crazyflies/to_copy/keyboard:
--------------------------------------------------------------------------------
1 | # KEYBOARD CONFIGURATION FILE
2 |
3 | # Consult the keyboard(5) manual page.
4 |
5 | XKBMODEL="pc105"
6 | XKBLAYOUT="hr"
7 | XKBVARIANT=""
8 | XKBOPTIONS=""
9 |
10 | BACKSPACE="guess"
--------------------------------------------------------------------------------
/ros2/ros2-jazzy/crazyflies/to_copy/nanorc:
--------------------------------------------------------------------------------
1 | set linenumbers
2 | set tabsize 4
3 | set tabstospaces
--------------------------------------------------------------------------------
/ros2/ros2-jazzy/crazyflies/to_copy/ranger:
--------------------------------------------------------------------------------
1 | set vcs_aware true
2 | set vcs_backend_git local
--------------------------------------------------------------------------------
/ros2/ros2-jazzy/crazyflies/to_copy/session.yml:
--------------------------------------------------------------------------------
1 | name: example_session
2 | root: ./
3 | startup_window: crazyflies_start
4 | pre_window: |
5 | source <%= @settings["setup_name"] %>
6 | windows:
7 | - crazyflies_start:
8 | layout: tiled
9 | panes:
10 | - ros2 launch crazyflie_examples keyboard_velmux_launch.py
11 | - history -s "ros2 bag record -s mcap --all"
12 | - history -s "ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args"
13 |
14 |
--------------------------------------------------------------------------------
/ros2/ros2-jazzy/crazyflies/to_copy/start.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Absolute path to this script. /home/user/bin/foo.sh
4 | SCRIPT=$(readlink -f $0)
5 | # Absolute path this script is in. /home/user/bin
6 | SCRIPTPATH=`dirname $SCRIPT`
7 | cd "$SCRIPTPATH"
8 |
9 | # remove the old link
10 | rm .tmuxinator.yml
11 |
12 | # link the session file to .tmuxinator.yml
13 | ln session.yml .tmuxinator.yml
14 |
15 | SETUP_NAME=$1
16 | [ -z "$SETUP_NAME" ] && SETUP_NAME=_setup.sh
17 |
18 | # start tmuxinator
19 | tmuxinator example.yml setup_name=$SETUP_NAME
20 |
--------------------------------------------------------------------------------
/ros2/ros2-jazzy/crazyflies/to_copy/tmux:
--------------------------------------------------------------------------------
1 | ## remap prefix from 'C-b' to 'C-a'
2 | # set-option -g prefix C-a
3 |
4 | ## Terminal colors
5 | set -g default-terminal "screen-256color"
6 | set -g terminal-overrides "xterm-color256:smcup@:rmcup@"
7 |
8 | ## Mouse support
9 | # set -g mouse on
10 |
11 | ## Shortcuts
12 | bind -n S-Left previous-window
13 | bind -n S-Right next-window
14 | bind -n C-Left select-pane -L
15 | bind -n C-Right select-pane -R
16 | bind -n C-Up select-pane -U
17 | bind -n C-Down select-pane -D
18 |
19 | # Remap kill button to ^K
20 | bind-key k \
21 | split-window \; \
22 | setw synchronize-panes on \; \
23 | send-keys "sleep 1; pwd >> /tmp/tmux_restore_path.txt; tmux list-panes -s -F \"#{pane_pid} #{pane_current_command}\" | grep -v tmux | awk '{print $1}' | while read in; do killp \$in; done" C-m exit C-m
24 |
25 | # Toggle synchronize-panes with ^S m
26 | bind s \
27 | set synchronize-panes \;\
28 | display "Sync #{?synchronize-panes,ON,OFF}"
29 |
30 |
31 | ## Status bar design
32 | # Info on left (I don't have a session display for now)
33 | set -g status-left ''
34 |
35 | # loud or quiet?
36 | set-option -g visual-activity off
37 | set-option -g visual-bell off
38 | set-option -g visual-silence off
39 | set-window-option -g monitor-activity off
40 | set-option -g bell-action none
41 |
42 | set -g default-terminal "screen-256color"
43 |
44 | # The modes {
45 | setw -g clock-mode-colour colour135
46 | # }
47 |
48 | # The statusbar {
49 | set -g status-position bottom
50 |
51 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
52 | set -g status-bg colour234
53 | set -g status-fg colour15
54 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
55 |
56 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT {
57 | set -g status-left "#[fg=colour15,bg=colour26] #S #[fg=colour103,bg=colour236,nobold,nounderscore,noitalics]"
58 | set -g status-right "#[fg=colour239] #(echo $ROS_MASTER_URI) #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour248,bg=colour239] %H:%M #[fg=colour15,bg=colour26] #H"
59 | # EPIGEN_DEL_BLOCK_COLORSCHEME_LIGHT }
60 |
61 | set -g status-right-length 50
62 | set -g status-left-length 20
63 |
64 | setw -g window-status-current-format "#[fg=colour236,bg=colour239,nobold,nounderscore,noitalics]#[fg=colour253,bg=colour239] #I |#[fg=colour253,bg=colour239] #W #[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]" # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
65 |
66 | setw -g window-status-format "#[fg=colour244,bg=colour236] #I |#[fg=colour244,bg=colour236] #W " # EPIGEN_DEL_LINE_COLORSCHEME_LIGHT
67 | # }
--------------------------------------------------------------------------------
/utils/README.md:
--------------------------------------------------------------------------------
1 | # Helper stuff
2 |
3 | [YCM ROS autocomplete](https://discourse.ros.org/t/configuring-vim-ros1-ros2-semantic-c-autocompletion-with-youcompleteme/24401)
4 |
--------------------------------------------------------------------------------
/utils/assets/figure1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/utils/assets/figure1.png
--------------------------------------------------------------------------------
/utils/assets/figure2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larics/docker_files/27fe418cc9ec0488b85c6b8eb3d2c75af89815b0/utils/assets/figure2.png
--------------------------------------------------------------------------------
/utils/bash_scripts/control_tmuxinator.sh:
--------------------------------------------------------------------------------
1 | OUTPUT="docker inspect -f '{{.State.Status}}' mbzirc_ecc22_cont";
2 | while [ `$OUTPUT | grep -c running` = 1 ]; do
3 | echo True;
4 | sleep 1;
5 | OUTPUT=$OUTPUT;
6 | done
7 |
8 | tmuxinator stop mbzirc_ecc22
9 |
--------------------------------------------------------------------------------
/utils/bash_scripts/copy_ssh.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "What's the name of the container where you want to copy ssh keys?"
4 |
5 | read cont_name
6 |
7 | echo "Container name where ssh_config is copied is: $cont_name"
8 |
9 | docker cp /home/$USER/.ssh/id_rsa $cont_name:/root/.ssh/
10 |
11 |
--------------------------------------------------------------------------------
/utils/bash_scripts/first_run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # If not working, first do: sudo rm -rf /tmp/.docker.xauth
4 | # It still not working, try running the script as root.
5 |
6 | echo "What's the name of the image?"
7 |
8 | read img_name
9 |
10 | echo "What's the name of the container?"
11 |
12 | read cont_name
13 |
14 |
15 |
16 | XAUTH=/tmp/.docker.xauth
17 |
18 | echo "Preparing Xauthority data..."
19 | xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/')
20 | if [ ! -f $XAUTH ]; then
21 | if [ ! -z "$xauth_list" ]; then
22 | echo $xauth_list | xauth -f $XAUTH nmerge -
23 | else
24 | touch $XAUTH
25 | fi
26 | chmod a+r $XAUTH
27 | fi
28 |
29 | echo "Done."
30 | echo ""
31 | echo "Verifying file contents:"
32 | file $XAUTH
33 | echo "--> It should say \"X11 Xauthority data\"."
34 | echo ""
35 | echo "Permissions:"
36 | ls -FAlh $XAUTH
37 | echo ""
38 | echo "Running docker..."
39 |
40 | docker run -it \
41 | --env="DISPLAY=$DISPLAY" \
42 | --env="QT_X11_NO_MITSHM=1" \
43 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
44 | --volume="/dev:/dev" \
45 | --net=host \
46 | --privileged \
47 | --gpus all \
48 | --name $cont_name \
49 | $img_name:latest
50 |
51 |
52 |
--------------------------------------------------------------------------------
/utils/bash_scripts/install_nano.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | wget https://mirror.easyname.at/gnu/nano/nano-4.8.tar.gz
4 | tar -xf nano-4.8.tar.gz
5 | cd nano-4.8
6 | ./configure --enable-utf8
7 | make
8 | sudo apt-get remove nano
9 | sudo make install
10 | source ~/.bashrc
11 |
12 |
--------------------------------------------------------------------------------
/utils/bash_scripts/start_tmuxinator_n_times.sh:
--------------------------------------------------------------------------------
1 | DROP_VAL=0.2
2 |
3 | docker start mbzirc_ecc22_cont
4 | docker exec mbzirc_ecc22_cont bash -c "sed -i '71s/.*/ ${DROP_VAL}<\/drop_probability>/' /home/developer/mbzirc_ws/src/simulator-workspace/mbzirc_launch/worlds/simple_demo_manip_uav.sdf"
5 | docker exec mbzirc_ecc22_cont bash -c "sed -i '34s/.*/ loss = ${DROP_VAL}/' /home/developer/mbzirc_ws/src/mbzirc_aerial_manipulation/scripts/monitor_topic.py"
6 | docker exec mbzirc_ecc22_cont bash -c "cd /home/developer/mbzirc_ws/; colcon build --merge-install --packages-select=mbzirc_launch"
7 | docker exec mbzirc_ecc22_cont bash -c "cd /home/developer/mbzirc_ws/; colcon build --merge-install --packages-select=mbzirc_aerial_manipulation"
8 | docker stop mbzirc_ecc22_cont
9 |
10 | sleep 5
11 | n=2
12 | for i in $(seq $n); do
13 | tmuxinator start mbzirc_ecc22
14 | done
15 |
16 | DROP_VAL=0.5
17 |
18 | docker start mbzirc_ecc22_cont
19 | docker exec mbzirc_ecc22_cont bash -c "sed -i '71s/.*/ ${DROP_VAL}<\/drop_probability>/' /home/developer/mbzirc_ws/src/simulator-workspace/mbzirc_launch/worlds/simple_demo_manip_uav.sdf"
20 | docker exec mbzirc_ecc22_cont bash -c "sed -i '34s/.*/ loss = ${DROP_VAL}/' /home/developer/mbzirc_ws/src/mbzirc_aerial_manipulation/scripts/monitor_topic.py"
21 | docker exec mbzirc_ecc22_cont bash -c "cd /home/developer/mbzirc_ws/; colcon build --merge-install --packages-select=mbzirc_launch"
22 | docker exec mbzirc_ecc22_cont bash -c "cd /home/developer/mbzirc_ws/; colcon build --merge-install --packages-select=mbzirc_aerial_manipulation"
23 | docker stop mbzirc_ecc22_cont
24 |
25 | sleep 5
26 | n=2
27 | for i in $(seq $n); do
28 | tmuxinator start mbzirc_ecc22
29 | done
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/utils/c_cpp_properties.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "browse": {
5 | "databaseFilename": "${default}",
6 | "limitSymbolsToIncludedHeaders": false
7 | },
8 | "includePath": [
9 | "/home/developer/catkin_ws/devel/include/**",
10 | "/opt/ros/noetic/include/**",
11 | "/home/developer/catkin_ws/src/for_franka_ros/include/**",
12 | "/home/developer/catkin_ws/src/franka_ros/franka_control/include/**",
13 | "/home/developer/catkin_ws/src/franka_ros/franka_example_controllers/include/**",
14 | "/home/developer/catkin_ws/src/franka_ros/franka_gazebo/include/**",
15 | "/home/developer/catkin_ws/src/franka_ros/franka_gripper/include/**",
16 | "/home/developer/catkin_ws/src/franka_ros/franka_hw/include/**",
17 | "/home/developer/catkin_ws/src/franka_ros_interface/franka_interface/include/**",
18 | "/home/developer/catkin_ws/src/franka_ros_interface/franka_ros_controllers/include/**",
19 | "/usr/include/**"
20 | ],
21 | "name": "ROS",
22 | "intelliSenseMode": "gcc-x64",
23 | "compilerPath": "/usr/bin/gcc",
24 | "cStandard": "gnu11",
25 | "cppStandard": "c++14"
26 | }
27 | ],
28 | "version": 4
29 | }
30 |
--------------------------------------------------------------------------------