Skip to content

Testing your own code on a robot

harely22 edited this page Jan 19, 2018 · 3 revisions

For both ergonomic and resource allocation reasons, it's inadvisable to work physically in front of the robot. Instead, we encourage you to only touch the robot when you're ready to run code immediately.

  1. Verify that your code compiles locally. When you are ready to test on the robot, continue.

  2. Open an SSH session with the robot your are working with

  3. In a separate, local shell use rsync to copy your files to the robot. Say you don't already have a workspace on the robot. Use your SSH session to make the path to the workspace source directory (mkdir -p ~/catkin_ws/src). Now we can copy over your local source files with the below:

rsync -havz ~/catkin_ws/src <bwi username>@<robot IP address>:"~/catkin_ws"

It's important that you don't copy over the devel or build folder! Files in these paths are machine-specific and will cause confusing errors if used on the robot as-is.

Note that rsync will copy files incrementally. Next time you run the command, it won't waste any time sending files that haven't changed on the robot. So, you can run this command every time you make an update locally to mirror the changes on the robot.

  1. Build on the robot over SSH:
    catkin build
  1. Source the workspace, and run your code!
Clone this wiki locally