Repository for the taproot-based rewrite of our 2021 development platform

pipeline status


taproot-mdev2021

This is a blank project fully configured for use of Taproot. It is designed to be a starting point for your own RoboMaster software projects. Be sure to check out Taproot for more information.

This template includes the following:

  • Code generated from the taproot and modm repositories. This generated code is located in /mdev2021/taproot and includes the hardware abstraction layer provided by modm as well as Taproot library code that sits on top of modm.

    See here for more information on code generation.

  • A .vscode folder with C++ configurations for developing in a simulated, test, and hardware environment. This also includes convenient VS Code tasks for building code and debug launch configuration for debugging the simulated, test, or hardware environment.

  • A Doxygen document generation configuration that renders a documentation webpage sourced from commented code.

  • Various linting scripts that are used for maintaining high quality source code.

  • A clang format configuration (see .clang-format). This should be configured based on user preferences.

  • Build scripts supporting configurable target profiles, including environment (simulator, tests, hardware) and robot type (Standard, Hero, etc.).

  • A basic GitLab Continuous Integration (CI) Pipeline that lints the source code, builds all targets, and runs your tests (see .gitlab-ci.yml).

  • Instructions and a configuration file for deploying your software to hardware via the command line.

Usage of the template

This project is provided to reduce the configuration overhead when adopting Taproot. We recommend creating a new blank GitLab project and pushing the history of this repository there. This will be similar to a fork, but omit the "forked from..." badge, which you likely don't want.

Assuming your new project is at https://gitlab.com/my-team/my-amazing-project, the setup process is as follows:

git clone --recursive https://gitlab.com/my-team/my-amazing-project.git
cd my-amazing-project
git remote add template https://gitlab.com/aruw/controls/taproot-mdev2021.git
git pull template develop
# replace "main" with your main branch name of choice
git push --set-upstream origin main

If you visit the project's GitLab page, starter files should be present and GitLab will likely have kicked off a Continuous Integration (CI) Pipeline, indicated by the blue "waiting" icon or a green "checkmark".

Configuring your new project

By using this template, your project will start out with a fully-functional Taproot instance and build tools. The provided main.cpp (/mdev2021/src/main.cpp) includes initialization of all core systems and drivers. This should allow you to develop control systems starting day one.

Note: Issue #3 tracks the desire to automate the below process. Let us know about your experiences there.

To get started, we suggest using Visual Studio Code to perform a find-and-replace across all files, swapping your own project name in place of mdev2021. Furthermore, rename the directory /mdev2021 accordingly. Feel free to call it the same name as your repo.

You should also update the license headers in your project. The above find-and-replace should have updated the project name references. However, you will also want to update the copyright line of each header:

Copyright (c) 2020-2021 Advanced Robotics at the University of Washington <[email protected]>

To refer to your own team, year and email. Do so in all template source files, excluding files in **/taproot. Also update scripts/check_license_headers.py accordingly.

A note on copyright headers: The above suggestions regarding copyright headers are purely for your convenience. You are free to decide how you would like to manage these, including omitting the license headers entirely if preferred, so long as you abide by the original license terms of the files. You may opt to disable the automated license header check; do so by removing the below line from .gitlab-ci.yml:

    - python3 ./scripts/check_license_headers.py

To start developing software, place your source code in /mdev2021/src and your tests in /mdev2021/test. See the workflow guide for how to build, test, and deploy your code.

Finally, after you are done with it, we recommend removing the portion of this README between <!-- ... --> comments. The rest of the file is intended to provide a starting point for your team.

(Optional) Using the RoboMaster Development Board Type C

By default, this project targets the RoboMaster Development Board Type A. However, Taproot also supports the newer Type C board. If you would like to use this board instead (replace mdev2021 with the new name if it has been renamed):

  1. Commit any work so you don't lose it
  2. Edit mdev2021/project.xml according to the included comment
  3. Run rm -r mdev2021/taproot
  4. Run cd mdev2021 and then lbuild build
  5. Commit the result: git add . && git commit -m "Target RM Dev Board Type C"

