Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the iCub user enviroment documentation #325

Merged
merged 2 commits into from
Nov 3, 2023
Merged
Changes from 1 commit
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
26 changes: 14 additions & 12 deletions docs/icub_operating_systems/icubos/user-env.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,34 +42,36 @@ the above files must be renamed to `.bashrc_iCub` and saved in the user home dir
## How to setup the enviroment properly

To use the `~/.bashrc_iCub` file to setup the environment, the following lines:
```
#Load the iCub custom bashrc
if [ "$HOME" != "" ]; then
ICUBRC_FILE="${HOME}/.bashrc_iCub"
else
ICUBRC_FILE="/home/icub/.bashrc_iCub"
fi
if [ -f "$ICUBRC_FILE" ]; then
source $ICUBRC_FILE
```bash
if [[ $- == *i* ]] || [[ -n "$SSH_CLIENT" ]] || [[ -n "$SSH_TTY" ]]; then
#Load the ergoCub custom bashrc
if [ "$HOME" != "" ]; then
ICUBRC_FILE="${HOME}/.bashrc_ergoCub"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was changed from .bashrc_iCub to .bashrc_erogCub, probably you missed it @pattacini @GiulioRomualdi.

btw is there an equivalent documentation for ergoCub right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing that out! I'll revert these changes.

btw is there an equivalent documentation for ergoCub right?

We have the following doc, which doesn't go into the same level of details:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed via e8b2f55.

else
ICUBRC_FILE="/home/icub/.bashrc_ergoCub"
fi
if [ -f "$ICUBRC_FILE" ]; then
source $ICUBRC_FILE
fi
fi
```
should be added at the beginning of file `~/.bashrc` just _BEFORE_ the following lines:
```
```bash
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
```

The reason why the `.bashrc_iCub` needs to be added at the beginning of `~/.bashrc` is that file must be loaded every time a bash session is started, no matter if the session is interactive or not (this is required when we want to start our programs remotely), and the line of code after `# If not running interactively, don't do anything` make the `~/.bashrc` file exit if executed in a non-interactive shell.
The reason why the `.bashrc_iCub` needs to be added at the beginning of `~/.bashrc` is that file must be loaded every time an interactive or ssh bash sessions are started. The lines of code after `# If not running interactively, don't do anything` make the `~/.bashrc` file exit if executed in a non-interactive shell.

## Required configuration

To customize the above user environment, you ought to manually make some changes:

- The **YARP_ROBOT_NAME** - you must insert your robot name, in the following line and remove the leading "#"
```
```bash
#export YARP_ROBOT_NAME=
```

Expand Down