Skip to content

Commit

Permalink
use scenario branch as dependency
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 29, 2024
1 parent dbf301d commit 64c8034
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 19 deletions.
4 changes: 2 additions & 2 deletions mapf-rse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
mapf = { path="../mapf" }
rmf_site_format = { path = "../../rmf_site/rmf_site_format" }
rmf_site_editor = { path = "../../rmf_site/rmf_site_editor" }
rmf_site_format = { git = "https://github.com/reuben-thomas/rmf_site.git", branch = "scenarios", package = "rmf_site_format" }
rmf_site_editor = { git = "https://github.com/reuben-thomas/rmf_site.git", branch = "scenarios", package = "rmf_site_editor" }
bevy = { version = "0.12", features = ["pnm", "jpeg", "tga"] }
bevy_egui = "0.23.0"
2 changes: 1 addition & 1 deletion mapf-rse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ pub mod simulation;
pub use simulation::*;

pub mod negotiation;
use librmf_site_editor::widgets::PropertiesTilePlugin;
pub use negotiation::*;
use rmf_site_editor::widgets::PropertiesTilePlugin;

use bevy::prelude::*;

Expand Down
7 changes: 2 additions & 5 deletions mapf-rse/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
*/

use bevy::prelude::*;
use librmf_site_editor::*;
use mapf_rse::MapfRsePlugin;
use rmf_site_editor::*;

fn main() {
let mut app = App::new();
app.add_plugins((
SiteEditor::default(),
MapfRsePlugin::default(),
));
app.add_plugins((SiteEditor::default(), MapfRsePlugin::default()));

app.run();
}
2 changes: 1 addition & 1 deletion mapf-rse/src/negotiation/control_tile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use bevy_egui::egui::{
Align, CollapsingHeader, Color32, ComboBox, DragValue, Frame, Layout, ScrollArea, Slider,
Stroke, Ui,
};
use librmf_site_editor::{
use rmf_site_editor::{
interaction::{Select, Selection},
site::{
location, mobile_robot, Category, Change, ChangeCurrentScenario, CurrentScenario, Delete,
Expand Down
13 changes: 5 additions & 8 deletions mapf-rse/src/negotiation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use std::{
time::Duration,
};

use librmf_site_editor::{
use rmf_site_editor::{
interaction::{Select, Selection},
occupancy::{Cell, Grid},
site::{
Expand Down Expand Up @@ -142,11 +142,7 @@ pub fn generate_plan(
};

let agent = Agent {
start: to_cell(
robot_pose.trans[0],
robot_pose.trans[1],
cell_size,
),
start: to_cell(robot_pose.trans[0], robot_pose.trans[1], cell_size),
yaw: f64::from(robot_pose.rot.yaw().radians()),
goal: to_cell(
goal_transform.translation.x,
Expand Down Expand Up @@ -185,8 +181,9 @@ pub fn generate_plan(
elapsed_time
});
let task_entity = commands.spawn_empty().id();
commands.entity(task_entity).insert(ComputeNegotiateTask(task));

commands
.entity(task_entity)
.insert(ComputeNegotiateTask(task));
}

pub fn to_cell(x: f32, y: f32, cell_size: f32) -> [i64; 2] {
Expand Down
2 changes: 1 addition & 1 deletion mapf-rse/src/simulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use bevy::{ecs::system::SystemParam, prelude::*};
use bevy_egui::egui::{
Button, CollapsingHeader, Color32, ComboBox, DragValue, Frame, ScrollArea, Slider, Stroke, Ui,
};
use librmf_site_editor::{
use rmf_site_editor::{
interaction::{Select, Selection},
site::{
Category, Change, ChangeCurrentScenario, CurrentScenario, Delete, Group, MobileRobotMarker,
Expand Down
6 changes: 5 additions & 1 deletion mapf/src/motion/se2/timed_position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ mod tests {
let p = motion.compute_position(&t).ok().unwrap();
assert_relative_eq!(p.translation.vector[0], 1f64, max_relative = 0.001);
assert_relative_eq!(p.translation.vector[1], 7.5f64, max_relative = 0.001);
assert_relative_eq!(p.rotation.angle(), -(5f64).to_radians(), max_relative = 0.001);
assert_relative_eq!(
p.rotation.angle(),
-(5f64).to_radians(),
max_relative = 0.001
);

let v = motion.compute_velocity(&t).ok().unwrap();
assert_relative_eq!(v.translational[0], 0f64, max_relative = 0.001);
Expand Down

0 comments on commit 64c8034

Please sign in to comment.