Contacting

If you have any questions please contact us at [email protected].

Licensing

taproot-mdev2021 is covered under the GPL-3.0-or-later with the following exceptions:

  • /taproot/modm and /mdev2021/taproot/modm are licensed under MPL 2.0 by the modm project. We are not the license holder for these files. See /modm/LICENSE for license information.
  • /mdev2021/taproot/src/taproot/algorithms/MahonyAHRS.h and /mdev2021/taproot/src/taproot/algorithms/MahonyAHRS.cpp are licensed under the GPL by SOH Madgwick. The repo containing this code can be found here.

Other RoboMaster teams are invited, and encouraged, to utilize this library. We have licensed this template project and Taproot under the GPL to encourage collaboration and open publishing of RoboMaster controls codebases. We politely request that other teams choosing to utilize this library, or parts of it (including its design), open-source their own code in turn.


Resources

New user guide

Setting up a development environment

If you want the easiest setup experience and do not require deploying code to hardware, consider developing within the provided Docker container.

Otherwise, follow the guide appropriate for your operating system.

Finally, install pipenv and set up the build tools:

pip3 install pipenv
cd mdev2021/
pipenv install

Getting started with this repo

Make sure you have followed the above setup instructions.

Run the following to clone this repository:

git clone --recursive https://gitlab.com/my-team/my-amazing-project.git

If you use the Docker container, or have already cloned the repository yourself, you should instead run:

git submodule update --init --recursive

Now, cd into the project directory, activate the virtualenv, and run some builds:

cd my-amazing-project/mdev2021
pipenv shell
# Build for hardware
scons build
# Run automated tests
scons run-tests

Returning to the development environment

You will need to run pipenv shell from this directory every time you open a new terminal, before using scons or lbuild.

Workflow guide

Getting around VSCode

Microsoft provides a helpful website with a number of shortcuts for getting around VSCode. There are many shortcuts that make programming faster.

Building code and programming the RoboMaster Development Board

If you would like to use the terminal instead, see the section "Building and running via the terminal" below.

  1. Make sure you have VSCode opened in the folder taproot-mdev2021 (not mdev2021)
  2. Connect an ST-Link to the RoboMaster Development Board and your computer.
  3. In VSCode, open the Command Palette (Ctrl+shift+P)
  4. Find Tasks: Run Task. You should see the options below. Select Program - Debug or Program - Release.

Debugging with an ST-Link

  1. Open the folder aruw-mdev2021 in VSCode. Hit the debug tab on the left side or type Ctrl+shift+D.
  2. Hit the green play arrow on the left top of the screen.
  3. See this page for more information about using the ST-Link for programming the MCB and debugging.

Debugging with a J-Link

See the wiki for an explanation on the difference between an ST-Link and J-Link and a step-by-step procedure on how to use the J-Link.

Selecting and using robot types

Specify the robot type via the command line when compiling (see below). For vscode IntelliSense, navigate to /mdev2021/robot-type/robot_type.hpp and change the macro defined in this file.

Each robot is signified by a unique macro which can be checked to special-case code:

#if defined(TARGET_STANDARD)
// Only included if building for the Standard
initializeStandard();
#endif

How to select an appropriate VSCode C/C++ configuration

This codebase has a number of different build targets (see this wiki page for more information). Because the build setup is different for the test, sim, and RoboMaster Development Board (aka MCB) environments, while working on a particular portion of code you may select an appropriate profile that provides optimal intellisense. To select a configuration, in VSCode, type Ctrl+Shift+P, then type "C/C++:Select a Configuration" and hit enter. A dropdown menu will appear where you may choose either the "Test", "Sim", or "Hardware" configuration.

Upgrading Taproot

