Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ac3333c
Reorg fleet name param
xiyuoh Jul 15, 2025
7daa517
In-place task edit
xiyuoh Jul 16, 2025
c4f8099
Move Create New Task to center window
xiyuoh Jul 16, 2025
3989422
Move task panel to the left
xiyuoh Jul 22, 2025
0a97f7a
Children widget in dialog if create new task
xiyuoh Jul 23, 2025
a4fb9c3
Optional serializing for some items
xiyuoh Jul 23, 2025
dfd30f6
Infer fleet from robot
xiyuoh Jul 23, 2025
45c9a19
Merge remote-tracking branch 'origin/main' into xiyu/improve_tasks
xiyuoh Jul 23, 2025
a0f9023
Remove Grid to prevent glitch
xiyuoh Jul 29, 2025
e45e884
Merge branch 'main' into xiyu/improve_tasks
xiyuoh Aug 25, 2025
4975976
Update test site
xiyuoh Aug 25, 2025
c6211d4
Merge branch 'main' into xiyu/improve_tasks
luca-della-vedova Aug 29, 2025
c23dffa
Check if TaskKind is valid
xiyuoh Sep 1, 2025
f129a4a
In-place editing for task kind
xiyuoh Sep 1, 2025
a2390aa
Implement time sorting for tasks
xiyuoh Sep 2, 2025
73dc9a3
Fix pending tasks TaskParams not saved
xiyuoh Sep 2, 2025
8c278e2
Use Point<Entity> instead of String for GoToPlace locations
xiyuoh Sep 2, 2025
be19460
Merge remote-tracking branch 'origin/main' into xiyu/improve_tasks
xiyuoh Sep 2, 2025
4946083
Task-based visual cue for GoToPlace
xiyuoh Sep 3, 2025
f67cc3b
Use entities instead of name for Robot
xiyuoh Sep 3, 2025
ec9443d
Use timestamp as task id and fix saving
xiyuoh Sep 3, 2025
3c43a73
Fix saving location in tasks
xiyuoh Sep 4, 2025
f79bb7d
Insert valid task location
xiyuoh Sep 4, 2025
5de4cb7
Merge remote-tracking branch 'origin/main' into xiyu/improve_tasks
xiyuoh Sep 5, 2025
7de9d83
Do not allow editing fleet name via task widget
xiyuoh Sep 9, 2025
a92bf8a
Merge remote-tracking branch 'origin/main' into xiyu/improve_tasks
xiyuoh Oct 15, 2025
dec22ac
TODO: check why negotiation loops when goal changes
xiyuoh Oct 15, 2025
1d5c9bb
Merge remote-tracking branch 'origin/main' into xiyu/improve_tasks
xiyuoh Feb 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/demo_maps/test.site.json
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,7 @@
},
"robots": {
"52": {
"fleet": "HospitalRobot",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add tasks to this file so we make it part of our CI pipeline? It can be done in a followup if you prefer

"properties": {
"Collision": {
"config": {
Expand Down
5 changes: 4 additions & 1 deletion crates/rmf_site_editor/src/site/inclusion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ impl Property for Inclusion {
fn on_new_element(
for_element: Entity,
in_scenario: Entity,
_value: Inclusion,
value: Inclusion,
world: &mut World,
) {
// Insert inclusion modifier with given value into target scenario
world.trigger(UpdateModifier::modify(in_scenario, for_element, value));

let mut scenario_state: SystemState<
Query<(Entity, &ScenarioModifiers<Entity>, &Affiliation<Entity>)>,
> = SystemState::new(world);
Expand Down
49 changes: 48 additions & 1 deletion crates/rmf_site_editor/src/widgets/creation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ use crate::{
IsStatic, Members, ModelDescriptionBundle, ModelInstance, ModelMarker, ModelProperty,
NameInSite, Recall, RecallAssetSource, Scale,
},
widgets::{AssetGalleryStatus, Icons, InspectAssetSourceComponent, InspectScaleComponent},
widgets::{
AssetGalleryStatus, Icons, InspectAssetSourceComponent, InspectScaleComponent, TaskWidget,
},
AppState, CurrentWorkspace,
};

Expand Down Expand Up @@ -52,6 +54,7 @@ impl Plugin for StandardCreationPlugin {
DrawingCreationPlugin::default(),
ModelCreationPlugin::default(),
BrowseFuelTogglePlugin::default(),
TaskPanelTogglePlugin::default(),
));
}
}
Expand Down Expand Up @@ -668,6 +671,50 @@ impl<'w> WidgetSystem<Tile> for BrowseFuelToggle<'w> {
}
}

#[derive(Default)]
pub struct TaskPanelTogglePlugin {}

impl Plugin for TaskPanelTogglePlugin {
fn build(&self, app: &mut App) {
app.add_plugins(HeaderTilePlugin::<TaskPanelToggle>::new());
}
}

#[derive(SystemParam)]
pub struct TaskPanelToggle<'w> {
task_widget: Option<ResMut<'w, TaskWidget>>,
app_state: Res<'w, State<AppState>>,
}

impl<'w> WidgetSystem<Tile> for TaskPanelToggle<'w> {
fn show(_: Tile, ui: &mut Ui, state: &mut SystemState<Self>, world: &mut World) -> () {
let mut params = state.get_mut(world);
if !matches!(params.app_state.get(), AppState::SiteEditor) {
return;
}

let enabled = params.task_widget.is_some();
let toggled_on = params.task_widget.as_ref().is_some_and(|panel| panel.show);
let tooltip = if !enabled {
"Task panel is not available"
} else if toggled_on {
"Close task panel"
} else {
"Open task panel"
};

if ui
.add_enabled(enabled, Button::new("📋").selected(toggled_on))
.on_hover_text(tooltip)
.clicked()
{
if let Some(panel) = &mut params.task_widget {
panel.show = !panel.show;
}
}
}
}

/// Helper funtion to display the button name on hover
fn button_clicked(ui: &mut Ui, icon: &str, tooltip: &str) -> bool {
ui.add(Button::new(icon)).on_hover_text(tooltip).clicked()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use bevy::{
ecs::{component::Mutable, hierarchy::ChildOf, system::SystemParam},
prelude::Component,
};
use bevy_egui::egui::{ComboBox, Ui};
use bevy_egui::egui::{ComboBox, TextEdit, Ui};
use rmf_site_format::robot_properties::*;
use serde_json::{Error, Value};
use smallvec::SmallVec;
Expand Down Expand Up @@ -123,7 +123,7 @@ impl RobotPropertiesInspector {
struct InspectRobotProperties<'w, 's> {
model_instances: ModelPropertyQuery<'w, 's, Robot>,
model_descriptions:
Query<'w, 's, &'static ModelProperty<Robot>, (With<ModelMarker>, With<Group>)>,
Query<'w, 's, &'static mut ModelProperty<Robot>, (With<ModelMarker>, With<Group>)>,
inspect_robot_properties: Res<'w, RobotPropertiesInspector>,
children: Query<'w, 's, &'static Children>,
}
Expand All @@ -139,7 +139,7 @@ impl<'w, 's> WidgetSystem<Inspect> for InspectRobotProperties<'w, 's> {
state: &mut SystemState<Self>,
world: &mut World,
) {
let params = state.get_mut(world);
let mut params = state.get_mut(world);
let Some(description_entity) = get_selected_description_entity(
selection,
&params.model_instances,
Expand All @@ -148,9 +148,18 @@ impl<'w, 's> WidgetSystem<Inspect> for InspectRobotProperties<'w, 's> {
return;
};
// Ensure that this widget is displayed only when there is a valid Robot property
let Ok(ModelProperty(_robot)) = params.model_descriptions.get(description_entity) else {
let Ok(mut robot_model_property) = params.model_descriptions.get_mut(description_entity)
else {
return;
};

ui.horizontal(|ui| {
ui.label("Fleet:");
TextEdit::singleline(&mut robot_model_property.0.fleet)
.desired_width(ui.available_width())
.show(ui);
});

ui.label("Robot Properties");

let children: Result<SmallVec<[_; 16]>, _> = params
Expand Down
Loading
Loading