Skip to content

Making a BWI Workspace

harely22 edited this page Mar 5, 2019 · 10 revisions

Copying an existing workspace from one computer to another on the network:

If you have a workspace set up on one computer (for example on rodriguez), and you want to copy it to a different computer, then log on to the new computer and then type:

$ rsync -havzP rodriguez.csres.utexas.edu:"~/catkin_ws" .

This command should copy over your catkin_ws to the new computer.

Note: If the existing workspace is on a robot then you need to get the robot's ip by typing:

$ curl http://nixons-head.csres.utexas.edu:7979/hosts

This will open up a list with the ip for each robot (for example: 10.147.179.168 bender). Then type:

$ rsync -havzP 10.147.179.168:"~/catkin_ws" .

User Setup

Create your user-side rosdep cache:

rosdep update

We'll setup a catkin workspace for you to work with your code, and link it to the ROS Kinetic installation. First, you'll have to figure out if an existing workspace is present. You can check with the following command:

test -d ~/catkin_ws/src && echo "Catkin workspace present"

Install catkin_tools and wstool

You must have the ROS repositories which contain the .deb for catkin_tools:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -

Once you have added that repository, run these commands to install catkin_tools and wstool:

sudo apt-get update
sudo apt-get install python-catkin-tools python-wstool python-rosdep ninja-build

Existing catkin workspace

Browse through the current workspace to see what packages are in the workspace. Some of these packages may be ones you are working on, and some of them may have been downloaded while running these install instructions previously. You'll have to remove packages that were downloaded through these install instructions. If you are unsure, ask for help!

To remove a package, run the following command. This step is not reversible. Do not remove any code that you have not uploaded to github..

cd ~/catkin_ws/src
wstool rm <pkg-name>
rm -rf <pkg-name>

Remove all unnecessary packages.

New catkin workspace

If you don't have an existing catkin workspace, setup a catkin workspace at ~/catkin_ws:

cd
mkdir -p catkin_ws/src
cd catkin_ws
source /opt/ros/kinetic/setup.bash
catkin config --init
cd src
wstool init
catkin build

Setting up your environment

Setup your environment. You might want to open ~/.bashrc in a text editor to ensure you don't have multiple copies of these lines:

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

devel/setup.bash is created after building your workspace, so be sure that you ran the build command in the previous section.

RESTART your terminal

This will ensure that you have the workspace sourced.

Downloading our code

Download the appropriate manifest from the BWI repo. If you are using ROS Kinetic, this would be kinetic.rosinstall. Rename it to .rosinstall and move it into the src directory of your catkin workspace.

Then run:

wstool update

Your src directory should contain a bunch of newly downloaded packages.

To install the dependencies of the new packages, navigate to the root of the workspace

rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y

Next Steps

Now your workspace is ready to be used. To understand environment setup in more details, check out the tutorial on the ROS wiki. You should now proceed to the Navigation Tutorial.

Troubleshooting

Nvidia Optimus Issues

If you are using a laptop with an Optimus enabled Nvidia graphics card, you will have to install the bumblebee driver and run the following addtional command:

echo "export OPTIRUN_LAUNCH_PREFIX=optirun" >> ~/.bashrc
Clone this wiki locally