Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
389b3f5
Initial test of diagonal movement
Gold872 Nov 5, 2024
3fc237c
Added turning logic to sensor and timed drive
Gold872 Nov 5, 2024
131be91
More docs
Gold872 Nov 5, 2024
f7e34f0
Added network detector
Gold872 Nov 24, 2024
e3e1173
Refactored movement units
Gold872 Nov 24, 2024
40b1441
Added tank autonomy file
Bing-Rover Nov 24, 2024
1a877fe
Tested on tank 11/25
Bing-Rover Nov 26, 2024
315c3ed
Fixed all occurances of toGps()
Gold872 Nov 28, 2024
e480c37
Fixed toGps() in task.dart
Gold872 Nov 28, 2024
a41b184
Specified networking library version
Gold872 Nov 28, 2024
e19dae7
Fixed isNear method
Gold872 Nov 28, 2024
c0d71ae
Refactor and Reorganization (#7)
Gold872 Dec 8, 2024
b0655a5
Corrected directions
Gold872 Dec 14, 2024
fa81bf8
Initial work on fixing unit tests
Gold872 Dec 17, 2024
1ceb9bd
Account for move length in heuristic
Gold872 Dec 17, 2024
d030100
Simplified heuristic calculation (again)
Gold872 Dec 17, 2024
4a03f60
Fix path following not stopping after restart
Gold872 Dec 18, 2024
9657bb4
Fixed heuristic math to use only distance
Gold872 Dec 18, 2024
4b50d0a
Add more path tests
Gold872 Dec 18, 2024
3bfe8cb
Fixed excessive turns (no idea why this fixes it but whatever)
Gold872 Dec 20, 2024
59cbc34
fix merge conflicts
Gold872 Dec 24, 2024
ede6774
Fixed sensor drive
Gold872 Dec 24, 2024
0e31908
Fixed heuristic and duplicate hashing
Gold872 Jan 16, 2025
64bf1e3
Added path optimizer and more unit tests
Gold872 Jan 24, 2025
0dffb69
Initial testing on rover
Bing-Rover Jan 24, 2025
5a5c1ff
Fixes from testing
Gold872 Jan 31, 2025
eb14e61
Began documenting
Gold872 Jan 31, 2025
a7264a2
Use sim imu in task
Gold872 Jan 31, 2025
d55748e
Use meters for goForward()
Gold872 Feb 3, 2025
758eb26
Use meters for distanceTo()
Gold872 Feb 3, 2025
991c426
Additional testing on rover
Bing-Rover Jan 24, 2025
60de9d2
Moved things into constants
Gold872 Feb 4, 2025
fd1180d
More safety replanning features:
Gold872 Feb 4, 2025
86bea08
Replan paths if timeout is hit
Gold872 Feb 4, 2025
e3f7733
GPSUtil cleanup
Gold872 Feb 4, 2025
2e24f0d
Improved heuristic and sharpen intermediate drive tolerance
Gold872 Feb 6, 2025
d9a1cd1
Point to next waypoint before driving (only with RTK)
Gold872 Feb 6, 2025
da21d76
Works on rover!
Bing-Rover Jan 24, 2025
477766e
Resolved NASTY merge conflicts
Gold872 Feb 7, 2025
d182fc1
Remove unused imports
Gold872 Feb 7, 2025
67a52fb
Update CI dependency overrides
Gold872 Feb 7, 2025
61ca97b
Return method early when timing out
Gold872 Feb 7, 2025
6073948
Fix hasValue
Gold872 Feb 7, 2025
2968236
Added aruco tracking
Gold872 Feb 7, 2025
77f2ce6
Add lidar obstacle detection
Gold872 Feb 9, 2025
e7b0f4e
Fixed build errors
Gold872 Feb 9, 2025
5c1b589
Remove all implementations of canSeeAruco
Gold872 Feb 9, 2025
ed065cb
Remove aruco methods (i think)
Gold872 Feb 9, 2025
2f8becf
Update protobuf messages
Gold872 Feb 9, 2025
7876520
Bump mandatory burt_network version
Gold872 Feb 9, 2025
12672bc
Merge branch 'diagonal-movement' into aruco-tracking
Gold872 Feb 9, 2025
e42e69c
Merge branch 'diagonal-movement' into lidar-obstacles
Gold872 Feb 9, 2025
afc8082
Tested with actual lidar
Gold872 Feb 12, 2025
d79f790
Testing on pi
Bing-Rover Feb 13, 2025
8a711fd
Ignore obstacles 90 degrees off
Gold872 Feb 13, 2025
5a7ecc7
Fixed distance and angle errors
Gold872 Feb 13, 2025
ab40fdd
Works on rover!
Bing-Rover Feb 14, 2025
227c309
More log messages for aruco re-searching
Gold872 Feb 14, 2025
d83a15a
Merge remote-tracking branch 'origin/aruco-tracking' into sar
Levi-Lesches Feb 16, 2025
18ee0c8
Use UTM coordinates for translating 1 meter
Gold872 Feb 20, 2025
9917143
Find obstacles every time the path is replanned
Gold872 Feb 20, 2025
9ebaa82
Merge branch 'sar' of https://github.com/BinghamtonRover/Autonomy int…
Gold872 Feb 20, 2025
643406d
Ignore invalid IMU updates
Gold872 Feb 20, 2025
3e78193
Merge branch 'sar' of https://github.com/BinghamtonRover/Autonomy int…
Gold872 Feb 20, 2025
9671b69
Update coordinate converter
Gold872 Feb 21, 2025
cad45fa
Keep obstacles that intersect with path
Gold872 Feb 21, 2025
b145594
Improve waitUntil() safety
Gold872 Feb 21, 2025
2546368
Send normal and locked obstacles
Gold872 Feb 21, 2025
d071f1f
Cancel command when aruco task fails
Gold872 Feb 23, 2025
7d17741
Only remove obstacles that are in lidar view range
Gold872 Feb 23, 2025
576f4a1
Initial behavior tree implementation for A -> B pathfinding
Gold872 Mar 21, 2025
69ce716
Add more docs to behavior tree
Gold872 Apr 22, 2025
fb4410b
Fix obstacle locking
Gold872 Apr 22, 2025
b2134be
Merge branch 'sar' of https://github.com/BinghamtonRover/Autonomy int…
Gold872 Apr 22, 2025
afb14ff
Fix obstacle locking and add more comments
Gold872 May 1, 2025
a16977a
Initial FSM implementation
Gold872 May 25, 2025
a5afb66
Fix null exception and use set for path message
Gold872 May 25, 2025
2b31be4
Fix additional null error
Gold872 May 25, 2025
f7cc737
Combine drive speed commands
Gold872 May 25, 2025
2f59745
Began documentation for FSM classes
Gold872 May 25, 2025
d3b9a6d
Several FSM fixes
Gold872 May 25, 2025
b4f3e76
Began fixing unit tests
Gold872 May 25, 2025
37219be
Add FSM tests
Gold872 May 26, 2025
4592c34
Fix multiple paths being generated at once
Gold872 May 26, 2025
09c7f5b
Clear controller states on command ending
Gold872 May 26, 2025
1563e5e
Improved obstacle avoidance and fixed some unit tests
Gold872 May 26, 2025
cbfd939
Replace sensor test with tests for error corrector
Gold872 May 26, 2025
cd2ab75
Repaired and removed old legacy tests
Gold872 May 26, 2025
c38a767
Re-enable tests
Gold872 May 26, 2025
66d1724
Reformated files
Gold872 May 26, 2025
43d6d2c
Fix compiler errors in bin/ files
Gold872 May 26, 2025
8ea8495
Remove static variables from gps interface
Gold872 May 26, 2025
fd374d2
Fix errors in orchestrator test
Gold872 May 26, 2025
a00d97d
Update docs workflow
Gold872 May 26, 2025
d7ab766
optimized return statement
mmazer1 May 26, 2025
f6aa892
optimized return statement
mmazer1 May 26, 2025
92ec58c
optimized return statement
mmazer1 May 26, 2025
a7e51f6
small tweak
mmazer1 May 26, 2025
c1d846d
Fix analysis errors
Gold872 May 26, 2025
d7124b9
Fixed final path position not being traversed
Gold872 May 26, 2025
b88c443
Reliability improvements
Gold872 May 26, 2025
5d7a6d5
Cleaned up imports
Gold872 May 26, 2025
7d7a610
Fixed formatting
Gold872 May 27, 2025
4b1780e
i did it this time
mmazer1 May 27, 2025
0dd5ed8
Fix modification while iterating
Gold872 May 28, 2025
00d3fe1
Added simulator
Gold872 May 28, 2025
b6437e0
Rename FSM to state machine
Gold872 May 28, 2025
f013b76
Move states to separate folder
Gold872 May 28, 2025
1ba6576
Remove behavior trees
Gold872 May 28, 2025
fe1c767
Realistic simulation!
Gold872 May 28, 2025
934d0e8
Trigger replan on drive timeout
Gold872 May 28, 2025
b885dbd
Send traversed coordinates before the current path
Gold872 May 29, 2025
a00bebd
Make periodic execution async
Gold872 May 29, 2025
32f86c7
Fixes from testing
Gold872 Oct 12, 2025
174d964
Upgrade Dart to 3.9.0
Gold872 Oct 12, 2025
10bb47f
Fix unit tests
Gold872 Oct 12, 2025
2f4b579
removed sensorless.dart and test.dart
lregueiferos Oct 28, 2025
e3a837b
Increase retry count for Rover drive test
lregueiferos Oct 29, 2025
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
4 changes: 2 additions & 2 deletions .github/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ resolution:
dependency_overrides:
burt_network:
git:
url: https://github.com/BinghamtonRover/Networking
ref: 2.3.1
url: https://github.com/BinghamtonRover/Rover-Code.git
path: burt_network
13 changes: 7 additions & 6 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Clone repo
uses: actions/checkout@v4

# Note: This workflow uses the latest stable version of the Dart SDK.
# You can specify other versions if desired, see documentation here:
# https://github.com/dart-lang/setup-dart/blob/main/README.md
- uses: dart-lang/setup-dart@v1
- name: Setup dart
uses: dart-lang/setup-dart@v1
with:
sdk: 3.6.0
sdk: 3.9.0

# This package is part of a Pub Workspace. However, CI still needs to
# run on this repo by itself, so we want to override burt_network to use
Expand All @@ -36,6 +38,5 @@ jobs:
# Your project will need to have tests in test/ and a dependency on
# package:test for this step to succeed. Note that Flutter projects will
# want to change this to 'flutter test'.
# FIXME: Disabling tests for now
# - name: Run tests
# run: dart test
- name: Run tests
run: dart test
17 changes: 2 additions & 15 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,13 @@ jobs:
- name: Install Dart
uses: dart-lang/setup-dart@v1
with:
sdk: 3.5.2
sdk: 3.9.0

- name: Install dependencies
run: dart pub get

- name: Analyze Dart code
run: dart analyze --fatal-infos

- name: Output error
if: failure()
run: echo "::error The code or is missing documentation. Run flutter analyze --dartdocs"

- name: Generate documentation
run: dart doc --output=docs

# Your project will need to have tests in test/ and a dependency on
# package:test for this step to succeed. Note that Flutter projects will
# want to change this to 'flutter test'.
- name: Run tests
run: dart test
run: dartdoc --ignore 'unresolved-doc-reference,not-implemented,no-documentable-libraries,ambiguous-reexport' --exclude 'dart:async,dart:collection,dart:convert,dart:core,dart:developer,dart:io,dart:isolate,dart:math,dart:typed_data,dart:ui,dart:html,dart:js,dart:ffi,dart:js_util' --quiet --json --output docs --no-validate-links --no-verbose-warnings --no-allow-non-local-warnings

- name: Commit and push files
run: |
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"setpoint"
]
}
16 changes: 7 additions & 9 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,22 @@ include: package:very_good_analysis/analysis_options.yaml # has more lints

