forked from RCMast3r/data_acq
-
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.
Showing
64 changed files
with
47,417 additions
and
228 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
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
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,36 @@ | ||
import sys | ||
from mcap.writer import Writer | ||
from mcap.reader import make_reader | ||
|
||
def fix_mcap_file(input_file_path, output_file_path): | ||
with open(input_file_path, "rb") as input_file: | ||
reader = make_reader(input_file) | ||
|
||
with open(output_file_path, "wb") as output_file: | ||
writer = Writer(output_file) | ||
|
||
# Iterate through all schemas and channels in the original file | ||
for schema in reader.schemas.values(): | ||
writer.register_schema(schema.name, schema.encoding, schema.data) | ||
|
||
for channel in reader.channels.values(): | ||
writer.register_channel(channel.id, channel.topic, channel.message_encoding, channel.schema_id) | ||
|
||
# Reading and writing all messages | ||
for message in reader.read_messages(): | ||
writer.add_message( | ||
log_time=message.log_time, | ||
publish_time=message.publish_time, | ||
channel_id=message.channel_id, | ||
data=message.data | ||
) | ||
|
||
print(f"Processed and copied messages to {output_file_path}") | ||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) != 2: | ||
print("Usage: python script.py <path_to_input_mcap>") | ||
else: | ||
input_file_path = sys.argv[1] | ||
output_file_path = sys.argv[1] + "_fixed" | ||
fix_mcap_file(input_file_path, output_file_path) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,45 @@ | ||
{ pkgs, stdenv, system, callPackage, nodejs, nodePackages, writeShellScriptBin }: | ||
let | ||
# Import & invoke the generated files from node2nix | ||
generated = callPackage ./frontend/nix { inherit pkgs system nodejs; }; | ||
|
||
# node2nix wrapper to update nix files on npm changes | ||
node2nix = writeShellScriptBin "node2nix" '' | ||
${nodePackages.node2nix}/bin/node2nix \ | ||
--development \ | ||
-l package-lock.json \ | ||
-c ./frontend/nix/default.nix \ | ||
-o ./frontend/nix/node-packages.nix \ | ||
-e ./frontend/nix/node-env.nix | ||
''; | ||
|
||
in | ||
{ | ||
inherit (generated) nodeDependencies; | ||
frontend = pkgs.stdenv.mkDerivation | ||
{ | ||
name = "frontend"; | ||
version = "0.1.0"; | ||
src = ./frontend; #gitignore.lib.gitignoreSource ./.; # uses the gitignore in the repo to only copy files git would see | ||
buildInputs = [ pkgs.nodejs ]; | ||
buildPhase = '' | ||
export HOME=$TMP | ||
ln -s ${generated.nodeDependencies}/lib/node_modules ./node_modules | ||
export PATH="${generated.nodeDependencies}/bin:$PATH" | ||
npm run build | ||
''; | ||
installPhase = '' | ||
ls | ||
mkdir -p $out/build | ||
cp tailwind.config.js $out/ | ||
cp tsconfig.json $out/ | ||
cp -r public $out/ | ||
cp -r src $out/ | ||
cp -r build $out/ | ||
cp package.json $out/ | ||
ln -sf ${generated.nodeDependencies}/lib/node_modules $out/node_modules | ||
''; | ||
}; | ||
} |
Oops, something went wrong.