Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Mitchell D Scott edited this page Jul 1, 2022 · 3 revisions

Ubuntu or Docker

As mentioned before in buff.bash we add a directory to our PATH. This directory is buff-code/buffpy/bin. The relevance of this is that we now have the ability to call our python tools from the terminal. You'll notice a buffpy and a run script (possibly some teensy stuff as well), these are python scripts that do two different things. This section will talk about run, check out building to learn more about buffpy.

run is meant to be called from a bash terminal with either a python script name, or a yaml file. The usage looks like:

run mds_pipeline.yaml

or

run cv_stream_test.py

The point of this script is to save application configurations and make them easily editable. This allows us to integrate new systems without changing the old ones. It also allows us to switch a configuration to debug mode. The yaml files are structured as so:

DEBUG: True

TOPICS:
  RAW_IMG: 'image_raw'

NODES:
  CAMERA:
    FILES:
      ['visual_spawner.py']
    CONFIG: 'default_camera.yaml'
    PACKAGE: 'buffpy'

run will do three things: parse the input, launch programs and wait to kill the programs. run can be called with a python script or a yaml file, in either case this becomes the target. In the python case we can also pass arguments:

run cv_stream_test.py True 'some_configuration_file.yaml' 

run will save the arguments and pass them to our python script when it launches. run has two types of programs: a core and sub-processes. In the python launch the python file is our core and there is not any sub-processes. In a system launch roscore is the core and the sub-processes (nodes) are defined in the config yaml.

system launches ignore arguments other than a yaml file. The launcher instead will load the data from the config and then launch roscore and the defined sub-processes. An important thing to know is how run launches the nodes. run uses the rosrun command. The way we launch our nodes would be somewhat equivalent to:

python3 cv_stream_test.py '/buffbot/< NAME OF THE NODE IN yaml >'

There is an example of how to handle this in MDS_Detector and MDS_Camera.

Clone this wiki locally