Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
Signed-off-by: Reuben Thomas <[email protected]>
  • Loading branch information
reuben-thomas committed Jul 30, 2024
1 parent 556dbcf commit 2275af0
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 84 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: ci

on:
schedule:
# * is a special character in YAML so you have to quote this string
# The final 1 indicates that we want to run this test on Tuesdays, making
# this a weekly test.
- cron: '30 2 * * 1'
workflow_dispatch:
pull_request:
push:
branches: main

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ${{ matrix.runs-on }}-latest
strategy:
matrix:
runs-on: [ubuntu, windows]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rustup on Windows
if: matrix.runs-on == 'windows'
run: |
# Disable the download progress bar which can cause perf issues
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
.\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --default-toolchain=none
del rustup-init.exe
- name: Set Rust version to nightly
run: rustup default nightly

- name: Add Windows target
if: matrix.runs-on == 'windows'
run: |
rustc -Vv
cargo -V
rustup target add x86_64-pc-windows-msvc
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build workspace
run: cargo build --workspace --tests

- name: Run tests
run: cargo test --tests
32 changes: 0 additions & 32 deletions .github/workflows/ci_linux.yaml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/ci_windows.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[![style](https://github.com/open-rmf/mapf/actions/workflows/style.yaml/badge.svg)](https://github.com/open-rmf/mapf/actions/workflows/style.yaml)
[![ci_linux](https://github.com/open-rmf/mapf/actions/workflows/ci_linux.yaml/badge.svg)](https://github.com/open-rmf/mapf/actions/workflows/ci_linux.yaml)
[![ci_windows](https://github.com/open-rmf/mapf/actions/workflows/ci_windows.yaml/badge.svg)](https://github.com/open-rmf/mapf/actions/workflows/ci_windows.yaml)
[![ci](https://github.com/open-rmf/mapf/actions/workflows/ci.yaml/badge.svg)](https://github.com/open-rmf/mapf/actions/workflows/ci.yaml)

# multi-agent (path finding) planning framework

Expand Down
5 changes: 5 additions & 0 deletions mapf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
impl_trait_in_assoc_type,
result_flattening
)]
// TODO(@mxgrey): Eliminate the need for this by reducing the complexity of
// struct names, e.g. the typename for the complex chain that implements Lifted
// in activity.rs. This will probably go hand-in-hand with removing the need for
// nightly features, and improve compile times all at once.
#![type_length_limit = "157633981"]

pub mod domain;

Expand Down
2 changes: 1 addition & 1 deletion mapf/src/motion/conflict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ where
}

// The final state should be almost exactly the same as the last move
assert!((to_state.point() - last_p).norm() < 1e-3);
assert!((to_state.point() - last_p).norm_squared() < 1e-6);
Arclength {
translational,
rotational,
Expand Down
2 changes: 1 addition & 1 deletion mapf/src/motion/waypoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ where
}

// The final state should be almost exactly the same as the last move
assert!((to_state.point() - last_p).norm() < 1e-3);
assert!((to_state.point() - last_p).norm_squared() < 1e-6);
Arclength {
translational,
rotational,
Expand Down
8 changes: 5 additions & 3 deletions mapf/src/negotiation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,17 @@ pub fn negotiate(
let cs = scenario.cell_size;
let mut conflicts = HashMap::new();
triangular_for(scenario.agents.iter(), |(n_a, a), (n_b, b)| {
let min_dist = a.radius + b.radius;
let min_dist_squared = min_dist * min_dist;

for (cell_a, cell_b) in [
(a.start_cell(), b.start_cell()),
(a.goal_cell(), b.goal_cell()),
] {
let pa = cell_a.center_point(cs);
let pb = cell_b.center_point(cs);
let dist = (pa - pb).norm();
let min_dist = a.radius + b.radius;
if dist < min_dist {
let dist_squared = (pa - pb).norm_squared();
if dist_squared < min_dist_squared {
conflicts.insert(
(**n_a).clone().min((*n_b).clone()),
(**n_a).clone().max((*n_b).clone()),
Expand Down

0 comments on commit 2275af0

Please sign in to comment.