Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 8 additions & 6 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,15 @@ async fn generate_trajectory(

path_builder.set_bumpers(config.bumperLength, config.bumperWidth);

for o in circleObstacles {
path_builder.sgmt_circle_obstacle(0, wpt_cnt - 1, o.x, o.y, o.radius);
}
// Skip obstacles for now while we figure out whats wrong with them
// for o in circleObstacles {
// path_builder.sgmt_circle_obstacle(0, wpt_cnt - 1, o.x, o.y, o.radius);
// }

for o in polygonObstacles {
path_builder.sgmt_polygon_obstacle(0, wpt_cnt - 1, o.x, o.y, o.radius);
}
// Skip obstacles for now while we figure out whats wrong with them
// for o in polygonObstacles {
// path_builder.sgmt_polygon_obstacle(0, wpt_cnt - 1, o.x, o.y, o.radius);
// }
path_builder.set_drivetrain(&drivetrain);
path_builder.generate()
}
Expand Down
7 changes: 6 additions & 1 deletion src/components/navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
NavbarItemData,
NavbarItemSectionLengths,
NavbarItemSplitPoints,
ObstaclesEnabled,
} from "../../document/UIStateStore";

type Props = {};
Expand All @@ -25,7 +26,11 @@ class Navbar extends Component<Props, State> {
this.context.model.uiState;
return (
<div className={styles.Container}>
{NavbarItemSectionLengths.map((endSplit, sectionIdx) => (
{NavbarItemSectionLengths.filter(
(endSplit, sectionIdx) =>
sectionIdx != NavbarItemSectionLengths.length - 1 ||
ObstaclesEnabled
).map((endSplit, sectionIdx) => (
<ToggleButtonGroup
className={styles.ToggleGroup}
exclusive
Expand Down
61 changes: 36 additions & 25 deletions src/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Add from "@mui/icons-material/Add";
import SidebarConstraint from "./SidebarConstraint";
import SidebarObstacle from "./SidebarObstacle";
import { ICircularObstacleStore } from "../../document/CircularObstacleStore";
import { ObstaclesEnabled, UIStateStore } from "../../document/UIStateStore";

type Props = {};
type State = {};
Expand Down Expand Up @@ -139,32 +140,42 @@ class Sidebar extends Component<Props, State> {
</span>
</div>
)}
<Divider className={styles.SidebarDivider} textAlign="left" flexItem>
<span>OBSTACLES</span>
</Divider>
<div className={styles.WaypointList}>
{this.context.model.document.pathlist.activePath.obstacles.map(
(obstacle: ICircularObstacleStore, index: number) => {
return (
<SidebarObstacle
obstacle={obstacle}
index={index}
context={this.context}
></SidebarObstacle>
);
}
)}
</div>
{this.context.model.document.pathlist.activePath.obstacles.length ==
0 && (
<div className={styles.SidebarItem + " " + styles.Noninteractible}>
<span></span>
<span style={{ color: "gray", fontStyle: "italic" }}>
No Obstacles
</span>
</div>
{ObstaclesEnabled && (
<>
<Divider
className={styles.SidebarDivider}
textAlign="left"
flexItem
>
<span>OBSTACLES</span>
</Divider>
<div className={styles.WaypointList}>
{this.context.model.document.pathlist.activePath.obstacles.map(
(obstacle: ICircularObstacleStore, index: number) => {
return (
<SidebarObstacle
obstacle={obstacle}
index={index}
context={this.context}
></SidebarObstacle>
);
}
)}
</div>
{this.context.model.document.pathlist.activePath.obstacles
.length == 0 && (
<div
className={styles.SidebarItem + " " + styles.Noninteractible}
>
<span></span>
<span style={{ color: "gray", fontStyle: "italic" }}>
No Obstacles
</span>
</div>
)}
<Divider></Divider>
</>
)}
<Divider></Divider>
</div>
</div>
);
Expand Down
2 changes: 2 additions & 0 deletions src/document/UIStateStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export const SelectableItem = types.union(
...Object.values(ConstraintStores)
);

export const ObstaclesEnabled = false;

/* Navbar stuff */
export let WaypointData: {
[key: string]: {
Expand Down