Giter Site home page Giter Site logo

robomaster's Introduction

Robomaster

UT RoboMaster team - Main Branch

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 ut-robomaster/
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://github.com/ut-ras/robomaster.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 robomaster/ut-robomaster
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-template-project (not template-project)
  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-template-project 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 /template-project/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 /template-project (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:

robomaster's People

Contributors

alljiang avatar arshansani avatar codeninjadev avatar doprz avatar eddieliao avatar jared01m avatar jspspike avatar matthewmarnold avatar pauljhan01 avatar tenzinhl avatar wasabifan avatar yuqipan avatar zhangjunbo1993 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.