Giter VIP home page Giter VIP logo

robomaster's Introduction

Robomaster

Firmware for the Stampede RoboMaster team -- built on Taproot and modm

Setup guide

Linux

  • Install Podman
  • Install the ST-Link package for udev permissions (required for flashing code to the robots)
  • Install VSCode (strongly recommended for ease of setup) and the Dev Containers extension
  • Change Dev Containers: Docker Path to "podman" in VS Code settings
  • Clone the repository git clone --recurse-submodules https://github.com/ut-ras/robomaster
  • Open the robomaster folder in VS Code
  • From the command palette (F1), run Dev Containers: Reopen in Container
  • Done! When opening the project in the future, be sure to use the Dev Container

macOS and Windows (10/11)

  • Install Podman and git
  • Start the Podman VM through Podman Desktop or by running podman machine init --now
  • Install VSCode (strongly recommended for ease of setup) and the Dev Containers extension
  • Change Dev Containers: Docker Path to "podman" in VS Code settings
  • Clone the repository git clone --recurse-submodules https://github.com/ut-ras/robomaster
  • Open the robomaster folder in VS Code
  • From the command palette (F1), run Dev Containers: Reopen in Container
  • Done! When opening the project in the future, be sure to start the Podman VM and use the Dev Container

Building

To build the code, open the repository in its Dev Container and run scons build robot=<standard|hero|sentry>.

Alternatively, use Run Build Task (Ctrl+Shift+B) in VS Code and select the robot type.

Note: Each robot has different hardware and requires variations in the code, so its important to ensure your final code builds on every robot.

Flashing (Linux only)

To flash the code to robot hardware:

  • Turn off power on the robot
  • Connect an ST-Link to the robot and your computer
  • Open a terminal and navigate to the repository (not in the Dev Container)
  • Run ./flash.sh robot=<standard|hero|sentry>
  • Once this is complete, the firmware is flashed and you can turn the robot back on

Note: Make sure you select the correct robot when flashing. Each robot has different hardware and flashing the wrong code can cause significant malfunctions and potential safety concerns.

Powering on the robots

Safety notice: These robots are big and powerful. When powering them on, and especially when testing new code, always be careful and assume they will malfunction. The wheel motors are of special concern since the robot can spin out of control or drive into someone or something and cause damage. Do not test the shooter at normal speeds unless in a controlled environment. In the event that anything goes wrong, the controller acts as a kill switch and can be powered off to shut down the motors.

To power on a robot and ensure proper calibration:

  • Point the turret directly towards the battery and down to minimum pitch
  • Turn on the battery by pressing the button once, releasing, and then holding for a few seconds
  • Flip the power switch on
  • Wait for the power up sequence to complete
  • Power on the controller

Resources

  • Taproot wiki: It has lots of content and we strongly recommend you browse through it to get a sense of what's there
  • Taproot API reference: In-depth information about all the components of the library
  • modm: Website and associated documentation
  • aruw-mcb: ARUW's full robot code project available for reference

robomaster's People

Contributors

alljiang avatar arshansani avatar atleyanderson avatar calebchalmers avatar choafe avatar codeninjadev avatar doprz avatar dxie25 avatar eddieliao avatar jakewendling avatar jared01m avatar jasonklm avatar jspspike avatar lakshay983 avatar matthewmarnold avatar pauljhan01 avatar psurge1 avatar redfalcon5-ai avatar saatvik-aggarwal avatar tenzinhl avatar vinle0 avatar wasabifan avatar wenyuzhuut avatar yuqipan avatar zhangjunbo1993 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

robomaster's Issues

Add yaw encoder driver

We need to implement a driver for communication with the yaw encoders using PWM or I2C.

Determine electrical components

  • Motors
    Probably gonna be DJI M3508 P19 but look for comparable 24v motors
  • ESCs
    Probably gonna be DJI C620
  • Power distribution
    • Motors
    • Power for micrcontroller
    • Power for other components (servos?)
      Thinking we do some basic octopus thing (like in robosub) and then maybe make a PCB afterwards. Also some of the DJI micocontroller breakouts come with some power distribution and regulators for 12v/5v
  • Microcontroller
  • Cameras?

Fix Turret-Relative Movement Flipping