The Taproot project recommends that user projects occasionally upgrade the version of Taproot that they depend on. The guide for doing so is here.

Building and running via the terminal

The below commands require that your working directory is /mdev2021 (where the SConstruct and project.xml files are).

  • lbuild build: Re-generates out copy of taproot and modm.
  • scons build: Builds the firmware image for the hardware target. Creates a "release" folder located in build/hardware/ which contains the final .elf file as well as the intermediate object files (.o).
  • scons build-tests: Builds a program which hosts our unit tests. This executable can be run on your host computer (only supported on Linux) and prints results for each unit test run.
  • scons run: Builds as with scons build and then programs the board.
  • scons run-tests: Builds and runs the unit test program.
  • scons size: Prints statistics on program size and (statically-)allocated memory. Note that the reported available heap space is an upper bound, and this tool has no way of knowing about the real size of dynamic allocations.

Below is the full usage statement from our scons build environment. Note that you can select the robot, profile, or whether or not you want profiling to be on using the various options.

Usage: scons <target> [profile=<debug|release|fast>] [robot=TARGET_<ROBOT_TYPE>] [profiling=<true|false>]
    "<target>" is one of:
        - "build": build all code for the hardware platform.
        - "run": build all code for the hardware platform, and deploy it to the board via a connected ST-Link.
        - "build-tests": build core code and tests for the current host platform.
        - "run-tests": build core code and tests for the current host platform, and execute them locally with the test runner.
        - "run-tests-gcov": builds core code and tests, executes them locally, and captures and prints code coverage information
        - "build-sim": build all code for the simulated environment, for the current host platform.
        - "run-sim": build all code for the simulated environment, for the current host platform, and execute the simulator locally.
    "TARGET_<ROBOT_TYPE>" is an optional argument that can override whatever robot type has been specified in robot_type.hpp.
        - <ROBOT_TYPE> must be one of the following:
            - STANDARD, DRONE, ENGINEER, SENTRY, HERO:
