-
Notifications
You must be signed in to change notification settings - Fork 0
Building
At the core of our workspace is being able to build, install, launch and clean our code. While run is used to launch our processes, buffpy can clean your workspace (remove unnecessary build files and data), build the workspace, ssh to a robot, install code on a robot and hopefully in the future flash our micro-controllers. After you source buff.bash you can print your PYTHONPATH and PATH from a terminal (Docker will automatically source buff.bash):
echo $PATH
Should contain /home//buff-code/buffpy/bin
echo $PYTHONPATH
Should contain /home//buff-code/buffpy/lib
Since the buffpy script is now on our path (in buffpy/bin) we can run it from a terminal like:
buffpy
Without passing any arguments you will see a usage message. This can also be seen with the -h option.
To build the workspace you'll need to choose a profile (or configure a new one). The only profile currently is debug so run:
buffpy --build debug
This will run
catkin clean (similar to 'buffpy --clean' but will only remove catkin generated files)
and then
catkin build --profile debug
Building the workspace will generate a lot of files but the only ones we need to worry about are in buffpy/lib and buffpy/bin (currently nothing will be built to buffpy/bin). These two directories are where all of our code will live. It is packaged like this to make installing to the robot easier. In addition since buffpy/lib is on our PYTHONPATH we can import those python scripts to other python files (or even a console interpreter).
In the future we will likely have more compiled programs that will actually need to use the build system, python scripts are not compiled and thus don't really need to be installed by the build. The build installs our python scripts in order to keep all of our source code separate from what we run and when needed we can configure profiles that will only install specific python scripts (keeping buffpy/lib as light as possible). Use buffpy/lib in development so you don't need to build over and over again. When you run clean buffpy/lib will get deleted so make sure to copy your changes back to src.
