https://github.com/tmthecoder/odometrycore
Odometry Core Tracking Algorithm Written in Java
https://github.com/tmthecoder/odometrycore
odometry position-tracking
Last synced: 11 months ago
JSON representation
Odometry Core Tracking Algorithm Written in Java
- Host: GitHub
- URL: https://github.com/tmthecoder/odometrycore
- Owner: tmthecoder
- License: mit
- Created: 2020-11-05T19:02:29.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-11T15:02:11.000Z (about 5 years ago)
- Last Synced: 2025-04-05T00:27:18.606Z (about 1 year ago)
- Topics: odometry, position-tracking
- Language: Java
- Homepage: https://docs.tmthecoder.dev/OdometryCore
- Size: 196 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Odometry Core
[](https://opensource.org/licenses/MIT)
This is a library made to handle the core mathematical calculations for three wheel Odometry.
This library requires either a value in encoder ticks, paired with the counts per revolution per encoder, or an inch value for each encoder to be given
## Installation (Gradle)
In order to use this library, paste the following code under your ``allprojects/repositories``:
```
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" } //Add this line
}
}
```
Then place the following line under your ```dependencies```:
```
dependencies {
implementation 'com.github.tmthecoder:OdometryCore:1.0.0'
}
```
## Installation (JAR)
Alternatively, you can use the provided JAR in the releases section under the latest released version
## Usage
**Library Initialization:**
```
OdometryCore.initialize(cpr, diameter, leftOffet, rightOffset, frontBackOffset);
```
The parameters seen are:
- cpr: The counts per revolution for the encoders you are using
- diameter: The diameter of the wheels on the encoder
- leftOffset: The offset of the left wheel from the center of the robot (only horizontal offset)
- rightOffset: The offset of the right wheel from the center of the robot (only horizontal offset)
- frontBackOffset: The offset of the front or back encoder wheel (only vertical offset)
**Position Tracking:**
After initializing, the robot's position can be found using the following code:
```
EncoderPositions encoderPositions = new EncoderPositions(leftPosition, rightPosition, frontBackPosition);
OdometryPosition position = OdometryCore.getInstance().getCurrentPosition(encoderPositions);
```
The parameters seen are:
- leftPosition: The left encoder's position in ticks
- rightPosition: The right encoder's position in ticks
- frontBackPosition: The front or back encoder's position in ticks
The position tracking code should be run on a loop with as small an interval as possible, and if possible on a separate thread
## Features and Bugs
Please file feature requests and bugs at the [issue tracker].
[issue tracker]: https://github.com/tmthecoder/OdometryCore/issues
## Licensing
OdometryCore is Licensed under the [MIT License]
[MIT License]: https://github.com/tmthecoder/OdometryCore/blob/main/LICENSE