Owner
TAMU Robomasters
The official GitHub organization for the Texas A&M Robomasters team.
TAMU Robomasters
Comments
  • Investigate feeder start delay problem

    Investigate feeder start delay problem

    When starting feeding from the hopper (by flipping the right switch to the top position), the hopper seems to start with a slight delay (about 1s) rather than immediately.

  • Swerve Drive Mathmatics

    Swerve Drive Mathmatics

    Works very similarly to how mecanum math works.

    Swerve_Drive.cpp We have a transformation matrix that takes in the values for the size of the robots and it gets multiplied by the robots velocity vector. This returns a 8x1 matrix that gives the robots velocity per wheel in the Vx and Vy directions. Then we take those two and get a 4x2 matrix where the first column is the power and the second one is the wheel heading.

    returns power_heading which is a 4x2 matrix the first column is locked between 0-1 and the second is radians from 0 - 2pi.

    This has been united tested and seems to work for all generally cases. A rotration matrix might be needed for doing tokyo drifting but that will bee seen once the robots are actually built and tested.

    This does not solve for the 180 degree issue

    All of the math is based on this article

    Also settings issues need to be looked upon during merge. This will happen every time i merge with develop

  • Move to CommandGroups folder and fix dependencies

    Move to CommandGroups folder and fix dependencies

    Put command groups in their respective folders in the robots folders and make sure all the dependencies are updated to the new location.

    Affected files:

    • [x] chassis_follow_gimbal
    • [x] chassis_tokyo_drift
    • [x] chassis_toggle_drive_command
  • Make onexecute() take input and be generic across system

    Make onexecute() take input and be generic across system

    Currently onexecute() is utilized in chassis_rel_drive and chassis_manual_drive_command as an abstracted function to be run in the command that manually takes the joystick input and moves the chassis based on it. However this should be generic, so we need to modify it so it takes an input (either a controlOperatorInterface value or some other input (for example, from a CV function denoting a drive input)). This way it can be used to replace all of the drive code and standardize it across chassis commands instead of having to make individual changes to every command.

    Affected files:

    • [ ] chassis_rel_drive
    • [ ] chassis_manual_drive_command
    • [ ] chassis_follow_gimbal_command
    • [ ] chassis_tokyo_command
  • Mecanum Math

    Mecanum Math

    So the basics is that it is just kinematics and thrown in to a matrix.

    rotationMatrix - this is optional so I made a method with out. This is because it will just convert how the robot moves. So if it is either field centric or robot centric (with out this). I believe it might need to be there if we drive forward based on where the turret is and if we are tokyo drifting.

    jacobianMatrix- Is what converts the kinematics to the wheels. (its a transformation matrix) it needs to know how far the wheels are from the center of the robot. And only needs to be ran at compile as it should never change in the lifetime of the game.

    cx - it is just the inputed velocity for x, y, and theta.

    x and y are just how far the control has been moved up/down and left and right. should be bounded to 0-1 theta can really be anything and will most likely be the constant need for how fast we want to tokyo drift as this is how fast we want the robot to turn on the way there.

    power - this is a matrix that is 4x1 that will have all of the power values for each wheel. This can be called to the max power for the robots chassis than feed to the Motors.


    This will most likely needs to be moved out of utils and into chassis folder, but my current thought was putting all of the pure math together and making folders in there for what we are doing with them.

  • Abstract calculations and movement to Movement::Independent namespace

    Abstract calculations and movement to Movement::Independent namespace

    By moving the motion controls to the namespace, we can avoid having to make changes in every command if we want to change something.

    Affected files:

    • [ ] chassis_follow_gimbal.cpp
    • [ ] chassis_tokyo_drift.cpp
    • [ ] chassis.cpp
    • [ ] feeder subsystem
    • [ ] hopper subsystem
    • [ ] shooter subsystem
    • [ ] gimbal subsystem (save to last and work with Sid on it)
  • Feature/swerve

    Feature/swerve

    Swerve is done.

    Engineer will need to be tuned 100% when they fix the rest of their robot.

    Standard stuff will be created if a swerve standard is ever made.

  • Matrix helper rewrite

    Matrix helper rewrite

    Added Comments to Math files, rewrote rotation matrix generator to be more general. Left old function in code as a backup until new function is verified.

  • Collinear Mecanum Drive for balancing standard

    Collinear Mecanum Drive for balancing standard

    This is just here so that I can add files and docs about it. And to generally just explore on my free time until a balancing standard will ever be built.

    https://ieeexplore.ieee.org/document/9040419

A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.
A rewrite of the old legacy software

