-
Notifications
You must be signed in to change notification settings - Fork 0
Rust Visualisation (Draft) #42
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
Open
LiamGallagher737
wants to merge
37
commits into
main
Choose a base branch
from
visualisation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
9ca19a4
basic
LiamGallagher737 d4bc085
dummy data
LiamGallagher737 c662ee5
ir sensor arrows
LiamGallagher737 cd99478
make translational vectors stand out and labeled
LiamGallagher737 bb98135
rotational vector labels
LiamGallagher737 ec7ebec
quit when window is closed
LiamGallagher737 5ac8000
remove old constants
LiamGallagher737 f285cbd
Update color sensor label
LiamGallagher737 d909a5a
remove unused vars
LiamGallagher737 8d3bb01
rotate whole robot for compass
LiamGallagher737 50de58f
rotation vectors above robot
LiamGallagher737 739d120
maybe working arduino json
LiamGallagher737 519558a
motor speed
LiamGallagher737 100fcdc
swap wheel circles for arrows
LiamGallagher737 2a51d19
move rotational vectors up
LiamGallagher737 6418d5b
Redesign
LiamGallagher737 c522595
more realistic compass dummy data
LiamGallagher737 a4b172f
commit 157
LiamGallagher737 d05d880
rust?!?!??!!!!
LiamGallagher737 18527d3
demo data
LiamGallagher737 070c958
remove motors for now
LiamGallagher737 a0ddac7
remove example bs
LiamGallagher737 92f08a1
white backgroud with black outlined robot
LiamGallagher737 092cf47
fps counter
LiamGallagher737 3a6563d
ir sensor arrows
LiamGallagher737 642e147
rotate robot with compass
LiamGallagher737 d8b7c14
scale
LiamGallagher737 82dfcf4
ir sensor text
LiamGallagher737 f1295cc
motors
LiamGallagher737 177fc81
rotational vectors
LiamGallagher737 7609bdc
tidy up comments
LiamGallagher737 d26ef67
python be gone
LiamGallagher737 a438fd7
Merge branch 'main' into visualisation
LiamGallagher737 991efa1
remove venv and add to gitignore pt. 2
LiamGallagher737 d993e29
Merge branch 'main' into visualisation
LiamGallagher737 a0d5474
translational vector labels
LiamGallagher737 f17af1f
Merge branch 'main' into visualisation
LiamGallagher737 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| build | ||
| .vscode/c_cpp_properties.json | ||
| visualisation/target | ||
| Simulations/venv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| #pragma once | ||
| #ifndef JSON_H | ||
| #define JSON_H | ||
|
|
||
| #include <ArduinoJson.h> | ||
|
|
||
| const int VECTOR_SIZE = 5; | ||
|
|
||
| struct Readings | ||
| { | ||
| struct Translational | ||
| { | ||
| float x; | ||
| float y; | ||
| const char *source; | ||
| } translational[VECTOR_SIZE]; | ||
| int translational_count; | ||
|
|
||
| struct Rotational | ||
| { | ||
| float val; | ||
| const char *source; | ||
| } rotational[VECTOR_SIZE]; | ||
| int rotational_count; | ||
|
|
||
| struct Motors | ||
| { | ||
| float fl; | ||
| float fr; | ||
| float r; | ||
| } motors; | ||
|
|
||
| float compass; | ||
|
|
||
| struct Color | ||
| { | ||
| int r; | ||
| int g; | ||
| int b; | ||
| } color; | ||
|
|
||
| float *ir; | ||
| }; | ||
|
|
||
| /// @brief Send readings over serial in JSON | ||
| /// @param readings The readings to send | ||
| void SendReadingsJson(Readings &readings) | ||
| { | ||
| JsonDocument doc; | ||
|
|
||
| doc["compass"] = readings.compass; | ||
|
|
||
| doc["color"]["r"] = readings.color.r; | ||
| doc["color"]["g"] = readings.color.g; | ||
| doc["color"]["b"] = readings.color.b; | ||
|
|
||
| doc["motors"]["fl"] = readings.motors.fl; | ||
| doc["motors"]["fr"] = readings.motors.fr; | ||
| doc["motors"]["r"] = readings.motors.r; | ||
|
|
||
| for (int i = 0; i < 8; i++) | ||
| { | ||
| doc["ir"][i] = readings.ir[i]; | ||
| } | ||
|
|
||
| for (int i = 0; i < readings.translational_count; i++) | ||
| { | ||
| doc["translational"][i]["x"] = readings.translational[i].x; | ||
| doc["translational"][i]["y"] = readings.translational[i].y; | ||
| doc["translational"][i]["source"] = readings.translational[i].source; | ||
| } | ||
|
|
||
| for (int i = 0; i < readings.rotational_count; i++) | ||
| { | ||
| doc["rotational"][i]["val"] = readings.rotational[i].val; | ||
| doc["rotational"][i]["source"] = readings.rotational[i].source; | ||
| } | ||
|
|
||
| serializeJson(doc, Serial); | ||
| Serial.println(); | ||
| } | ||
|
|
||
| #endif | ||
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.