Check copperconfig.ron to see the definitions of all the tasks running and the datatypes passed between tasks.
-
apt/dnf/yum/etc install \ pkg-config \ libssl-dev \ libgstreamer1.0-dev \ libgstreamer-plugins-base1.0-dev \ gstreamer1.0-plugins-base \ gstreamer1.0-plugins-good \ gstreamer1.0-plugins-bad \ gstreamer1.0-plugins-ugly \ gstreamer1.0-libav \ libacl1-dev \ libgstrtspserver-1.0-dev \ libges-1.0-dev \ libv4l-dev \ libunwind-dev \ libudev-dev \ - Bazelisk
- Realsense SDK
- Apriltag Library
See Building and Running section for detailed instructions for your platform.
See mujoco-sim/README.md for dependencies and instructions.
- cubuild - Enhanced error messages for Copper macros https://github.com/copper-project/copper-rs/tree/master/support/cargo_cubuild
- iox2 cli tool for seeing active iceoryx2 nodes and services.
- cargo flamegraph + perf for profiling
- gdb
- lz4 for compressing logs
NOTE: On some machines you have to increase the stack size for it to compile export RUST_MIN_STACK=107108864.
See mujoco-sim/README.md for instructions.
- Install dependencies listed in the above
Dependenciessection for the production environment. - run
make syncto build/sync deps for the Unitree L2 publisher. - run
make prodto build and run the project.
-
Git
This is pre installed on most Linux distros. Just set it up with either a personal access token or SSH keys.
-
makeInstall it using your package manager. For Ubuntu/Debian,
sudo apt install build-essential. -
Rerun
Download the latest Linux binary from releases section on https://github.com/rerun-io/rerun. Make it executable and add it to your PATH.
-
clang
Install it using your package manager. For Ubuntu/Debian,
sudo apt install libclang-dev. -
Rust
Install from rustup.rs.. After installation, switch to the nightly release using
rustup default nightly.
Recommended IDE : VS Code
Package Manager: apt, dnf, pacman etc depending on your distro.
- Clone the repository.
- Download a log file (linked in Discord), unzip it using
lz4 -d (filename)and thentar xvf (filename)and place it inlunabot-cu/logs. Make sure there are no other nested directories inlunabot-cu/logs. - In a new terminal window, in the repo directory, run
make resim. It will take a few minutes to build and then launch the simulation in Rerun's GUI.
-
Git
This is pre installed on macOS. Just set it up with either a personal access token or SSH keys.
-
makeRun
xcode-select --installif you haven't done it before. This will installmakealong with many other useful development tools. -
Rerun
Download the latest macOS binary from releases section on https://github.com/rerun-io/rerun. The latest version is 0.24.1 at the time of writing.
rerun-cli-0.24.1-x86_64-apple-darwinif you are on an Intel Mac, orrerun-cli-0.24.1-aarch64-apple-darwinif you are on Apple Silicon. Make it executable withchmod +x. Rename the file torerunand move it to~/.local/bin. Assuming you are using zsh,echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrcandsource ~/.zshrcto add it to your PATH.which rerunto ensure it is recognized. -
clang
This is pre installed on macOS.
-
Rust
Install from rustup.rs.. After installation, switch to the nightly release using
rustup default nightly.
Recommended IDE : VS Code
Brew - This is a useful package manager for macOS. It will be helpful. Install from brew.sh
- Clone the repository.
- Download a log file (linked in Discord), unzip it using
lz4 -d (filename)and thentar xvf (filename)and place it inlunabot-cu/logs. Make sure there are no other nested directories inlunabot-cu/logs. - In a new terminal window, in the repo directory, run
make resim. It will take a few minutes to build and then launch the simulation in Rerun's GUI.
-
Git
You will need to install this if you don't already have it. Download the standalone installer here. Set up git using either a personal access token or SSH keys.
-
Rust
Install from rustup.rs.. Open a new PowerShell and run
rustc --versionto ensure it is recognized. After installation, switch to the nightly release usingrustup default nightly. -
makeThe recommended method of installing this is using
choco, see below for details. Open an admin PowerShell and runchoco install make. After install, open a new PowerShell and runmake --versionto ensure it is recognized. -
LLVM/Clang
Install using
choco install llvmin an admin PowerShell. After install, open a new PowerShell and runclang --versionto ensure it is recognized. -
C++ Build Tools
You will need to install the C++ Build Tools from Microsoft. Download the installer from Microsoft. Scroll to the bottom of the page, expand "Tools for Visual Studio" and download "Build Tools for Visual Studio". This will download a Visual Studio installer. Note that you do not need Visual Studio itself, only these build tools. Run the installer, and in the installer window, select "Desktop development with C++" and "MacOS/Linux Development with C++" and click "Install". This will take a while to install.
-
Rerun
Download the latest stable Windows binary, from rerun's GitHub page. The latest is 0.25.1 at this time. Download
rerun-cli-0.25.1-x86_64-pc-windows-msvc.exeand rename it torerun.exe. Move it toC:\Windows\Program Files\Rerunor any other directory you want. To add this to your PATH, press Windows+X, choose "System", then "Advanced system settings", then "Environment Variables". Under "System variables", select "Path" and click "Edit". Click "New" and add the path to the directory where you placedrerun.exe. Click OK on all the windows to close them. Open a new PowerShell window and runrerun --versionto ensure it is recognized. -
7zip ZS
This is needed in order to decompress the log files which are in
.tar.lz4format. The standard version of 7zip will not work. Download the installer from their GitHub page.
Recommended IDE : VS Code
Package Manager: Chocolatey. Follow the instructions for individual installation; It is one command in PowerShell.
- Clone the repository.
- Download a log file (linked in Discord), unzip it using 7zip ZS (you will need to do this twice) and place it in
lunabot-cu/logs. Make sure there are no other nested directories inlunabot-cu/logs. - Open a new PowerShell window, navigate to the repo directory, and run
make resim. It will take a few minutes to build and then launch the simulation in Rerun's GUI.
- Ensure there are valid log files in lunabot-cu/logs
- From the repository root first build the docker container with
docker build -t lunabot .then if using bash/gitbash run withdocker run --network=host -it -v $(pwd):/workspace -v cargo-cache:/workspace/target -v cargo-registry:/usr/local/cargo/registry --name lunabot lunabototherwise run withdocker run --network=host -it -v "${PWD}:/workspace" -v cargo-cache:/workspace/target -v cargo-registry:/usr/local/cargo/registry --name lunabot lunabot - Comment out the rerun init function call in lunabot-cu/src/resim.rs, and uncomment the line above with the Grpc config.
- Start rerun on host.
- Run replay with
container$ make resim
- monitors udev events and allows for easy discovery of which cameras are on which ports.
make discover-camerasList of common problems and how to fix them can be found here
- Launches exernal processes.
- Sets up rerun
- Serializes the robot chain.
- Builds and runs the lunabot application.
- Reads in copperlist logs from lunabot-cu/logs. These logs contain messages passed between copper tasks.
- Runs the lunabot in simulation mode which allows you to selectively decide which task's process functions are simulated "Mocked", and which tasks process functions are not.
- Allows you to set a task with a mocked process function to output to whatever was read in from the logs, effectively allowing for deterministic replay of whatever was captured.
- Launched by lunabot-cu.
- Detects when a realsense device is plugged in, automatically opens device and publishes point clouds.
- Not compiled or launched in log replay mode.
- Launched by lunabot-cu
- Connects to L2 and publishes imu data and pointclouds from it.
- Not compiled or executed in log replay mode.
Contains libraries for kinematics, network protocols, GPU utilites/Shader pipelines, camera auto discovery, behavior trees, and interaction with VESC boards.
Contains source tasks for:
- Receiving messages from sensors in external tasks (Realsense, L2 lidar)
- Handling the connection to the lunabase.
- Sink tasks for interacting with the actuators and motors
- localizer
- logger placeholder task for testing obstacle map generation
- Takes in readings from the lunabase.
- Keeps track of what the robot is currently doing (see LunabotAction enum)
- Keeps track of state (the blackboard) associated with the lunabot: robot chain, last messages seen from lunabase, latest obstacle map, (and more to come)
- Decides how to control the motors and actuators based on all that information.
Tasks that lie between the sources and sinks for:
- Image processing for apriltag detection.
- Automatically opening camera devices as they become available.
- Point cloud processing (KISS-ICP)
Helper functions for:
- Framed codec for talking with rp2040
- Udev polling
- Linear interpolation
- Converting between units/types.
- Structures and helpers used for connecting to the base station.
Legacy code containing structures that are used by the lunabase and the lunabot. (and the old behavior tree).
This will be useful when we actually move the lunabase to this repo
A no_std crate containing structures used by the embedded code as well as our tasks. there is no embedded code in this repo yet because we don't know what electrical team will throw our way quite yet
Utilities for connecting to rerun.
Legacy code for controlling motors via VESC.
The enumerate_motors() function (used by the motor_ctrl task) returns a structure that you can use to command the motors.
Hooks into the copper runtime and prints messages when a task's process, preprocess, etc return Err.
Example output:
=== ERRORED TASKS ===
Task 10: lunabase (State: Process) - lunabase not connected
context:lunabase disconnected
Task 17: cam_side (State: Process) - no frames received
context:no frames received
Task 14: cam_back (State: Process) - no frames received
context:no frames received
Task 4: realsense_pointcloud (State: Process) - No points seen in 600 ms
context:No points seen in 600 ms
Task 5: realsense_occupancy (State: Process) - No occupancy grid seen in 600 ms
context:No occupancy grid seen in 600 ms
Task 2: l2_pointcloud (State: Process) - No points seen in 600 ms
context:No points seen in 600 ms
=====================