Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions robot/docker/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export ROBOT_NAME=$(echo "$container_name" | sed 's/.*-\(robot-[0-9]*\)$/\1/' |
export ROS_DOMAIN_ID=$(echo "$ROBOT_NAME" | awk -F'_' '{print $NF}')

# case: will be null on real world robot
if [ "$ROBOT_NAME" == "null" ]; then
if [ "$ROBOT_NAME" == "null" ] || echo "$ROBOT_NAME" | grep -q "refused"; then
num=$(hostname | awk -F'-' '{print $2}') # get number from hostname
num=$((num)) #remove leading zeros

Expand All @@ -99,8 +99,8 @@ shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTFILE=$HOME/.bash_history
HISTSIZE=1000
HISTFILESIZE=2000
HISTSIZE=-1
HISTFILESIZE=-1

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
Expand Down
36 changes: 23 additions & 13 deletions robot/docker/Dockerfile.robot
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,6 @@ RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so

EXPOSE 22

ARG REAL_ROBOT=false
RUN if [ "$REAL_ROBOT" = "true" ]; then \
# Put commands here that should run for the real robot but not the sim
echo "REAL_ROBOT is true"; \
apt-get ${UPDATE_FLAGS} update && apt-get ${INSTALL_FLAGS} install -y libimath-dev; \
else \
# Put commands here that should be run for the sim but not the real robot
echo "REAL_ROBOT is false"; \
fi


# Install colcon, seems to be getting removed
RUN pip install -U colcon-common-extensions

Expand Down Expand Up @@ -228,13 +217,34 @@ RUN addgroup --gid 1000 robot && \
echo "robot ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/robot && \
echo "robot:robot" | chpasswd

RUN USER=robot && \

ARG REAL_ROBOT=false
RUN if [ "$REAL_ROBOT" = "true" ]; then \
# Put commands here that should run for the real robot but not the sim
echo "REAL_ROBOT is true"; \
apt-get ${UPDATE_FLAGS} update && apt-get ${INSTALL_FLAGS} install -y libimath-dev; \
groupadd -g 20 dialout; \
usermod -aG dialout robot; \
USER=robot && \
GROUP=robot && \
curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-arm64.tar.gz | tar -C /usr/local/bin -xzf - && \
chown root:root /usr/local/bin/fixuid && \
chmod 4755 /usr/local/bin/fixuid && \
mkdir -p /etc/fixuid && \
printf "user: $USER\ngroup: $GROUP\n" > /etc/fixuid/config.yml; \
else \
# Put commands here that should be run for the sim but not the real robot
echo "REAL_ROBOT is false"; \
USER=robot && \
GROUP=robot && \
curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-amd64.tar.gz | tar -C /usr/local/bin -xzf - && \
chown root:root /usr/local/bin/fixuid && \
chmod 4755 /usr/local/bin/fixuid && \
mkdir -p /etc/fixuid && \
printf "user: $USER\ngroup: $GROUP\n" > /etc/fixuid/config.yml
printf "user: $USER\ngroup: $GROUP\n" > /etc/fixuid/config.yml; \
fi



# Cleanup
RUN apt autoremove -y \
Expand Down
2 changes: 2 additions & 0 deletions robot/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ services:
profiles:
- hitl
- deploy
group_add:
- "20"
extends:
file: ./robot-base-docker-compose.yaml
service: robot_base
Expand Down