-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
882390c
commit b73ff8b
Showing
36 changed files
with
966 additions
and
406 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,35 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: {} | ||
|
||
|
||
jobs: | ||
|
||
build: | ||
name: cargo build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- name: Build | ||
run: cargo build | ||
|
||
test: | ||
name: cargo test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt clippy | ||
- name: rustfmt | ||
run: cargo fmt --all -- --check | ||
- name: clippy | ||
run: cargo clippy | ||
- name: test | ||
run: cargo test --verbose |
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 |
---|---|---|
|
@@ -3,35 +3,40 @@ members = [ | |
"crates/*" | ||
] | ||
|
||
resolver = "2" | ||
|
||
[workspace.package] | ||
version = "0.0.1-alpha.1" | ||
authors = ["Benedikt Schwab"] | ||
version = "0.0.1-alpha.3" | ||
authors = ["Benedikt Schwab <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT OR Apache-2.0" | ||
repository = "https://github.com/tum-gis/erosbag" | ||
repository = "https://github.com/envis-space/erosbag" | ||
|
||
[workspace.dependencies] | ||
epoint = { version = "0.0.1-alpha", registry = "custom" } | ||
ecoord = { version = "0.0.1-alpha", registry = "custom" } | ||
epoint = { version = "0.0.1-alpha.3" } | ||
eimage = { version = "0.0.1-alpha.3" } | ||
ecoord = { version = "0.0.1-alpha.3" } | ||
|
||
clap = "4.0.4" | ||
dotenvy = "0.15.0" | ||
walkdir = "2.3.2" | ||
tracing = "0.1.30" | ||
tracing-subscriber = "0.3.8" | ||
diesel = "2.0.2" | ||
diesel_migrations = "2.0.0" | ||
serde = "1.0" | ||
serde_derive = "1.0.143" | ||
serde_repr = "0.1" | ||
serde_yaml = "0.9" | ||
serde-big-array = "0.4.1" | ||
clap = "4.5.9" | ||
dotenvy = "0.15.7" | ||
walkdir = "2.5.0" | ||
tracing = "0.1.40" | ||
tracing-subscriber = "0.3.18" | ||
diesel = "~2.1.6" | ||
diesel_migrations = "~2.1.0" | ||
r2d2 = "0.8.10" | ||
serde = "1.0.204" | ||
serde_derive = "1.0.204" | ||
serde_repr = "0.1.19" | ||
serde_yaml = "0.9.34" | ||
serde-big-array = "0.5.1" | ||
cdr = "0.2.4" | ||
thiserror = "1.0.35" | ||
polars = "0.26.1" | ||
thiserror = "1.0.61" | ||
polars = "0.41.3" | ||
ndarray = "0.15.6" | ||
indextree = "4.4.0" | ||
rayon = "1.5.3" | ||
nalgebra = "0.31.1" | ||
chrono = "0.4.22" | ||
itertools = "0.10.5" | ||
indextree = "4.6.1" | ||
rayon = "1.10.0" | ||
nalgebra = "0.33.0" | ||
chrono = "0.4.38" | ||
itertools = "0.13.0" | ||
image = "0.25.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 |
---|---|---|
@@ -1 +1,10 @@ | ||
# erosbag | ||
|
||
A Rust library for processing ROS2 bags. | ||
|
||
> [!WARNING] | ||
> The library is at an early stage of development. | ||
## Contributing | ||
|
||
The library is developed at the [TUM Chair of Geoinformatics](https://github.com/tum-gis) and contributions are highly welcome. |
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,10 @@ | ||
# erosbag-cli | ||
|
||
CLI tool for processing ROS2 bags. | ||
|
||
> [!WARNING] | ||
> The library is at an early stage of development. | ||
## Contributing | ||
|
||
The library is developed at the [TUM Chair of Geoinformatics](https://github.com/tum-gis) and contributions are highly welcome. |
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 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use chrono::{DateTime, Duration, TimeZone, Utc}; | ||
use ecoord::{FrameId, ReferenceFrames}; | ||
use eimage::{ImageCollection, ImageSeries}; | ||
use erosbag::RosbagOpenOptions; | ||
use std::collections::HashMap; | ||
|
||
use std::path::Path; | ||
use tracing::info; | ||
|
||
pub fn run(rosbag_directory_path: impl AsRef<Path>, output_eimage_path: impl AsRef<Path>) { | ||
info!("Start extracting images"); | ||
info!("Rosbag path: {}", rosbag_directory_path.as_ref().display()); | ||
info!( | ||
"Output eimage path: {}", | ||
output_eimage_path.as_ref().display() | ||
); | ||
|
||
// fs::create_dir_all(output_file_path).unwrap(); | ||
|
||
let rosbag = RosbagOpenOptions::new() | ||
.read_write(true) | ||
.open(rosbag_directory_path.as_ref()) | ||
.unwrap(); | ||
|
||
let start_time: Option<DateTime<Utc>> = | ||
Some(Utc.timestamp_nanos(1579007185814586880 + 1000000000) + Duration::seconds(5)); | ||
let stop_time: Option<DateTime<Utc>> = start_time.map(|x| x + Duration::seconds(5)); | ||
|
||
let image_series = rosbag | ||
.get_images( | ||
&"/camera_side_left/rgb/image_rect_color".to_string(), | ||
&start_time, | ||
&stop_time, | ||
) | ||
.unwrap(); | ||
info!("Extracted {} images.", image_series.len()); | ||
let mut image_series_map: HashMap<FrameId, ImageSeries> = HashMap::new(); | ||
image_series_map.insert(FrameId::from("camera_side_left"), image_series); | ||
let image_collection = | ||
ImageCollection::new(image_series_map, ReferenceFrames::default()).unwrap(); | ||
eimage::io::EimageWriter::from_path(output_eimage_path) | ||
.unwrap() | ||
.finish(image_collection) | ||
.unwrap(); | ||
} |
Oops, something went wrong.