Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eghignone committed Mar 19, 2024
0 parents commit f09779b
Show file tree
Hide file tree
Showing 1,057 changed files with 53,207 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .devcontainer/.install_utils/bashrc_ext
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ros_env_setup="/opt/ros/$ROS_DISTRO/setup.bash"
echo "sourcing $ros_env_setup"
source "$ros_env_setup"
source "/home/$USER/catkin_ws/devel/setup.bash"
alias sauce='source /opt/ros/noetic/setup.bash && source /home/${USER}/catkin_ws/devel/setup.bash'
alias scripz='cd /home/${USER}/catkin_ws/src/race_stack/stack_master/scripts'
alias switch_map='/home/${USER}/catkin_ws/src/race_stack/stack_master/scripts/switch_map.sh $1'

echo "ROS_ROOT $ROS_ROOT"
echo "ROS_DISTRO $ROS_DISTRO"

# automatically get zerotier IP. Be careful! it does not work if do not have an ip assigned with the correct prefix, "192.168.192" in this case, and it might not work if you have multiple ips with the same prefix
# export ROS_HOSTNAME=$( ifconfig | awk '/inet 192.168.192/ {print $2}' )

# check if ros hostname is empty
if [ -z "$ROS_HOSTNAME" ]; then
echo "ROS_HOSTNAME is empty, setting it to default"
export ROS_HOSTNAME=localhost
fi
export ROS_MASTER_URI="http://${ROS_HOSTNAME}:11311"
7 changes: 7 additions & 0 deletions .devcontainer/.install_utils/cartographer_dep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash

# merge cartographer ws with ours
rm /etc/ros/rosdep/sources.list.d/20-default.list
rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
27 changes: 27 additions & 0 deletions .devcontainer/.install_utils/cartographer_req.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /bin/bash

# install dep
apt-get install -y python3-wstool \
python3-rosdep \
ninja-build \
stow \
clang \
cmake \
g++ \
git \
google-mock \
libboost-all-dev \
libcairo2-dev \
libceres-dev \
libcurl4-openssl-dev \
libeigen3-dev \
libgflags-dev \
libgoogle-glog-dev \
liblua5.2-dev \
libsuitesparse-dev \
lsb-release \
python3-sphinx \
libgmock-dev \
protobuf-compiler


34 changes: 34 additions & 0 deletions .devcontainer/.install_utils/cartographer_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /bin/bash

# install dep
apt-get install -y python3-wstool \
python3-rosdep \
ninja-build \
stow \
clang \
cmake \
g++ \
git \
google-mock \
libboost-all-dev \
libcairo2-dev \
libceres-dev \
libcurl4-openssl-dev \
libeigen3-dev \
libgflags-dev \
libgoogle-glog-dev \
liblua5.2-dev \
libsuitesparse-dev \
lsb-release \
python3-sphinx \
libgmock-dev \
protobuf-compiler

# merge cartographer ws with ours
rm /etc/ros/rosdep/sources.list.d/20-default.list
rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y

# install abseil
./state_estimation/cartographer_pbl/cartographer/scripts/install_abseil.sh
21 changes: 21 additions & 0 deletions .devcontainer/.install_utils/catkin_skiplist_car.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#! /bin/bash

# list can be manually obtained by ``catkin list --directory <all_the_directories_you_want>``
# list of packages only for the car

catkin config --skiplist cartographer\
ackermann_cmd_mux\
joy\
joystick_drivers\
racecar\
serial\
vesc\
vesc_msgs\
vesc_ackermann\
vesc_driver\
waypoint_logger\
cartographer\
cartographer_ros_msgs\
cartographer_ros\
cartographer_rviz\
particle_filter
6 changes: 6 additions & 0 deletions .devcontainer/.install_utils/catkin_skiplist_sim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /bin/bash

# list can be manually obtained by ``catkin list --directory <all_the_directories_you_want>``
# list of packages only for the sim

catkin config --skiplist f1tenth_simulator
10 changes: 10 additions & 0 deletions .devcontainer/.install_utils/dev_pf_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/bash

apt-get update

