Skip to content

Commit

Permalink
Merge branch 'calibration'
Browse files Browse the repository at this point in the history
  • Loading branch information
astraw committed Feb 24, 2025
2 parents 2ac2cd5 + 33d2658 commit 96d035f
Show file tree
Hide file tree
Showing 69 changed files with 4,338 additions and 1,153 deletions.
76 changes: 39 additions & 37 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ test_crates:
image: ubuntu:focal
script:
- _packaging/setup-ubuntu-base.sh
- _packaging/setup-opencv-4.9.0-static.sh
- export PATH="$PATH:$CARGO_HOME/bin"

- export RUSTFLAGS="-D warnings"
Expand Down Expand Up @@ -50,25 +49,33 @@ test_crates:
- cd $CI_PROJECT_DIR/bui-backend-session
- cargo test --release

# Test braid-april-cal, which requires opencv
- cd $CI_PROJECT_DIR/braid-april-cal
# run test in release mode, otherwise slow
- PKG_CONFIG_PATH=/opt/opencv-4.9.0-static/lib/pkgconfig OPENCV_STATIC=1 cargo test --release --features solve-pnp
- cd ..
# Test braid-april-cal
- cd $CI_PROJECT_DIR/geometry/braid-april-cal
- cargo test --release

# Test braid-april-cal, which requires opencv
- cd braid-april-cal/flytrax-apriltags-calibration
- PKG_CONFIG_PATH=/opt/opencv-4.9.0-static/lib/pkgconfig OPENCV_STATIC=1 cargo test --release
- cd ../..
# Test bundle-adj
- cd $CI_PROJECT_DIR/geometry/bundle-adj
- cargo test --release

# flytrax-csv-to-braidz, which requires opencv
- cd flytrax-csv-to-braidz
- PKG_CONFIG_PATH=/opt/opencv-4.9.0-static/lib/pkgconfig OPENCV_STATIC=1 cargo test --release --features "with_apriltags"
# Test braid-april-cal-cli
- cd $CI_PROJECT_DIR/geometry/braid-april-cal/braid-april-cal-cli
- cargo test --release

# Test flytrax-apriltags-calibration
- cd $CI_PROJECT_DIR/geometry/braid-april-cal/flytrax-apriltags-calibration
- cargo test --release

# Test flytrax-csv-to-braidz
- cd $CI_PROJECT_DIR/flytrax-csv-to-braidz
- cargo test --release --features "with_apriltags"
- cd ..

# Install opencv
- cd $CI_PROJECT_DIR
- _packaging/setup-opencv-4.9.0-static.sh

# Test freemovr-calibration, which requires opencv
- cd freemovr-calibration
# run test in release mode, otherwise slow
- PKG_CONFIG_PATH=/opt/opencv-4.9.0-static/lib/pkgconfig OPENCV_STATIC=1 cargo test --release --features "opencv"
- cd ..

Expand Down Expand Up @@ -139,7 +146,7 @@ test_flydra2:
# cargo run --bin braid-offline-retrack -- -d ..\..\rust-cam-testing-data\20200622_111457.braid -o tmp

test_crates_rust_stable:
image: rust:1.83
image: rust:1.85
script:
- apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y llvm-dev libclang-dev clang

Expand All @@ -161,7 +168,7 @@ test_crates_rust_stable:
- cargo test --features rerun-io

# Test braid-april-cal-webapp
- cd $CI_PROJECT_DIR/braid-april-cal/braid-april-cal-webapp
- cd $CI_PROJECT_DIR/geometry/braid-april-cal/braid-april-cal-webapp
- cargo test

# Test datetime-conversion
Expand Down Expand Up @@ -257,21 +264,20 @@ test_crates_rust_stable:
- cd ../..

test_crates_rust_nightly:
image: rust:1.83
image: rust:1.85
script:
- export RUSTFLAGS="-D warnings"

# Use known good nightly
- rustup update --no-self-update nightly-2024-12-14
- rustup update --no-self-update nightly-2025-02-14

