Quickstart Setup - Integration Branch

As part of the quickstart repository, there is a branch labeled 'integration' which has more advanced examples and libraries for use with the bracket bot

Quickstart Repository

The quickstart repository integration branch is located at https://github.com/BracketBotCapstone/quickstart/tree/integration.

Quickstart for setting up the Raspberry Pi and Building and Running Nodes

The following is a copy of the README of the repository, however you can follow these steps to get setup!

In your vscode or cursor editor: Install the vscode remote ssh connect extension: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh.

  1. Follow these instructions to flash the Pi: https://docs.bracket.bot/docs/flashing-the-sd-card
  2. SSH to the Pi with vscode remote ssh connect extension: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh.
  3. Clone our repo on the Pi
git clone https://github.com/BracketBotCapstone/quickstart.git
git checkout integration
  1. Run this script to setup the platform, setup_os.sh . Reboot the pi after you do this. Note that the script will ask if you want to install the realsense libraries, you will need to do this to launch all the nodes. Also ensure you monitor the script as it will ask you prompts to answer.
   ./scripts/setup_os.sh
  1. Run this script to setup the odrives, motor_controller_setup.sh
./scripts/motor_controller_setup.sh
  1. Open the repo on the Pi in the vscode ssh session
  2. Run the following to build the project, the config is the robot config you want to use from the configs directory and message config you want to use from the config directory
CONFIG=bot_quickstart CONFIG_MSGS=bot_quickstart_msgs make build
  1. Then you can just launch nodes with the following command
python3 nodes/start_all_nodes.py

Logs

Note: Logs will be written to the logs folder in the directory where you launch the nodes from. Use the Logger class in the logging_utils.py file to log data to a file.

Adding Python Dependencies or packages for use anywhere within the project

To add new Python requirements or packages, update the setup.py file in the root directory. This file manages all Python dependencies that will be installed for the project. After adding any new packages to the setup.py file, you will need to run the make install command to install the new packages. Alternatively you can do a pip3 install -e .from the root of the quickstart repository.

Configuring Parameters for Nodes

Parameters for nodes are specified in the configs directory. You can create a new config for your robot by copying an existing config and modifying the values to match your robot.

Each hardware configuration has a config/(CONFIG_NAME).toml file to fully describe all static parameters shared between python and c. These are constants and are exported via CONFIG=<CONFIG_NAME> make setup or CONFIG=<CONFIG_NAME> make to be easily available via

  • python: import lib.constants as CFG

These parameters are loaded at compile time for python nodes as a constants.py file which is autogenerated by the parse_toml_config.py script. Note these files are not tracked by git and are generated when you run make setup or make.

Specifying Message Types for Nodes

Message types are specified in the config directory. You can create a new message config for your robot by copying an existing config and modifying the values to match your robot.

Each message config has a config/(CONFIG_NAME)_msgs.toml file to fully describe all message types used in the robot.
The topic names are also specified in this file.

These are then parsed into python message classes which are autogenerated by the generate_mqtt_messages.py script.

Python message types are autogenerated into the messages directory, and then imported into python nodes for sending and receiving messages with the mqttpublisher and mqttsubscriber classes in the mqtt_utils.py file.

See existing nodes for examples of how to use message types for sending and receiving messages.

Creating a New Python Node

To add a new Python node:

  1. Create a new python file in the nodes folder.
  2. Implement your node logic in the new python file.
  3. Specify the new node in the launcher script in the nodes/start_all_nodes.py file to integrate it into the system.

Viewing Rerun Data Locally

To view data sent to rerun from the rerun-viewer node on your local machine:

  1. Follow the detailed instructions provided in the lib/rerun_viewer/README.md file.
  2. This guide will walk you through setting up and connecting to the rerun viewer for real-time data visualization.
  3. To add additional data to be sent to rerun, you can subscribe to any topic and handle the input in the node_rerun.py node code.