analyzer:
language:
# Strict casts isn't helpful with null safety. It only notifies you on `dynamic`,
# which happens all the time in JSON.
#
# Strict casts isn't helpful with null safety. It only notifies you on `dynamic`,
# which happens all the time in JSON.
#
# See https://github.com/dart-lang/language/blob/main/resources/type-system/strict-casts.md
strict-casts: false

# Don't let any types be inferred as `dynamic`.
#
#
# See https://github.com/dart-lang/language/blob/main/resources/type-system/strict-inference.md
strict-inference: true

# Don't let Dart infer the wrong type on the left side of an assignment.
#
# Don't let Dart infer the wrong type on the left side of an assignment.
#
# See https://github.com/dart-lang/language/blob/main/resources/type-system/strict-raw-types.md
strict-raw-types: true

exclude:

linter:
rules:
# Rules NOT in package:very_good_analysis
Expand All @@ -44,7 +42,7 @@ linter:
sort_constructors_first: false # final properties, then constructor
avoid_dynamic_calls: false # this lint takes over errors in the IDE
cascade_invocations: false # cascades are often less readable

# Temporarily disabled lints
public_member_api_docs: false # until we are ready to document
flutter_style_todos: false # until we are ready to address them
16 changes: 0 additions & 16 deletions bin/arcuo.dart