pip install cython
# downloading a branch of a fork because they fixed python3 stuff in there
git clone --branch python3 https://github.com/pmusau17/range_libc.git
cd ./range_libc/pywrapper

python3 setup.py install
33 changes: 33 additions & 0 deletions .devcontainer/.install_utils/install_abseil.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

# Copyright 2019 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o verbose

git clone https://github.com/abseil/abseil-cpp.git
cd abseil-cpp
git checkout d902eb869bcfacc1bad14933ed9af4bed006d481
mkdir build
cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_INSTALL_PREFIX=/usr/local/stow/absl \
..
ninja
sudo ninja install
cd /usr/local/stow
sudo stow absl
38 changes: 38 additions & 0 deletions .devcontainer/.install_utils/linux_req_car.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
wget
apt-utils
git
net-tools
libgl1
python3-pip
ros-noetic-tf
ros-noetic-joy
ros-noetic-rqt
ros-noetic-rviz
ros-noetic-amcl
ros-noetic-rospy
ros-noetic-roslint
ros-noetic-pcl-ros
ros-noetic-nav-msgs
ros-noetic-map-server
ros-noetic-urg-node
ros-noetic-slam-toolbox
ros-noetic-ackermann-msgs
ros-noetic-slam-toolbox-msgs
ros-noetic-slam-toolbox-rviz
ros-noetic-tf2-sensor-msgs
ros-noetic-tf2-geometry-msgs
ros-noetic-realsense2-camera
ros-noetic-robot-localization
ros-noetic-interactive-markers
ros-noetic-rosbridge-server
ros-noetic-rosserial
ros-noetic-rosserial-python
ros-noetic-rospy-message-converter
ros-noetic-realsense2-camera
ros-noetic-tf2-sensor-msgs
ros-noetic-imu-tools
ros-noetic-imu-complementary-filter
ros-noetic-imu-filter-madgwick
qt5-default
libeigen3-dev
ros-noetic-rqt-common-plugins
30 changes: 30 additions & 0 deletions .devcontainer/.install_utils/linux_req_sim.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
wget
apt-utils
git
libgl1
ros-noetic-map-server
python3-pip
ros-noetic-tf
ros-noetic-joy
ros-noetic-rqt
ros-noetic-rviz
ros-noetic-amcl
ros-noetic-rospy
ros-noetic-roslint
ros-noetic-nav-msgs
ros-noetic-slam-toolbox
ros-noetic-ackermann-msgs
ros-noetic-slam-toolbox-rviz
ros-noetic-tf2-geometry-msgs
ros-noetic-tf2-sensor-msgs
ros-noetic-realsense2-camera
ros-noetic-robot-localization
ros-noetic-interactive-markers
ros-noetic-rosbridge-server
ros-noetic-rosserial
ros-noetic-rosserial-python
ros-noetic-rospy-message-converter
ros-noetic-realsense2-camera
ros-noetic-tf2-sensor-msgs
qt5-default
libeigen3-dev
10 changes: 10 additions & 0 deletions .devcontainer/.install_utils/pf_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/bash

sudo apt-get update
rosdep install -r --from-paths src --ignore-src --rosdistro noetic -y

sudo pip install cython
# downloading a branch of a fork because they fixed python3 stuff in there
git clone --branch python3 https://github.com/pmusau17/range_libc.git
cd ./range_libc/pywrapper
python3 setup.py install
11 changes: 11 additions & 0 deletions .devcontainer/.install_utils/post_installation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /bin/bash

# extend .bashrc
cat /home/${USER}/catkin_ws/src/race_stack/.devcontainer/.install_utils/bashrc_ext >> ~/.bashrc

# source
source /opt/ros/noetic/setup.bash && source /home/${USER}/catkin_ws/devel/setup.bash

# build
cd /home/${USER}/catkin_ws
catkin build
24 changes: 24 additions & 0 deletions .devcontainer/.install_utils/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cython<3
scipy==1.6.3
rospkg
tqdm
scikit-learn
scikit-image==0.19.2
opencv-python>=4.5.2
trajectory_planning_helpers==0.76
PyYAML
pynput
pandas
matplotlib~=3.5.1
numba
filterpy
torch>=1.7
botorch==0.5.0
pytest>=6.2
sphinx
sphinx-rtd-theme
gpytorch==1.8.1
roslibpy==1.6.0
twisted==23.10.0
pyOpenSSL==23.3.0
psutil
5 changes: 5 additions & 0 deletions .devcontainer/.install_utils/ros_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#! /bin/bash