# Test imops with nightly features
- cd imops
- cargo +nightly-2024-12-14 test --no-default-features --features std,simd
- cd ..
- cd $CI_PROJECT_DIR/imops
- cargo +nightly-2025-02-14 test --no-default-features --features std,simd

# Test fastfreeimage
- cd fastfreeimage
- cargo +nightly-2024-12-14 test --features portsimd
- cd $CI_PROJECT_DIR/fastfreeimage
- cargo +nightly-2025-02-14 test --features portsimd
- cd ..

test_flydra_feature_detector:
Expand Down Expand Up @@ -338,7 +344,7 @@ led-box-standalone-ubuntu2004-deb:
name: "led-box-standalone-debs-${CI_COMMIT_SHA}"

build-freemovr-calibration:
image: rust:1.83
image: rust:1.85
script:
- export RUSTFLAGS="-D warnings"
- cd freemovr-calibration/freemovr-calibration-cli
Expand All @@ -353,7 +359,7 @@ build-freemovr-calibration:
name: "freemovr-cal-linux-${CI_COMMIT_SHA}"

build-freemovr-calibration-webapp:
image: rust:1.83
image: rust:1.85
script:
- export RUSTFLAGS="-D warnings"
- export PATH="$PATH:$CARGO_HOME/bin"
Expand Down Expand Up @@ -565,14 +571,13 @@ flytrax-csv-to-braidz-binary:
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- _packaging/setup-opencv-4.9.0-static.sh
- curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal -y
- export PATH="$PATH:$CARGO_HOME/bin"
- export RUSTFLAGS="-D warnings"

- cd $CI_PROJECT_DIR/flytrax-csv-to-braidz
- OPENCV_STATIC=1 PKG_CONFIG_PATH=/opt/opencv-4.9.0-static/lib/pkgconfig cargo test --release --features "with_apriltags"
- OPENCV_STATIC=1 PKG_CONFIG_PATH=/opt/opencv-4.9.0-static/lib/pkgconfig cargo build --release --features "with_apriltags"
- cargo test --release --features "with_apriltags"
- cargo build --release --features "with_apriltags"

- mkdir -p $CI_PROJECT_DIR/build
- ldd -v $CI_PROJECT_DIR/target/release/flytrax-csv-to-braidz
Expand Down Expand Up @@ -690,7 +695,6 @@ extra-programs:
image: ubuntu:focal
script:
- apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl clang libclang-dev pkg-config dpkg-dev debhelper zip
- _packaging/setup-opencv-4.9.0-static.sh
- curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal -y
- source $CARGO_HOME/env
- export RUSTFLAGS="-D warnings"
Expand All @@ -710,7 +714,7 @@ extra-programs:
- cp $CI_PROJECT_DIR/target/release/braidz-mcsc $CI_PROJECT_DIR/build

- cd $CI_PROJECT_DIR/braidz-export-rrd
- PKG_CONFIG_PATH=/opt/opencv-4.9.0-static/lib/pkgconfig OPENCV_STATIC=1 cargo build --release
- cargo build --release
- ldd -v $CI_PROJECT_DIR/target/release/braidz-export-rrd
- cp ../target/release/braidz-export-rrd $CI_PROJECT_DIR/build

Expand Down Expand Up @@ -752,7 +756,7 @@ fmf-cli:
name: "fmf-cli-${CI_COMMIT_SHA}"

braid-webapps:
image: rust:1.83
image: rust:1.85
script:
- export RUSTFLAGS="-D warnings"

Expand All @@ -772,12 +776,10 @@ braid-webapps:
- cd braidz-viewer
- cargo update -p wasm-bindgen --precise 0.2.100
- ./build.sh
- cd ..

- cd braid-april-cal/braid-april-cal-webapp
- cd $CI_PROJECT_DIR/geometry/braid-april-cal/braid-april-cal-webapp
- cargo update -p wasm-bindgen --precise 0.2.100
- ./build.sh
- cd ../..

