Skip to content

Commit

Permalink
add some notes on ROS setup on the workstation (#295)
Browse files Browse the repository at this point in the history
* add some notes on robot configuration

* fixing image
  • Loading branch information
cpaxton authored Jul 24, 2023
1 parent 0dc5079 commit 50824db
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 4 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ roslaunch home_robot_hw startup_stretch_hector_slam.launch
To set up your workstation, follow these instructions. We will assume that your system supports CUDA 11.8 or better for pytorch; earlier versions should be fine, but may require some changes to the conda environment.

#### 1. Create Your Environment

If necessary, [install mamba](https://mamba.readthedocs.io/en/latest/installation.html) in your base conda environment. Optionally: [install ROS noetic](http://wiki.ros.org/noetic/Installation/Ubuntu) on your workstation.

```
# Create a conda env - use the version in home_robot_hw if you want to run on the robot
mamba env create -n home-robot -f src/home_robot_hw/environment.yml
Expand All @@ -66,6 +69,8 @@ conda activate home-robot

This should install pytorch; if you run into trouble, you may need to edit the installation to make sure you have the right CUDA version. See the [pytorch install notes](docs/install_pytorch.md) for more.

Optionally, setup a [catkin workspace](docs/catkin.md) to use improved ROS visualizations.

#### 2. Install Home Robot Packages
```
conda activate home-robot
Expand Down
58 changes: 58 additions & 0 deletions docs/catkin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Workstation ROS Setup

It may be useful to create a local ROS workspace in addition to using the one on the robot. The biggest advantage here is being able to use complete robot meshes in RVIZ that match your robot remotely.

```
# Create a catkin workspace
cd $HOME
mkdir catkin_ws
cd catkin_ws
catkin_init_workspace
# Link your home robot package to it
ln -s $HOME_ROBOT_ROOT/src/home_robot_hw $HOME/catkin_ws/src/home_robot_hw
# Clone the stretch_ros code
cd src
git clone [email protected]:hello-robot/stretch_ros.git
```

Stretch requires `move_base` to be installed:
```
sudo apt install ros-noetic-move-base
```

Now you should be able to build ROS:
```
cd $HOME/catkin_ws
source /opt/ros/noetic/setup.bash
catkin_make -DPYTHON_EXECUTABLE=`which python3`
```

This should build you a custom catkin environment built on top of the `home-robot` environment that we already created.

## Testing

On the robot start up the drivers:
```
roslaunch home_robot_hw startup_stretch_hector_slam.launch
```

Then on your desktop run the following:
```
source $HOME/catkin_ws/devel/setup.bash
roslaunch home_robot_hw visualization.launch
```

![](example_with_urdf.png)

You should see RVIZ come up, now with a mesh showing your current robot state.

## Usage

If you will be running ROS commands frequently, add this to your `~/.bashrc` file:
```
source $HOME/catkin_ws/devel/setup.bash
```

There is an equivalent for the `zsh` shell; check the ROS documentation for more.
Binary file added docs/example_with_urdf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions docs/network.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ export HOME_ROBOT_ROOT=/path/to/home-robot
export ROS_IP=$WORKSTATION_IP
export ROS_MASTER_URI=http://$HELLO_ROBOT_IP:11311
# Optionally - make it clear to avoid issues
echo "Setting ROS_MASTER_URI to $ROS_MASTER_URI"
echo "Setting ROS IP to $ROS_IP"
# Helpful alias - connect to the robot
alias ssh-robot="ssh hello-robot@$HELLO_ROBOT_IP"
```
Expand Down

0 comments on commit 50824db

Please sign in to comment.