set -e

exec "$@"
4 changes: 4 additions & 0 deletions .devcontainer/.install_utils/setup_user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
!# /bin/bash

useradd -ms /bin/bash -u ${UID} -G sudo ${USER}
groupadd -fg ${GID} ${USER}
8 changes: 8 additions & 0 deletions .devcontainer/.install_utils/xauth_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /bin/bash

# Script to create a Xauthority file for the docker container
XAUTH=$HOME/.Xauthority
export XAUTH_LOC=$XAUTH
xhost +local:$USER

touch $XAUTH
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "ForzaETH ROS Development Container",
"containerUser": "${localEnv:USER}",
"privileged": true,
"initializeCommand": "/bin/bash -c 'source ${localWorkspaceFolder}/.devcontainer/.install_utils/xauth_setup.sh'",
"image": "race_stack_sim_x86", // change name in case you are working on arm/on the car
"workspaceFolder": "/home/${localEnv:USER}/catkin_ws",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/${localEnv:USER}/catkin_ws/src/race_stack,type=bind",
"customizations": {
"vscode": {
"extensions":[
"ms-vscode.cpptools",
"ms-vscode.cpptools-themes",
"twxs.cmake",
"donjayamanne.python-extension-pack",
"eamodio.gitlens",
"ms-iot.vscode-ros",
"redhat.vscode-xml",
"ms-python.autopep8"
]
}
},
"containerEnv": {
"DISPLAY": "${localEnv:DISPLAY}",
"USER" : "${localEnv:USER}",
"XAUTHORITY" : "/tmp/.Xauthority",
"ROS_HOSTNAME" : "${localEnv:ROS_HOSTNAME}"
},
"runArgs": [
"--name", "forzaeth_devcontainer",
"--net", "host",
"--privileged"
],
"mounts": [
"source=/home/${localEnv:USER}/.Xauthority,target=/tmp/.Xauthority,type=bind,consistency=cached",
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached",
"source=/dev,target=/dev,type=bind,consistency=cached",
"source=${localWorkspaceFolder}/../cache/noetic/build,target=/home/${localEnv:USER}/catkin_ws/build,type=bind",
"source=${localWorkspaceFolder}/../cache/noetic/devel,target=/home/${localEnv:USER}/catkin_ws/devel,type=bind",
"source=${localWorkspaceFolder}/../cache/noetic/logs,target=/home/${localEnv:USER}/catkin_ws/logs,type=bind"
],
"postCreateCommand": "/bin/bash /home/${localEnv:USER}/catkin_ws/src/race_stack/.devcontainer/.install_utils/post_installation.sh"
}
33 changes: 33 additions & 0 deletions .docker_utils/Dockerfile.base_arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Container Creation for the F110 race-stack at Center for Project Based Learning, ETH
#

# use ROS Noetic image
FROM ros:noetic-robot
SHELL [ "/bin/bash", "-c" ]

ADD ./.devcontainer/.install_utils /.install_utils

# install ros packages
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && xargs apt-get install -y < /.install_utils/linux_req_car.txt

# install python packages
RUN pip3 install -r /.install_utils/requirements.txt && \
pip3 install numpy==1.18.1 --no-build-isolation && \
pip3 install casadi


# install catkin build tools
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" \
> /etc/apt/sources.list.d/ros-latest.list' && \
wget http://packages.ros.org/ros.key -O - | sudo apt-key add - && \
apt-get update && apt-get install -y python3-catkin-tools

# install cartographer
RUN . /.install_utils/cartographer_req.sh && . /.install_utils/install_abseil.sh

# install particle filter
RUN . /.install_utils/dev_pf_setup.sh

ENTRYPOINT [ "bash", "/.install_utils/ros_entrypoint.sh" ]
Loading

0 comments on commit f09779b

Please sign in to comment.