Skip to content

Commit

Permalink
Updates to README and some script output
Browse files Browse the repository at this point in the history
  • Loading branch information
amarburg committed Nov 26, 2024
1 parent 35fc552 commit cfbc92d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ In case you do not want to run ROSVENV in docker you need to have installed eith
Simply source the install script:
```bash
source path/to/rosvenv/install_rosvenv.bash
wget -O- https://raw.githubusercontent.com/apl-ocean-engineering/rosvenv/refs/heads/main/install_rosvenv.bash | /bin/bash
```

You can also do `./install_rosvenv.bash`, but then you'll have to re-source `.bashrc`.

What did the install script just do to your system you ask? Well, it simply copied the file `rosvenv.bash` to `~/.rosvenv.bash` and added `source ~/.rosvenv.bash` to your `~/.bashrc`. Re-running the script will only perform the copy again, but will not modify your `.bashrc` unless the function `createROSWS` is nowhere to be found.
What did the install script just do to your system you ask? Well, it cloned a copy of this repository to `~/.rosvenv` and added `source ~/.rosvenv.bash` to your `~/.bashrc`. By retrieving a git checkout of this repository, future upgrades only require a `git pull`.


# Uninstall
To uninstall rosvenv, you cat just delete `~/.rosvenv.bash` and remove the following lines from your `.bashrc`.
```
# ROSVENV
source ~/.rosvenv.bash
export ROSVENV_ROOT=<PATH>
source ~/.rosvenv/rosvenv.bash
source ~/.rosvenv/rosvenv_docker.bash
export ROSVENV_ROOT=~/.rosvenv
```

In case you used docker, use
Expand All @@ -51,7 +52,7 @@ Use `docker image rm rosvenv:latest` to remove the ROSVENV base image. Unfortuna

## The ROSVENV-Commands

ROSVENV provides a whole six (6!) commands. Let's go over them...
ROSVENV provides a whole seven (7!) commands. Let's go over them...

### createROSWS

Expand Down Expand Up @@ -138,6 +139,10 @@ Lastly, if you do not want to always have to type the host name, you can add a `

For editors, namely VSCode, the catkin package structure represents a problem when running Python applications in debugger or running Jupyter notebooks, as the kernels do not find catkin packages. This can be remmedied by using a `.env` file which contains the necessary environment variables to locate the packages. The `refreshROSEnvFile` automatically recovers these variables and writes them to `WS/ros.env`. You can then set this file [to be used by VSCode](https://code.visualstudio.com/docs/python/environments#_environment-variable-definitions-file). Note, that there is a separate setting [for debug configs](https://code.visualstudio.com/docs/python/debugging#_envfile), in case you run into trouble with the global setting.

### updateROSEnv

Will `git pull` the latest stable version of rosvenv. It doesn't automatically load the latest version (yet), you still need to `source ~/.bashrc`

## Conclusion

That's it! We hope this makes working with ROS a bit easier for you. If you find a bug, feel free to post and issue.
Expand Down
4 changes: 2 additions & 2 deletions rosvenv.bash
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ activateROS() {
local -A ROS_IP_DICT=$(_loadIPDict)

if [ ${ROS_IP_DICT[AUTO]+_} ]; then
printf "ROS activated!\nAuto activating ROS master '${ROS_IP_DICT[AUTO]}'\n"
printf "ROS ${ROS_DISTRO} activated!\nAuto activating ROS master '${ROS_IP_DICT[AUTO]}'\n"
makeROSMaster ${ROS_IP_DICT[AUTO]}
else
printf "ROS activated!\nROS-IP: ${ROS_IP}\nROS MASTER URI: ${ROS_MASTER_URI}\n"
printf "ROS ${ROS_DISTRO} activated!\nROS-IP: ${ROS_IP}\nROS MASTER URI: ${ROS_MASTER_URI}\n"
fi

else
Expand Down
5 changes: 2 additions & 3 deletions rosvenv_docker.bash
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,16 @@ rosvenv_docker_start_ws_container() {

gpu_options=""
if ! rosvenv_has_nvctk; then
echo "Found no installation of nvidia-container-toolkit, no GPU support in docker..."
echo "nvidia-container-toolkit not installed, no CUDA support in this docker..."
else
echo "Found installation of nvidia-container-toolkit. Exposing your GPUs to the container..."
echo "nvidia-container-toolkit installed. Exposing your GPUs to the container..."
gpu_options="--gpus all --env NVIDIA_VISIBLE_DEVICES=all --env NVIDIA_DRIVER_CAPABILITIES=all"
fi

image_name=$1
container_name=$2
shift 2

echo "Running docker!"
docker run --name $container_name \
--group-add=sudo \
--network=host \
Expand Down

0 comments on commit cfbc92d

Please sign in to comment.