Localization, Beacon Placement and Mapping for Range-based Indoor Localization Systems