Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start docs for expressions and variables #1066

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions docs/usage/expressions-variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Expressions and Variables

The Choreo GUI uses a mathematical expression parser (https://mathjs.org/) in nearly every number input. This has several benefits over a plain number input:

* Warnings for incorrect dimensions in inputs (i.e. an angle in a length field)
* Use of any appropriate unit in inputs, instead of having to convert to SI units.
* Addition of different units of the same dimension; `2 m + 1 in` is a valid length input.
* Use of a set of pre-provided mathematical functions within the expression

## Expressions

Every expression input has an associated dimension. Some are length inputs, some are angle inputs, etc. Some are dimensionless, meaning they accept an expression without units or one where the units cancel out.

> NOTE: Due to limitations in the parser, radians (`rad`) is an angle unit, not a dimensionless expression.

These are all the dimensions supported by expression inputs:
* Number (Dimensionless)
* Length
* Linear Velocity
* Linear Acceleration
* Angle
* Angular Velocity
* Angular Acceleration
* Time
* Mass
* Torque
* Moment of Inertia

The units supported by the expression parser can be found [here](https://mathjs.org/docs/datatypes/units.html#reference) with the following Choreo-specific additions:
* RPM (alias rpm), angular velocity equal to `cycle / minute`

## Variables

Choreo also allows users to define a project-wide set of expressions that can be referenced as variables in any input.

### The Variables Panel

### Adding Variables

### Using Variables

### Renaming Variables



1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ nav:
- Saving: usage/saving.md
- View Options Panel: usage/view-options-panel.md
- Estimating Moment of Inertia: usage/estimating-moi.md
- Expressions and Variables: usage/expressions-variables.md
- ChoreoLib:
- Getting Started: choreolib/getting-started.md
- Auto Factory: choreolib/auto-factory.md
Expand Down
Loading