-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
317 additions
and
105 deletions.
There are no files selected for viewing
This file contains 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,20 @@ | ||
name: Tests | ||
on: [push] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Run image | ||
uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: "1.6.1" | ||
|
||
- run: make install | ||
- run: make test |
This file contains 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,2 @@ | ||
.vscode | ||
__pycache__ |
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
|
@@ -2,3 +2,7 @@ | |
.PHONY: install | ||
install: | ||
poetry install | ||
|
||
.PHONY: test | ||
test: | ||
poetry run pytest |
This file contains 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,3 @@ | ||
# Telemetry Parsing Codegen | ||
|
||
To eliminate repetitive code, this module takes in a yaml file with the schema of the CAN messages, and generates the cpp modules needed to parse the CAN messages. |
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains 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,21 @@ | ||
/* | ||
* DataModuleInfo.hpp | ||
* | ||
* THIS IS AUTO GENERATED. DO NOT EDIT | ||
*/ | ||
|
||
#ifndef SOLARGATORSBSP_DATAMODULES_INC_DATAMODULEINFO_HPP_ | ||
#define SOLARGATORSBSP_DATAMODULES_INC_DATAMODULEINFO_HPP_ | ||
|
||
|
||
namespace SolarGators::DataModuleInfo | ||
{ | ||
// ---- Addresses ---- // | ||
|
||
{% for message in canMessages %} | ||
static constexpr uint32_t {{ message["name"] }}_ID = {{ message["id"] }}; | ||
{% endfor %} | ||
} | ||
|
||
|
||
#endif /* SOLARGATORSBSP_DATAMODULES_INC_DATAMODULEINFO_HPP_ */ |
This file contains 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 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 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
Empty file.
This file contains 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,11 @@ | ||
can_messages: | ||
- id: 0x11 | ||
name: "RX0" | ||
schema: | ||
- type: "uint16_t" | ||
name: "first" | ||
default: 0 | ||
|
||
- type: "uint16_t" | ||
name: "second" | ||
default: 0 |
This file contains 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,34 @@ | ||
#include <iostream> | ||
#include <sstream> | ||
#include <cstring> | ||
#include <csignal> | ||
#include "RX0.hpp" | ||
|
||
int main() { | ||
uint8_t data[4] = {0x37, 0x44, 0x20, 0x40}; | ||
SolarGators::DataModules::RX0 RX0; | ||
|
||
RX0.FromByteArray(data); | ||
|
||
std::cout << "input first: " << RX0.GetFirstVal() << std::endl; | ||
std::cout << "input second: " << RX0.GetSecondVal() << std::endl; | ||
if (RX0.GetFirstVal() != 0x4437) { | ||
std::cout << "first is wrong!" << std::endl; | ||
return -1; | ||
} | ||
|
||
if (RX0.GetSecondVal() != 0x4020) { | ||
std::cout << "second is wrong!" << std::endl; | ||
return -1; | ||
} | ||
|
||
RX0.ToByteArray(data); | ||
if (data[0] != 0x37 || data[1] != 0x44) { | ||
std::cout << "first to byte array is wrong!" << std::endl; | ||
return -1; | ||
} | ||
if (data[2] != 0x20 || data[3] != 0x40) { | ||
std::cout << "second to byte array is wrong!" << std::endl; | ||
return -1; | ||
} | ||
} |
This file contains 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,11 @@ | ||
can_messages: | ||
- id: 0x11 | ||
name: "RX0" | ||
schema: | ||
- type: "uint8_t" | ||
name: "first" | ||
default: 0 | ||
|
||
- type: "uint8_t" | ||
name: "second" | ||
default: 0 |
This file contains 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,34 @@ | ||
#include <iostream> | ||
#include <sstream> | ||
#include <cstring> | ||
#include <csignal> | ||
#include "RX0.hpp" | ||
|
||
int main() { | ||
uint8_t data[2] = {0x37, 0x44}; | ||
SolarGators::DataModules::RX0 RX0; | ||
|
||
RX0.FromByteArray(data); | ||
|
||
std::cout << "input first: " << RX0.GetFirstVal() << std::endl; | ||
std::cout << "input second: " << RX0.GetSecondVal() << std::endl; | ||
if (RX0.GetFirstVal() != data[0]) { | ||
std::cout << "first is wrong!" << std::endl; | ||
return -1; | ||
} | ||
|
||
if (RX0.GetSecondVal() != data[1]) { | ||
std::cout << "second is wrong!" << std::endl; | ||
return -1; | ||
} | ||
|
||
RX0.ToByteArray(data); | ||
if (data[0] != 0x37) { | ||
std::cout << "first to byte array is wrong!" << std::endl; | ||
return -1; | ||
} | ||
if (data[1] != 0x44) { | ||
std::cout << "second to byte array is wrong!" << std::endl; | ||
return -1; | ||
} | ||
} |
This file contains 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,11 @@ | ||
can_messages: | ||
- id: 0x11 | ||
name: "RX0" | ||
schema: | ||
- type: "float" | ||
name: "first" | ||
default: 0 | ||
|
||
- type: "float" | ||
name: "second" | ||
default: 0 |
Oops, something went wrong.