diff --git a/robot/docker/.bashrc b/robot/docker/.bashrc index 541c922e..7ece30a3 100644 --- a/robot/docker/.bashrc +++ b/robot/docker/.bashrc @@ -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 @@ -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 \ No newline at end of file +export RCUTILS_COLORIZED_OUTPUT=1 # get colored output from ROS2 tools + diff --git a/robot/docker/.bash_history b/robot/docker/.dev/.bash_history_init similarity index 100% rename from robot/docker/.bash_history rename to robot/docker/.dev/.bash_history_init diff --git a/robot/docker/docker-compose.yaml b/robot/docker/docker-compose.yaml index 31c1cefc..e45ab63a 100644 --- a/robot/docker/docker-compose.yaml +++ b/robot/docker/docker-compose.yaml @@ -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 diff --git a/simulation/isaac-sim/docker/.bash_history b/simulation/isaac-sim/docker/.bash_history deleted file mode 100644 index b13c1101..00000000 --- a/simulation/isaac-sim/docker/.bash_history +++ /dev/null @@ -1,3 +0,0 @@ -runapp -tmux ls -tmux a -t isaac diff --git a/simulation/isaac-sim/docker/.bashrc b/simulation/isaac-sim/docker/.bashrc index e14bee50..883ab6b5 100644 --- a/simulation/isaac-sim/docker/.bashrc +++ b/simulation/isaac-sim/docker/.bashrc @@ -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 diff --git a/simulation/isaac-sim/docker/.dev/.bash_history_init b/simulation/isaac-sim/docker/.dev/.bash_history_init new file mode 100644 index 00000000..929c6870 --- /dev/null +++ b/simulation/isaac-sim/docker/.dev/.bash_history_init @@ -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 \ No newline at end of file diff --git a/simulation/isaac-sim/docker/docker-compose.yaml b/simulation/isaac-sim/docker/docker-compose.yaml index 16c69418..7a555d57 100644 --- a/simulation/isaac-sim/docker/docker-compose.yaml +++ b/simulation/isaac-sim/docker/docker-compose.yaml @@ -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