This file was deleted.

2 changes: 1 addition & 1 deletion bin/aruco.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ void main() async {
final rover = RoverAutonomy();
await rover.init();
await rover.waitForValue();
final didSeeAruco = await rover.drive.spinForAruco();
final didSeeAruco = await rover.drive.spinForAruco(0);
if (didSeeAruco) {
rover.logger.info("Found aruco");
await rover.drive.approachAruco();
Expand Down
2 changes: 2 additions & 0 deletions bin/autonomy.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import "package:autonomy/rover.dart";
import "package:burt_network/logging.dart";

void main() async {
Logger.level = Level.debug;
final rover = RoverAutonomy();
await rover.init();
}
26 changes: 19 additions & 7 deletions bin/latlong.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
// ignore_for_file: avoid_print

import "package:autonomy/constants.dart";
import "package:autonomy/interfaces.dart";

const binghamtonLatitude = 42.0877327;
const utahLatitude = 38.406683;

void printInfo(String name, double latitude) {
GpsInterface.currentLatitude = latitude;
final metersPerLongitude = GpsToMeters.metersPerLongitude(latitude);
print("At $name:");
print(" There are ${GpsUtils.metersPerLongitude.toStringAsFixed(2)} meters per 1 degree of longitude");
print(" Our max error in longitude would be ${GpsUtils.epsilonLongitude} degrees");
final isWithinRange = GpsInterface.gpsError <= GpsUtils.epsilonLongitude;
print(" Our GPS has ${GpsInterface.gpsError} degrees of error, so this would ${isWithinRange ? 'work' : 'not work'}");
print(
" There are ${metersPerLongitude.toStringAsFixed(2)} meters per 1 degree of longitude",
);
print(
" Our max error in longitude would be ${(Constants.maxErrorMeters / metersPerLongitude).toStringAsFixed(20)} degrees",
);
final isWithinRange =
Constants.gpsError <= Constants.maxErrorMeters / metersPerLongitude;
print(
" Our GPS has ${Constants.gpsError} degrees of error, so this would ${isWithinRange ? 'work' : 'not work'}",
);
}

void main() {
print("There are always ${GpsUtils.metersPerLatitude} meters in 1 degree of latitude");
print(" So our max error in latitude is always ${GpsUtils.epsilonLatitude} degrees");
print(
"There are always ${GpsToMeters.metersPerLatitude} meters in 1 degree of latitude",
);
print(
" So our max error in latitude is always ${(Constants.maxErrorMeters / GpsToMeters.metersPerLatitude).toStringAsFixed(20)} degrees",
);
printInfo("the equator", 0);
printInfo("Binghamton", binghamtonLatitude);
printInfo("Utah", utahLatitude);
Expand Down
19 changes: 14 additions & 5 deletions bin/path.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
import "package:autonomy/interfaces.dart";
import "package:autonomy/rover.dart";
import "package:autonomy/simulator.dart";
import "package:coordinate_converter/coordinate_converter.dart";

void main() {
GpsUtils.maxErrorMeters = 1;
final destination = (1000, 1000).toGps();
final destination = UTMCoordinates(
x: 5 + 1000,
y: 5 + 1000,
zoneNumber: 31,
).toGps();
final simulator = AutonomySimulator();
simulator.pathfinder = RoverPathfinder(collection: simulator);
simulator.gps.update(UTMCoordinates(x: 5, y: 5, zoneNumber: 31).toGps());
final path = simulator.pathfinder.getPath(destination);
if (path == null) {
simulator.logger.critical("Could not find path to ${destination.prettyPrint()}");
simulator.logger.critical(
"Could not find path to ${destination.prettyPrint()}",
);
return;
}
if (path.isEmpty) {
Expand All @@ -18,9 +25,11 @@ void main() {
}
var turnCount = 0;
for (final step in path) {
if (step.direction == DriveDirection.left || step.direction == DriveDirection.right) {
if (step.instruction.isTurn) {
turnCount++;
}
}
simulator.logger.info("Got a path with ${path.length} steps and $turnCount turn(s)");
simulator.logger.info(
"Got a path with ${path.length} steps and $turnCount turn(s)",
);
}
16 changes: 10 additions & 6 deletions bin/random.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// ignore_for_file: avoid_print

import "package:autonomy/constants.dart";
import "package:autonomy/interfaces.dart";
import "package:autonomy/src/rover/corrector.dart";

const maxError = GpsInterface.gpsError;
const maxError = Constants.gpsError;
const maxSamples = 10;
final epsilon = GpsUtils.epsilonLatitude; // we need to be accurate within 1 meter
const epsilon =
Constants.maxErrorMeters /
GpsToMeters.metersPerLatitude; // we need to be accurate within 1 meter
const n = 1000;
bool verbose = false;

Expand All @@ -17,8 +19,10 @@ bool test() {
corrector.addValue(value);
if (verbose) {
final calibrated = corrector.calibratedValue;
print("Current value: $value, Corrected value: $calibrated");
print(" Difference: ${calibrated.toStringAsFixed(7)} < ${epsilon.toStringAsFixed(7)}");
print("Current value: $value, Corrected value: $calibrated");
print(
" Difference: ${calibrated.toStringAsFixed(7)} < ${epsilon.toStringAsFixed(7)}",
);
}
}
return corrector.calibratedValue.abs() <= epsilon;
Expand All @@ -31,5 +35,5 @@ void main(List<String> args) {
if (test()) count++;
}
final percentage = (count / n * 100).toStringAsFixed(2);
print("Average performance: %$percentage");
print("Average performance: $percentage%");
}
63 changes: 0 additions & 63 deletions bin/sensorless.dart

This file was deleted.

23 changes: 23 additions & 0 deletions bin/simulator.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import "package:autonomy/autonomy.dart";
import "package:autonomy/src/drive/drive_config.dart";
import "package:burt_network/burt_network.dart";

void main() async {
Logger.level = Level.debug;
final simulator = AutonomySimulator();

simulator.pathfinder = RoverPathfinder(collection: simulator);
simulator.orchestrator = RoverOrchestrator(collection: simulator);
simulator.drive = DriveSimulator(
collection: simulator,
method: SimulationMethod.intermediate,
config: roverConfig.copyWith(
oneMeterDelay: const Duration(milliseconds: 500),
turnDelay: const Duration(milliseconds: 750),
subsystemsAddress: "127.0.0.1",
),
);
simulator.detector = NetworkDetector(collection: simulator);

await simulator.init();
}
25 changes: 14 additions & 11 deletions bin/task.dart
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
import "package:autonomy/interfaces.dart";
import "package:autonomy/simulator.dart";
import "package:autonomy/rover.dart";
import "package:burt_network/logging.dart";
import "package:burt_network/burt_network.dart";

final chair = (2, 0).toGps();
final chair = (lat: 2, long: 0).toGps();
final obstacles = <SimulatedObstacle>[
SimulatedObstacle(coordinates: (2, 0).toGps(), radius: 3),
SimulatedObstacle(coordinates: (6, -1).toGps(), radius: 3),
SimulatedObstacle(coordinates: (6, 1).toGps(), radius: 3),
SimulatedObstacle(coordinates: (lat: 6, long: -1).toGps(), radius: 3),
SimulatedObstacle(coordinates: (lat: 6, long: 1).toGps(), radius: 3),
];
// Enter in the Dashboard: Destination = (lat=7, long=0);

void main() async {
Logger.level = LogLevel.debug;
Logger.level = LogLevel.trace;
final simulator = RoverAutonomy();
simulator.detector = DetectorSimulator(collection: simulator, obstacles: obstacles);
simulator.detector = NetworkDetector(collection: simulator);
simulator.pathfinder = RoverPathfinder(collection: simulator);
simulator.orchestrator = RoverOrchestrator(collection: simulator);
simulator.drive = RoverDrive(collection: simulator, useGps: false);
simulator.drive = RoverDrive(
collection: simulator,
useGps: false,
useImu: false,
);
simulator.gps = GpsSimulator(collection: simulator);
// simulator.drive = DriveSimulator(collection: simulator);
simulator.imu = ImuSimulator(collection: simulator);
simulator.video = VideoSimulator(collection: simulator);

await simulator.init();
await simulator.imu.waitForValue();
// await simulator.drive.faceNorth();
await simulator.server.waitForConnection();
}
Loading