diff --git a/README.md b/README.md index e3603ef8d..cb9b70dec 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/docs/catkin.md b/docs/catkin.md new file mode 100644 index 000000000..163ceb3f9 --- /dev/null +++ b/docs/catkin.md @@ -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 git@github.com: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. diff --git a/docs/example_with_urdf.png b/docs/example_with_urdf.png new file mode 100644 index 000000000..b6fa06618 Binary files /dev/null and b/docs/example_with_urdf.png differ diff --git a/docs/network.md b/docs/network.md index 6c4d7eaf7..1179d83b6 100644 --- a/docs/network.md +++ b/docs/network.md @@ -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" ```