Package edu.tufts.hrilab.map
Class FloorMap
java.lang.Object
edu.tufts.hrilab.map.FloorMap
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addKnownPath
(String pathName, List<MapObject> path) getAdjacentNodes
(MapObject node) gets a set of all known MapObjectsgets a set of all known room MapObjectsgetButtonFromDoor
(MapObject door) gets the elevator button associated with the elevator-door TODO: can this be generalized?getConnectingRooms
(MapObject room) gets rooms accessible from a given roomgetElevatorDoors
(MapObject button) gets the elevator doors controlled by an elevator buttonint
Get floor number of this map.getKnownPath
(String pathName) getMapObjectAt
(javax.vecmath.Point3d p) Gets the map object at a location in meters.converts a symbol refID to a mapobjectGet YAML filename used to load map data.getNearestElevatorButton
(javax.vecmath.Point3d p) gets the MapObject of the nearest elevator button to the locationgetNearestPortal
(javax.vecmath.Point3d p) getNearestPortal(): gets the MapObject of the portal nearest to the pointgetPanelInElevator
(MapObject elevator) gets the elevator panel in an elevator TODO: can this be generalized?Get underlying pixel map.getPortalBetween
(MapObject roomA, MapObject roomB) gets the color of the portal between two roomsjavax.vecmath.Matrix4d
getPortalFromRoomPose
(MapObject portal, MapObject room, boolean facingPortal, double padding) gets the position and orientation facing towards/away portal p from room r padding meters awaycom.google.common.graph.EndpointPair<MapObject>
getRoomsFromPortal
(MapObject portal) gets the colors of the rooms the portal connectsboolean
isDoorClosed
(MapObject roomA, MapObject roomB) boolean
queries if a MapObject is a portalboolean
isPortal
(javax.vecmath.Point3d p) queries if a point is a portalvoid
Marks a portal between two rooms as either closed or open.void
setReferenceId
(MapObject mo, Symbol refId) Assign the MapObject a unique referenceId that is unique across all maps.
-
Constructor Details
-
FloorMap
-
-
Method Details
-
getMapYamlFile
Get YAML filename used to load map data. Exposed here so that it can be sent to ROS to load a new map when switching floors.- Returns:
-
setReferenceId
Assign the MapObject a unique referenceId that is unique across all maps.- Parameters:
mo
-refId
-
-
getFloorNumber
public int getFloorNumber()Get floor number of this map.- Returns:
-
getPixelMap
Get underlying pixel map.- Returns:
-
getAllObjects
gets a set of all known MapObjects- Returns:
- set with every MapObject
-
getAllRooms
gets a set of all known room MapObjects- Returns:
- set with all room MapObject
-
getKnownPath
-
addKnownPath
-
getMapObjectFromReferenceId
converts a symbol refID to a mapobject- Parameters:
refID
- symbol to get MapObject from- Returns:
- MapObject represented by refID
-
getPortalFromRoomPose
public javax.vecmath.Matrix4d getPortalFromRoomPose(MapObject portal, MapObject room, boolean facingPortal, double padding) gets the position and orientation facing towards/away portal p from room r padding meters away- Parameters:
portal
- MapObject portal to face towards/awayroom
- MapObject room to be infacingPortal
- if true, face portal, else face away from portalpadding
- how far away from portal to be in meters- Returns:
- pose representing looking at portal from room
-
getConnectingRooms
gets rooms accessible from a given room- Parameters:
room
- MapObject of room to get neighbors of- Returns:
- List of room MapObjects adjacent to the given room
-
getElevatorDoors
gets the elevator doors controlled by an elevator button- Parameters:
button
- MapObject of the button to get doors of- Returns:
- List of door MapObjects associated with the elevator button
-
getNearestElevatorButton
gets the MapObject of the nearest elevator button to the location- Parameters:
p
- Point in meter-space to query- Returns:
- MapObject of nearest elevator button
-
markDoor
Marks a portal between two rooms as either closed or open.- Parameters:
portal
- referenceID of portalclosed
- boolean specifying if door is open or closed; true is closed, false is open
-
isDoorClosed
-
getAdjacentNodes
-
getNearestPortal
getNearestPortal(): gets the MapObject of the portal nearest to the point- Parameters:
p
- Point in meter-space to query- Returns:
- Object color of nearest portal (can be door or elevator)
-
isPortal
public boolean isPortal(javax.vecmath.Point3d p) queries if a point is a portal- Parameters:
p
- Point in meter-space being query- Returns:
- true if there is a portal at p, false otherwise
-
isPortal
queries if a MapObject is a portal- Parameters:
mo
- MapObject to check- Returns:
- true if color is of a portal type, false otherwise
-
getPortalBetween
gets the color of the portal between two rooms- Parameters:
roomA
- MapObject of the source roomroomB
- MapObject of the target room- Returns:
- Color value of portal, returns -1 if no such portal exists
-
getRoomsFromPortal
gets the colors of the rooms the portal connects- Parameters:
portal
- MapObject of the portal to query- Returns:
- Pair of room MapObjects
-
getMapObjectAt
Gets the map object at a location in meters. Assumes query point is on current floor.- Parameters:
p
- - Point in meters to get object of- Returns:
- MapObject at p
-
getButtonFromDoor
gets the elevator button associated with the elevator-door TODO: can this be generalized?- Parameters:
door
- the MapObject of the elevator door- Returns:
- the MapObject of the elevator connected to provided door
-
getPanelInElevator
gets the elevator panel in an elevator TODO: can this be generalized?- Parameters:
elevator
- the MapObject for the elevator to look in- Returns:
- a MapObject of the elevator panel
-