Skip to content

Commit

Permalink
Remove workcell and robot location icons
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
  • Loading branch information
luca-della-vedova committed Aug 31, 2023
1 parent 24943d5 commit 557d68f
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 265 deletions.
Binary file removed assets/textures/robot.png
Binary file not shown.
111 changes: 0 additions & 111 deletions assets/textures/robot.svg

This file was deleted.

Binary file removed assets/textures/workcell.png
Binary file not shown.
92 changes: 0 additions & 92 deletions assets/textures/workcell.svg

This file was deleted.

12 changes: 0 additions & 12 deletions rmf_site_editor/src/site/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ pub struct SiteAssets {
pub charger_material: Handle<StandardMaterial>,
pub holding_point_material: Handle<StandardMaterial>,
pub parking_material: Handle<StandardMaterial>,
pub robot_material: Handle<StandardMaterial>,
pub workcell_material: Handle<StandardMaterial>,
}

impl FromWorld for SiteAssets {
Expand All @@ -71,12 +69,6 @@ impl FromWorld for SiteAssets {
let parking_texture = asset_server.load(&String::from(&AssetSource::Bundled(
"textures/parking.png".to_string(),
)));
let robot_texture = asset_server.load(&String::from(&AssetSource::Bundled(
"textures/robot.png".to_string(),
)));
let workcell_texture = asset_server.load(&String::from(&AssetSource::Bundled(
"textures/workcell.png".to_string(),
)));

let mut materials = world
.get_resource_mut::<Assets<StandardMaterial>>()
Expand Down Expand Up @@ -162,8 +154,6 @@ impl FromWorld for SiteAssets {
let charger_material = materials.add(charger_texture.into());
let holding_point_material = materials.add(holding_point_texture.into());
let parking_material = materials.add(parking_texture.into());
let robot_material = materials.add(robot_texture.into());
let workcell_material = materials.add(workcell_texture.into());

let mut meshes = world.get_resource_mut::<Assets<Mesh>>().unwrap();
let level_anchor_mesh = meshes.add(
Expand Down Expand Up @@ -271,8 +261,6 @@ impl FromWorld for SiteAssets {
charger_material,
holding_point_material,
parking_material,
robot_material,
workcell_material,
}
}
}
Expand Down
48 changes: 6 additions & 42 deletions rmf_site_editor/src/site/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ pub struct LocationTagMeshes {
charger: Option<Entity>,
parking_spot: Option<Entity>,
holding_point: Option<Entity>,
spawn_robot: Option<Entity>,
workcell: Option<Entity>,
}

fn location_halo_tf(tag: &LocationTag) -> Transform {
Expand Down Expand Up @@ -100,8 +98,8 @@ pub fn add_location_visuals(

let position = anchors
.point_in_parent_frame_of(point.0, Category::Location, e)
.unwrap();
//+ LOCATION_LAYER_HEIGHT * Vec3::Z;
.unwrap()
+ LOCATION_LAYER_HEIGHT * Vec3::Z;

let mut tag_meshes = LocationTagMeshes::default();
for tag in tags.iter() {
Expand All @@ -119,14 +117,8 @@ pub fn add_location_visuals(
tag_meshes.holding_point = Some(id);
assets.holding_point_material.clone()
}
LocationTag::SpawnRobot(_) => {
tag_meshes.spawn_robot = Some(id);
assets.robot_material.clone()
}
LocationTag::Workcell(_) => {
tag_meshes.workcell = Some(id);
assets.workcell_material.clone()
}
// Workcells and robots are not visualized
LocationTag::SpawnRobot(_) | LocationTag::Workcell(_) => continue,
};
commands.entity(id).insert(PbrBundle {
mesh: assets.location_tag_mesh.clone(),
Expand Down Expand Up @@ -241,18 +233,6 @@ pub fn update_location_for_changed_location_tags(
tag_meshes.holding_point = None;
}
}
if let Some(id) = tag_meshes.spawn_robot {
if !tags.iter().any(|t| t.spawn_robot().is_some()) {
commands.entity(id).despawn_recursive();
tag_meshes.spawn_robot = None;
}
}
if let Some(id) = tag_meshes.workcell {
if !tags.iter().any(|t| t.workcell().is_some()) {
commands.entity(id).despawn_recursive();
tag_meshes.workcell = None;
}
}
// Spawn the new tags
for tag in tags.iter() {
let (id, material) = match tag {
Expand Down Expand Up @@ -283,24 +263,8 @@ pub fn update_location_for_changed_location_tags(
continue;
}
}
LocationTag::SpawnRobot(_) => {
if tag_meshes.spawn_robot.is_none() {
let id = commands.spawn_empty().id();
tag_meshes.spawn_robot = Some(id);
(id, assets.robot_material.clone())
} else {
continue;
}
}
LocationTag::Workcell(_) => {
if tag_meshes.workcell.is_none() {
let id = commands.spawn_empty().id();
tag_meshes.workcell = Some(id);
(id, assets.workcell_material.clone())
} else {
continue;
}
}
// Workcells and robots are not visualized
LocationTag::SpawnRobot(_) | LocationTag::Workcell(_) => continue,
};
commands.entity(id).insert(PbrBundle {
mesh: assets.location_tag_mesh.clone(),
Expand Down
8 changes: 0 additions & 8 deletions rmf_site_editor/src/site_asset_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,6 @@ impl SiteAssetIo {
"textures/stopwatch.png".to_owned(),
include_bytes!("../../assets/textures/stopwatch.png").to_vec(),
);
self.bundled_assets.insert(
"textures/robot.png".to_owned(),
include_bytes!("../../assets/textures/robot.png").to_vec(),
);
self.bundled_assets.insert(
"textures/workcell.png".to_owned(),
include_bytes!("../../assets/textures/workcell.png").to_vec(),
);
}
}

Expand Down

0 comments on commit 557d68f

Please sign in to comment.