-
Notifications
You must be signed in to change notification settings - Fork 69
RegionEditor
The Region Editor (regionEditor.py) is the LTLMoP GUI for creating and editing polygonal maps for the discretized workspace. The region editor can be run or it's own, but is more commonly run from the primary LTLMoP window, in the Specification Editor. There are four primary parts to the Region Editor window, shown in the picture below:
- Menu Bar: This contains 4 drop-down menus that provide access to all of the Region Editor's tasks.
- Shortcuts: This bar contains shortcuts to 5 commonly used commands.
- Toolbar: This bar contains buttons for the 6 drawing tools used in Region Editor.
- Workspace: The main part of the window, where the map is drawn.
The Menu Bar provides 4 drop-down menus with access to all of Region Editor's commands.
The File menu provides access to the following commands:
- New: Create a new region file, with a blank workspace.
- Open...: Open an existing region file.
- Close: Closes the currently open region file, and exits Region Editor.
- Import Background...: Opens a dialog box to allow the user to import a picture file (.jpg or .png) to place in the background of the Region Editor workspace (e.g. a reference map or floor plan).
- Save: Saves the current workspace to the region file.
- Save As...: Opens a dialog box that allows the user to specify a destination and file name for saving the current workspace.
- Revert...: Reverts the current workspace to the most recently saved state.
- Quit: Closes all windows and exits the Region Editor.
- Undo: Reverts the most recent change made to the workspace. Note: this command functions as both an Undo and a Redo button, and will only revert the single most recent change to the workspace (selecting it a 2nd time will restore the undone change).
- Select All: Selects all regions in the workspace.
- Edit Region...: Opens the region properties dialog box for the currently selected region.
- Duplicate: Makes a duplicate copy of the currently selected region in the workspace (note that the duplicate region is placed directly on top of the region that it is duplicated from).
- Delete: Deletes the currently selected region from the workspace.
- Selection: Select objects in the editor.
- Rectangle: Draw a rectangle by clicking on two arbitrary points in the editor.
- Polygon: Create a polygon with multiple points. Click on the starting point to close the polygon, or double click when creating the last point to automatically close the polygon.
- Create Point: Add a point(vertex) to rectangles or polygons in the map. Click on the edge of the object where you want to add a point.
- Delete Point: Remove a point(vertex) on rectangles or polygons in the map. Click on the selected point to remove the vertex.
- Toggle Calibration Points: Add/remove calibration points from the map. You are required to add at least three calibration points in case of using a physical robot or Gazebo robot simulator. These points should be as far as possible from each other (and not co-linear).
- Create minimal boundary polygon: Creates a simple boundary polygon that encompasses all of the polygons currently in the workspace. Note that all maps must include a boundary region. This region can be created manually (by drawing a region normally, then renaming it to "boundary"), or it can be automatically created with this tool.
The shortcut bar provides access to 5 commonly used commands from the File and Edit menus.
- New: Create a new region file, with a blank workspace.
- Open...: Open an existing region file.
- Save: Saves the current workspace to the region file.
- Undo: Reverts the most recent change made to the workspace. Note: this command functions as both an Undo and a Redo button, and will only revert the single most recent change to the workspace (selecting it a 2nd time will restore the undone change).
- Duplicate: Makes a duplicate copy of the currently selected region in the workspace (note that the duplicate region is placed directly on top of the region that it is duplicated from).
The Toolbar provides shortcut buttons for accessing most of the tools in the Tools Menu.
Tools | Description |
Selection |
Select objects in the editor. |
Polygon |
Create a polygon with multiple points. Click on the starting point to close the polygon, or double click when creating the last point to automatically close the polygon. |
Rectangle |
Draw a rectangle by clicking on two arbitrary points in the editor. |
Create Point |
Add a point(vertex) to rectangles or polygons in the map. Click on the edge of the object where you want to add a point. |
Delete Point |
Remove a point(vertex) on rectangles or polygons in the map. Click on the selected point to remove the vertex. |
Toggle Calibration Points |
Add/remove calibration points from the map. You are required to add at least three calibration points in case of using a physical robot or Gazebo robot simulator. These points should be as far as possible from each other (and not co-linear). |
The Workspace occupies the majority of the Region Editor window, and is where the user draws the desired polygonal map. The following figure shows an example workspace with an existing map. Five characteristics of the workspace are shown in this figure:
- This is the Region Properties dialog box, which can be accessed via the Edit Menu, or by double-clicking on a region. The dialog box allows you to change the name of the selected region, change the fill-color of the polygon, and set LTLMoP to treat the selected region as an obstacle (which causes LTLMoP to remove it from the robot's accessible workspace).
- A boundary region is required for all maps, and can be created manually (by renaming the region to "boundary") or automatically (Tools > Create minimal boundary polygon). Unlike the other polygons in the map, the boundary polygon is not filled, with only the border and the name visible.
- Polygons that are not convex will be marked by cross-hatching in the fill color. Such regions may be decomposed to smaller, convex regions, if the motion handler requires it.
- Polygons that are to be treated as obstacles (by activating the check-box in the Region Properties dialog box), will be indicated by parentheses around the region names.
- Any calibration points that are added to the map will be marked with red points, and are named for the region they are attached to and the number of calibration points.
- Any region borders that are shared by two adjacent regions will be marked by a dashed red line. The movement of the robot is restricted to adjacent regions, so the robot can only move between two regions if they share a border (the free space is automatically decomposed into additional regions, as necessary).