This happens when the controller is power-cycled while the turret is facing away from the front of the robot. (It's a 2:1 belt ratio thing where the angle wraps every half turn.)

Come up with design Standard Chasis

  • Use rev bars for frame?
  • Ability to rout/mill panels?
  • Determine wheels
    For above we should look at other teams designs to see what's common

Combine camera measurements into a matrix

In our auto-aim/ballistics code, there are several constants for various physical measurements currently. To accommodate multiple shooter designs and robot types, combining those measurements into a single camera-to-chassis transformation matrix inside our constants might be a good interface.

Split Shooter Subsystem into Agitator and Flywheel Subsystems

The shooter subsystem is intended to orchestrate the shooting logic between the flywheel and agitator subsystems in a single place; however, this work could be done with commands under the new system.

May require #61 before this can be implemented properly.

Test and Refine Chassis Power Limiting

This is a fail-safe to stop us from accelerating too fast and spiking our current draw in sudden movements, rough terrain, robot collisions, etc.

Needs testing, see linked branch.

Choosing a microcontroller

So we plan to just buy a breakout for the microcontroller at first and this will probably determine which one we will use for the future. Since we can buy robomaster type c stm32 breakouts we are considering those but we also can just buy an stm32/esp32/tm4c/rp2040 breakout with a few voltage regulators and get the same thing. So look at the cost of the type c board and see if it's worth the headache to do the second option or just buy the robomaster ones.

Tune Flywheel Speeds

The projectile speeds vary slightly while shooting. This makes setting the flywheel speeds harder, since we need to consider the max speed that can happen (to avoid going over speed), rather than the average speed we get.

Flywheel speeds also need to be measured for each referee system level. Again, we need to consider max speeds so we don't go over speed and take damage.

Rebuild project on Linux to paths using wrong slashes

Simply run pipenv run lbuild build on a Linux system, then commit those changes.

There is a bug in taproot that causes Windows-only file paths to be generated when the project is built on a Windows system. By building on a Linux system, it should work in all cases.

Better Editor Support of Firmware C++

Currently the firmware part of the project doesn't work with the clangd LSP server. LSP servers provide IDE-like features to many editors such as VSCode (with the clangd extension in this case), Neovim, Emacs, etc. In order to work with a C/C++ project, clangd needs a compilation database file.

SCons can generate this file automatically, but it needs to be at least version 4.0. If we bump SCons from version 3.1.2 to 4.0 or higher, we could modify the SCons build scripts to generate the compilation database.

Setup dev container

We should create a container which includes all the tools needed for building this repo. It should also interface nicely with the dev container standard (mostly for the VS code extension).

Ideally this will be able to flash to the robots via USB passthrough. This will make it much more useful for development, as well as for deployment to the CV board to enable remote dev board flashing.

Look for ESCs

So we're planning on use the ones that come with m3508 but maybe considering using hobby brushless escs like these. Look for other hobby escs that are 6s and fit within our current draw.

Implement logging via BeagleBone

We can use this to analyze/tune mouse control and motor PIDs.

Requires #62 to be completed first before testing can be done regarding this issue.

Look at DC Motors

Figure out if we can find a replacement for DJI motors.
We're planning on using these for our base and then possibly gobuilda motors for our shooter and gimbal. Try to find similar motors to the DJI one in terms of torque and current draw. They can be either 12v or 24v

Tune Chassis Speed/Acceleration for Each Level

While power limiting will save us from edge cases, we should aim to tune our expected velocity and acceleration parameters manually for each level. This way, we're always running in optimal but controlled conditions.

Tune Turret PIDs

The turret motors simply don't have enough power to provide quick and snappy movement, but we may be able to help the situation with different tuning. For example, underdamping yaw vs overshooting w/ oscillations.

Robot Refactor

Code needs to be refactored into a structure that Taproot supports. Currently, too much logic is abstracted into subsystems and should be moved into their own commands instead.

Review .gitignore and purge project of old, no longer tracked files

Our .gitignore contains an error where all ut-robomaster/build files are being tracked due to a missing slash after the folder name.

Also, the .vscode directory should not be ignored, as this contains useful project tasks, build targets, configuration, and extensions. Some files currently in this folder should either be moved to another location or ignored, as they are machine-specific.

Once all changes are made, we need to clear the cache and re-add all files to cleanup the project.
This can be done via git rm -r --cached . && git add ., then committing those changes (there'll be a ton of removed build files).

Re-configure chassis motor PIDs

The PID parameters currently used for the chassis wheel motors are spinning the wheels about 20x slower than they should be. These need to be reconfigured to be as accurate as possible so we can accurately determine the motion of the robot.

It might also be worth using rad/s rather than rev/min as the unit for these, since rad/s is the SI unit for angular velocity and it will be more compatible with the Mecanum math.

Implement Burst Fire

In theory, we can shoot eight projectiles very quickly since that's how many the agitator holds. We need to implement and test this with different fire rates. Firing them too fast may be a waste due to invulnerability time in the armor plates. Maybe there it's still worth having for spray and pray reasons? We need to consider barrel overheat for each level. We can alternate barrels with each burst.

Merge subsystem branches

We need to combine all the subsystems branches into develop, integrate them with each other, and figure out our input scheme.

Reorganize robot constants

Organizing the robot constants into categories like such as ballistics, IDs, PIDs, and physical measurements would be helpful.

Tune Mouse Control

Mouse input is inconsistent and jumpy from the remote getMouseX and getMouseY functions.

Other teams have reported success by increasing client sensitivity and mouse dpi, needs testing.

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.