Skip to content

Commit

Permalink
Enable saving .bash_history per container locally for developer and n…
Browse files Browse the repository at this point in the history
…ot commit to git
  • Loading branch information
andrewjong committed Nov 3, 2024
1 parent 9d445f3 commit e1378ad
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 6 deletions.
17 changes: 16 additions & 1 deletion robot/docker/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,20 @@ fi
# . /etc/bash_completion
#fi


# Creates a history file that stores locally on the developer computer
# check if we previously created a symlink to ~/.bash_history
if [ ! -h ~/.bash_history ]; then
# File is not a symlink
rm ~/.bash_history
# initialize .bash_history file if doesn't exist yet
if [ ! -d ~/.dev/.bash_history ]; then
cp ~/.dev/.bash_history_init ~/.dev/.bash_history
fi
# symlink to ~/.dev/.bash_history
ln -s ~/.dev/.bash_history ~/.bash_history
fi

# --- ROS2 workspace setup ---

# Define the ROS2 workspace directory
Expand Down Expand Up @@ -162,4 +176,5 @@ CONTAINER_PREFIX="airstack-"
export ROBOT_NAME=$(echo "$container_name" | sed "s#/$CONTAINER_PREFIX##" | sed 's#-#_#')
export ROS_DOMAIN_ID=$(echo "$ROBOT_NAME" | awk -F'_' '{print $NF}')

export RCUTILS_COLORIZED_OUTPUT=1 # get colored output from ROS2 tools
export RCUTILS_COLORIZED_OUTPUT=1 # get colored output from ROS2 tools

File renamed without changes.
2 changes: 1 addition & 1 deletion robot/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ services:
- $HOME/.Xauthority:/root/.Xauthority
- /tmp/.X11-unix:/tmp/.X11-unix
# developer stuff
- .dev:/root/.dev:rw # developer config
- .bashrc:/root/.bashrc:rw # bash config
- .bash_history:/root/.bash_history:rw # save cmdline history
- /var/run/docker.sock:/var/run/docker.sock # access docker API for container name
# autonomy stack stuff
- ../../common/ros_packages:/root/ros_ws/src/common:rw # common ROS packages
Expand Down
3 changes: 0 additions & 3 deletions simulation/isaac-sim/docker/.bash_history

This file was deleted.

15 changes: 15 additions & 0 deletions simulation/isaac-sim/docker/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,22 @@ fi
# . /etc/bash_completion
#fi


# Creates a history file that stores locally on the developer computer
# check if we previously created a symlink to ~/.bash_history
if [ ! -h ~/.bash_history ]; then
# File is not a symlink
rm ~/.bash_history
# initialize .bash_history file if doesn't exist yet
if [ ! -d ~/.dev/.bash_history ]; then
cp ~/.dev/.bash_history_init ~/.dev/.bash_history
fi
# symlink to ~/.dev/.bash_history
ln -s ~/.dev/.bash_history ~/.bash_history
fi

# --- ROS2 setup ---

source /opt/ros/humble/setup.bash
source /humble_ws/install/setup.bash # isaacsim ros2 package
# needed for communication with Isaac Sim ROS2 # https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_ros.html#enabling-the-ros-bridge-extension
Expand Down
8 changes: 8 additions & 0 deletions simulation/isaac-sim/docker/.dev/.bash_history_init
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tmux a
tmux ls
cd ~/ros_ws
ros2 launch gcs_bringup gcs.launch.xml
cws
bws
sws
bws --packages-select gcs_bringup
2 changes: 1 addition & 1 deletion simulation/isaac-sim/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ services:
- ~/docker/isaac-sim/data:/root/.local/share/ov/data:rw
- ~/docker/isaac-sim/documents:/root/Documents:rw
# developer stuff
- .dev:/root/.dev:rw # developer config
- .bashrc:/root/.bashrc:rw # bash config
- .bash_history:/root/.bash_history:rw # save cmdline history
# code
- ../sitl_integration/kit-app-template/source/extensions/:/root/Documents/Kit/shared/exts/
- ../sitl_integration:/sitl_integration:rw
Expand Down

0 comments on commit e1378ad

Please sign in to comment.