-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
This workspace is designed to develop robotic software systems. BuffCode is meant to be installed on a host machine not and edge device (robot). BuffPy is used to install the code on edge devices, it is possible to install the code through Github CLI but this is not recommended. You can run BuffCode on your machine using one of the methods listed below. For Installation concerns see the Installing Wiki.
This section assumes you have installed docker and qemu. In a terminal run:
docker run -it -e DISPLAY=host.docker.internal --net=host curobotics/buffbox:x86_64-dev
If you have our code (windows support is iffy) you can also use the equivalent spinup alias:
spinup x86_64-dev
or, for m1 mac/cross testing:
spinup aarch64-dev
Either of these commands should result in an interactive terminal in the container. Now you should be able to start our systems:
run infantry-sim
In another terminal check the container ID and connect to it:
docker container list
docker exec -it <container_ID> bash
Now we can use some of these commands to checkout the system:
rostopic list # will list all rostopics, (all systems should have these)
rostopic hz <topic> # will print the frequency of the topic
rostopic echo <topic> # will print all messages on a topic
rosrun rviz rviz # should have a buff-code profile
rosrun rqt_graph rqt_graph # will open a graph of all the ros nodes and topics
rosrun rqt_image_view rqt_image_view # will open a view that can display images from a topic
Clone the repo to your machine (best to clone it in /home/$USERNAME)
git clone git@github.com:/CU-Robotics/buff-code.git
or if you don't have ssh keys setup
git clone https://github.com/CU-Robotics/buff-code.git
Now run the install from the root of the project (home/$USERNAME/buff-code)
source buffpy/scripts/install.bash
After this installs the dependencies you will have full functionality.
To test the install source the environment and check buffpy
source buffpy/buff.bash
buffpy -h
you should see the usage output. There is also basic functionality to diagnose install issues
buffpy --diagnostic
Now that we know buffpy works we can build the workspace. To build the rust code run:
buffpy --build rust
To build the firmware run:
buffpy --build firmware
If you have issues building the workspace you probably need to source buff.bash or you can clean the workspace.
buffpy --clean
Be careful with this command because it can remove things you don't want it too. This function will remove whatever is at $PROJECT_ROOT/data and $PROJECT_ROOT/buffpy/lib. By changing the PROJECT_ROOT variable from bash or in buff.bash you will change what gets removed. Clean will also clear any Docker/PIO/Cargo caches meaning the next build could take awhile.
The buff executable supports installing the workspace to a Jetson Nano or an Ubuntu environment. After building the workspace run:
buffpy --install
This will copy buffpy to the registered devices. You can add devices to the registry in buffpy/config/robots/robots.yaml.
This will spawn a system with the specified definition locally.
run penguin
This script spawns the necessary threads for the vision pipeline (roscore and other debug nodes). If you want to launch a system on the robot you can ssh into the bot and call run.
ssh -X cu-robotics@<HOSTNAME or IP>
cd buff-code && source buffpy/buff.bash
run sentry