Dependencies - An open-source modern Dependency Walker Download here (If you're running an AV, use this download instead) NB : due to limitations on /

Dec 29, 2022
CQC (Charmed Quark Controller) a commercial grade, full featured, software based automation system. CQC is built on our CIDLib C++ development system, which is also available here on GitHub.

The CQC Automation System What It Is CQC is a commercial quality, software based automation system, suitable for residential or commercial application

Dec 13, 2022
The artifact associated with our ISSTA 2021 paper "Seed Selection for Successful Fuzzing"

Seed Selection for Successful Fuzzing The artifact associated with our ISSTA 2021 paper "Seed Selection for Successful Fuzzing". While our primary art

Dec 7, 2022
Code accompanying our SIGGRAPH 2021 Technical Communications paper "Transition Motion Tensor: A Data-Driven Approach for Versatile and Controllable Agents in Physically Simulated Environments"
Code accompanying our SIGGRAPH 2021 Technical Communications paper

SIGGRAPH ASIA 2021 Technical Communications Transition Motion Tensor: A Data-Driven Framework for Versatile and Controllable Agents in Physically Simu

Apr 21, 2022
This repository is for everyone for Hacktoberfest 2021. Anyone can contribute anything for your Swags (T- Shirt), must be relevant that can add some value to this repository.
This repository is for everyone for Hacktoberfest 2021. Anyone can contribute anything for your Swags (T- Shirt), must be relevant that can add some value to this repository.

Hacktober Fest 2021 For Everyone! Upload Projects or Different Types of Programs in any Language Use this project to make your first contribution to a

Dec 27, 2022
This Repository is created to help fellow coders learn open source contributions. This Repository is created for Hacktoberfest 2021

Hacktoberfest 2021 Follow the README below to get started! This Repository is created to help fellow coders learn open source contributions This Repos

Oct 24, 2022
This repository contains the tools we used in our research on the Google Titan M chip

Titan M tools In this repository, we publish the tools we used in our research on the Google Titan M chip. We presented our results at Black Hat EU 21

Dec 5, 2022
A repository containing our learnings and implementations for the project "Anchor: The Docker Clone" under IEEE-NITK

Anchor: The Docker Clone A repository containing our learnings and implementations for the project "Anchor: The Docker Clone" under IEEE-NITK Currentl

Feb 7, 2022
🎮 Cross platform development kit for Z80 and SM83 based consoles.

cdk ?? Cross platform development kit for Z80 and SM83 based consoles. Platform We planned to support the following consoles: Nintendo Game Boy Ninten

Jan 10, 2022
The Gecko SDK (GSDK) combines all Silicon Labs 32-bit IoT product software development kits (SDKs) based on Gecko Platform into a single, integrated SDK.

Silicon Labs Gecko SDK (GSDK) The Gecko SDK (GSDK) combines Silicon Labs wireless software development kits (SDKs) and Gecko Platform into a single, i

Dec 28, 2022
This repo contains source code of our paper presented in IROS2021 "Single-Shot is Enough: Panoramic Infrastructure Based Calibration of Multiple Cameras and 3D LiDARs"
This repo contains source code of our paper presented in IROS2021

Single-Shot is Enough: Panoramic Infrastructure Based Calibration of Multiple Cameras and 3D LiDARs Updates [2021/09/01] first commit, source code of

Dec 19, 2022
A presentation about Nintendo 64 development, given at Inércia 2021
A presentation about Nintendo 64 development, given at Inércia 2021

Reflective Regret This repository contains a lot of stuff regarding the "Reflective Regret: Adventures in N64 Homebrew Development" presentation I gav

Oct 21, 2022
Klipper-dev - Kevin's development repository for Klipper experiments.

Welcome to the Klipper project! https://www.klipper3d.org/ Klipper is a 3d-Printer firmware. It combines the power of a general purpose computer with

Dec 10, 2022
The Lua development repository, as seen by the Lua team. Mirrored irregularly

The Lua development repository, as seen by the Lua team. Mirrored irregularly

Jan 5, 2023
Scrollytroller is a crank-based USB controller, initially inteneded for use with Playdate's Pulp web-based game development tool
Scrollytroller is a crank-based USB controller, initially inteneded for use with Playdate's Pulp web-based game development tool

Scrollytroller Scrollytroller is a crank-based USB controller, initially inteneded for use with Playdate's Pulp web-based game development tool. This

Feb 17, 2022
Arduino-compatible development platform whose primary function is a clock
Arduino-compatible development platform whose primary function is a clock

MakeTime Arduino-compatible development platform whose primary function is a clock Description MakeTime is a clock that uses a ring of 24 RGB LEDs to

Oct 11, 2021
The ESP-BOX is a new generation AIoT development platform released by Espressif Systems.

中文版本 ESP-BOX AIoT Development Framework Important Note: We recommend updating the ESP32-S3-BOX firmware when you first receive the product to have the

Dec 29, 2022
cdk is a minimal cross-platform c language development kit.

Overview cdk is a minimal cross-platform c language development kit. Requirement Based on c11 standard. Compile create a build directory under the cdk

Dec 15, 2022