braid-run-binary:
# Build on Ubuntu Focal (20.04) but doesn't link libraries with
Expand Down Expand Up @@ -818,7 +820,7 @@ braid-run-binary:
name: "braid-run-binary-${CI_COMMIT_SHA}"

led-box-linux:
image: rust:1.83
image: rust:1.85
script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get install -y libudev-dev
Expand All @@ -834,7 +836,7 @@ led-box-linux:
name: "led-box-linux-${CI_COMMIT_SHA}"

led-box-firmware:
image: rust:1.83
image: rust:1.85
script:
- rustc --version
- cd led-box/led-box-firmware
Expand Down Expand Up @@ -1045,7 +1047,7 @@ build_simple:
- cargo build --release

test_user_guide:
image: rust:1.83
image: rust:1.85
script:
- cd strand-braid-user/users-guide
- curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.18/mdbook-v0.4.18-x86_64-unknown-linux-gnu.tar.gz | tar -xz
Expand Down
19 changes: 13 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ members = [
"braid/braid-run/braid_frontend",
"braid/braidz-writer",
"braid/braidz-writer/cli",
"braid-april-cal",
"braid-april-cal/braid-april-cal-webapp",
"braid-april-cal/flytrax-apriltags-calibration",
"braid-config-data",
"braid-offline",
"braid-process-video",
Expand Down Expand Up @@ -51,7 +48,12 @@ members = [
"freemovr-calibration/freemovr-calibration-cli",
"freemovr-calibration/freemovr-calibration-webapp",
"freemovr-calibration/ncollide-geom",
"geometry/braid-april-cal",
"geometry/braid-april-cal/braid-april-cal-cli",
"geometry/braid-april-cal/braid-april-cal-webapp",
"geometry/braid-april-cal/flytrax-apriltags-calibration",
"geometry/braidz-mcsc",
"geometry/bundle-adj",
"geometry/camcal",
"geometry/flydra-mvg",
"geometry/mcsc-structs",
Expand All @@ -64,6 +66,7 @@ members = [
"geometry/refraction/bisection-search",
"geometry/simple-obj-parse",
"geometry/textured-tri-mesh",
"geometry/undistort-image",
"http-video-streaming",
"http-video-streaming/http-video-streaming-types",
"imops",
Expand Down Expand Up @@ -131,14 +134,14 @@ debug = true
adskalman = "0.16"
anyhow = "1"
approx = "0.5"
apriltag-sys = "0.3"
async-change-tracker = "0.3.4"
axum = "0.8.1"
axum-token-auth = "0.2.0"
base64 = "0.12"
byteorder = "1"
bytes = "1.6"
cam-geom = { version = "0.15", features = ["serde-serialize"] }
camino = "1.1.9"
chrono = { version = "0.4.38", features = ["serde"] }
clap = { version = "4.4.3", features = ["derive", "env", "string"] }
configure = "0.1.1"
Expand Down Expand Up @@ -177,6 +180,7 @@ hyper-util = { version = "0.1.1", features = [
] }
iana-time-zone = "0.1"
image = { version = "0.25", default-features = false, features = [
"bmp",
"jpeg",
"png",
"tiff",
Expand All @@ -189,6 +193,7 @@ js-sys = "0.3.77"
json-lines = { version = "0.1.0", features = ["codec"] }
lazy_static = "1.4"
less-avc = "0.1.4"
levenberg-marquardt = "0.14.0"
libc = "0.2"
libflate = "0.1"
log = "0.4"
Expand Down Expand Up @@ -265,7 +270,7 @@ basic-frame = { path = "basic-frame" }
bisection-search = { path = "geometry/refraction/bisection-search" }
bg-movie-writer = { path = "media-utils/bg-movie-writer" }
braid = { path = "braid" }
braid-april-cal = { path = "braid-april-cal" }
braid-april-cal = { path = "geometry/braid-april-cal" }
braid-config-data = { path = "braid-config-data" }
braid-http-session = { path = "braid-http-session" }
braid-offline = { path = "braid-offline" }
Expand All @@ -275,6 +280,7 @@ braidz-writer = { path = "braid/braidz-writer" }
bui-backend-session = { path = "bui-backend-session" }
bui-backend-session-types = { path = "bui-backend-session/types" }
build-util = { path = "build-util" }
bundle-adj = { path = "geometry/bundle-adj" }
camcal = { path = "geometry/camcal" }
ci2 = { path = "camera/ci2" }
ci2-async = { path = "camera/ci2-async" }
Expand All @@ -301,7 +307,7 @@ flydra-pt-detect-cfg = { path = "flydra-feature-detector/flydra-pt-detect-cfg" }
flydra-types = { path = "flydra-types", default-features = false }
flydra-mvg = { path = "geometry/flydra-mvg" }
flydra2 = { path = "flydra2", default-features = false }
flytrax-apriltags-calibration = { path = "braid-april-cal/flytrax-apriltags-calibration" }
flytrax-apriltags-calibration = { path = "geometry/braid-april-cal/flytrax-apriltags-calibration" }
flytrax-io = { path = "strand-cam/flytrax-io" }
fmf = { path = "media-utils/fmf" }
font-drawing = { path = "media-utils/font-drawing" }
Expand Down Expand Up @@ -332,6 +338,7 @@ textured-tri-mesh = { path = "geometry/textured-tri-mesh" }
tiff-decoder = { path = "media-utils/tiff-decoder" }
tracking = { path = "tracking" }
ufmf = { path = "media-utils/ufmf" }
undistort-image = { path = "geometry/undistort-image" }
vimba = { path = "camera/vimba" }
withkey = { path = "utils/withkey" }
y4m-writer = { path = "media-utils/y4m-writer" }
Expand Down
2 changes: 1 addition & 1 deletion ads-apriltag/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
rust-version = "1.76"

[dependencies]
apriltag-sys.workspace = true
apriltag-sys = "0.3"
machine-vision-formats.workspace = true

[dev-dependencies]
Expand Down
9 changes: 6 additions & 3 deletions basic-frame/src/dynamic_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,18 @@ impl DynamicFrame {
/// Return the image as a `BasicFrame` converting the data to the requested
/// pixel format as necessary.
///
/// Note that although this consumes [Self], it does not make sense to
/// implement a variant which takes only a reference because the data must
/// be copied in that case anyway.
/// If the requested pixel format is the current pixel format, this moves
/// the data (without reallocation or copying). Otherwise, the data is
/// converted.
///
/// To avoid converting the data, use [Self::as_basic].
pub fn into_pixel_format<FMT>(self) -> Result<BasicFrame<FMT>, convert_image::Error>
where
FMT: PixelFormat,
{
// TODO: return a CowImage that views data when it doesn't need to be
// converted and allocates new data when it does.

let pixfmt = formats::pixel_format::pixfmt::<FMT>().unwrap();
if pixfmt == self.pixel_format() {
// Fast path. Simply return the data.
Expand Down
1 change: 0 additions & 1 deletion braid-april-cal/opencv-test.sh

This file was deleted.

7 changes: 3 additions & 4 deletions braidz-export-rrd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ nalgebra.workspace = true
regex.workspace = true
machine-vision-formats.workspace = true
rayon = "1.9.0"
opencv = { version = "0.90", optional = true }

braidz-parser.workspace = true
env-tracing-logger.workspace = true
Expand All @@ -30,12 +29,12 @@ braidz-types.workspace = true
flydra-types.workspace = true
convert-image.workspace = true
frame-source.workspace = true
basic-frame.workspace = true
basic-frame = { workspace = true, features = ["convert-image"] }
ci2-remote-control.workspace = true
mp4-writer = { workspace = true, features = ["nv-encode"] }
undistort-image.workspace = true

[features]
default = ["undistort-images", "openh264-encode"]
default = ["openh264-encode"]

undistort-images = ["opencv", "basic-frame/convert-image"]
openh264-encode = ["mp4-writer/openh264-encode", "frame-source/openh264"]
Loading

0 comments on commit 96d035f

Please sign in to comment.