Commit Graph

42 Commits

Author SHA1 Message Date
Matteo Cypriani a301c87c1d [Positioning] Fix segfault when ignoring AP RP
This commit fixes a segfault that occurred in certain circumstances with
the option positioning.radar-ignore-ap-reference-points activated. The
bug was introduced with this option in 0da98cdb.
2011-08-23 19:58:49 +02:00
Matteo Cypriani 6167f664e8 [Positioning] Use AccessPoint::friis_constant_term()
Use AccessPoint::friis_constant_term() wherever possible.
Fix MultilaterationAlgorithm::make_constant_term() and
ReferencePoint::friis_indexes_for_ap(), where the AP's trx
power was used instead of the mobile's power.
2011-08-01 19:57:40 +02:00
Matteo Cypriani bfc09fdbe6 [Positioning] Stock::in_which_area_is(): ref param
Fix a typo in the header of Stock::in_which_area_is() to pass the
argument as a reference.
2011-07-30 20:46:32 +02:00
Matteo Cypriani dcf425fce5 [Positioning] Stock::generate_reference_point()
Create the function Stock::generate_reference_point(Point3D) from
regenerate_reference_points().
2011-07-30 20:46:32 +02:00
Matteo Cypriani 4c9a3070ac [Positioning] Stock::delete_non_ap_calibration_requests()
Create the function Stock::delete_non_ap_calibration_requests() from
regenerate_reference_points().
2011-07-30 20:46:32 +02:00
Matteo Cypriani 21c7f80345 [Positioning] Rename options minmax-* area-*
The options minmax-start and minmax-stop are also used by the
autocalibration process to know in which area reference points must be
generated. Therefore these options are renamed area-start and area-stop.
2011-07-30 19:53:13 +02:00
Matteo Cypriani a9f4750f34 [Positioning] Split option generated-meshing-grain
Split the option positioning.generated-meshing-grain in two:
positioning.generated-meshing-grain-x and
positioning.generated-meshing-grain-y.
2011-07-30 19:49:42 +02:00
Matteo Cypriani 0da98cdb05 [Positioning] Opt. radar-ignore-ap-reference-points
Add the option positioning.radar-ignore-ap-reference-points, to be able
to select only generated reference points.
2011-07-30 19:48:20 +02:00
Matteo Cypriani 4675ac9f48 [Positioning] Stock::store_CR() returns the CR
Stock::store_calibration_request() now returns the stored/found
calibration request.
2011-07-29 23:02:26 +02:00
Matteo Cypriani a1dd6d90d8 [Positioning] Fix RP generation with >3 APs
When selecting the 2 reference APs, skip the APs that do not have (yet)
an associated reference point.
2011-07-29 23:02:26 +02:00
Matteo Cypriani 84acee629c [Positioning] Add Stock::reference_point_exists() 2011-07-29 23:02:26 +02:00
Matteo Cypriani c11e33fd0b [Positioning] Add missing #include <iostream> 2011-07-29 23:02:26 +02:00
Matteo Cypriani a951717433 [Positioning] Add Stock::in_which_area_is() 2011-07-29 23:02:26 +02:00
Matteo Cypriani 9b245ce152 [Positioning] Add option generated-meshing-grain
The option positioning.generated-meshing-grain allows to set the
grain of the generated reference points' meshing.
2011-07-29 23:02:26 +02:00
Matteo Cypriani 26e3c33366 [Positioning] RP generation: fix SS weighting
The weighted mean of the SSs for the selected APs was wrong (an extra
division by 2)
2011-07-29 23:02:26 +02:00
Matteo Cypriani 2ddad20371 [Positioning] Stock: generate one CR for all APs
A Request is received by *all* the APs, therefore we have to generate
one CalibrationRequest per ReferencePoint, and not one
CalibrationRequest per AP in each ReferencePoint.
2011-07-29 23:02:25 +02:00
Matteo Cypriani 3402809c09 [Positioning] Stock: do not regenerate AP coord.
Do not generate reference points where an AP sits (normally we already
have the true measurement).
2011-07-29 23:02:25 +02:00
Matteo Cypriani a801eb84d1 [Positioning] Add Stock::is_ap_coordinate() 2011-07-29 23:02:25 +02:00
Matteo Cypriani 0d160f8b23 [Positioning] Add option generate-reference-points
The self-calibration is here! There is certainly some things to fix, but
the big step is made.
2011-07-29 23:02:25 +02:00
Matteo Cypriani d1b575c95e [Positioning] Add Stock::nb_virtual_mobiles 2011-07-29 23:02:25 +02:00
Matteo Cypriani a2a289f651 [Positioning] Debug checks for CR deletion
Add asserts and debug messages in ReferencePoint::delete_requests() and
Stock::delete_calibration_request().
2011-07-29 23:02:14 +02:00
Matteo Cypriani 6b662a597a [Positioning] Add Stock::mobile_exists() 2011-07-25 14:18:17 +02:00
Matteo Cypriani b04cd1cdb8 [Positioning] Add Stock::find_create_mobile(Mobile&) 2011-07-25 14:18:17 +02:00
Matteo Cypriani 2b1248fbec [Positioning] Add Stock::ap_exists() 2011-07-25 14:18:16 +02:00
Matteo Cypriani 68b97451aa [Positioning] Print new created APs when verbose 2011-07-25 14:18:16 +02:00
Matteo Cypriani 0491fe0a62 [Positioning] Input: del RP's requests on new CR
When a new calibration request is received, all the calibration requests
of the corresponding reference point are now cleared prior to add the
new request.
We should probably use a timeout to delete only the old calibration
requests and keep the recent ones.
2011-07-25 14:18:16 +02:00
Matteo Cypriani 586cfdb77e [Positioning] Stock::store_calibration_request()
InputDataReader::stock_calibration_request() becomes
Stock::store_calibration_request(), so other classes can use it.
2011-07-25 14:18:16 +02:00
Matteo Cypriani 71784342e7 [Positioning] Add Stock::ap_matrix_get_ss()
Add double Stock::ap_matrix_get_ss(transmitter, receiver).
This is the first step to handle self-calibration in owlps-positioning.

The idea is to simulates a square matrix of the listeners, with the
transmitters in one dimension and the receivers in the other dimension.
matrix[transmitter][receiver] is the signal strength received by
'receiver' from 'transmitter'.
The purpose of Stock::ap_matrix_get_ss() is precisely to access the
entry matrix[transmitter][receiver].

Note that the access is read-only, as the pseudo-matrix is (or will be)
filled by the standard mechanism of (auto)calibration requests and
measurements stored in Stock.
2011-07-25 14:18:16 +02:00
Matteo Cypriani 88aaded78c [Positioning] Add Stock::get_reference_point() 2011-07-25 14:18:16 +02:00
Matteo Cypriani d322221d21 [Positioning] Stock: fix ReferencePoint creation
For each calibration request read, a new ReferencePoint was created in
Stock. This is because of the behaviour of unordered_set: as pertaining
to unordered_set, two elements are not considered equal if the hashes
alone are identical, they must also be actually equal (operator==).

The problem was fixed by using a custom equality check function that
checks the equality only on the coordinates of the ReferencePoint (as if
it was a Point3D).
2011-06-07 18:48:33 +02:00
Matteo Cypriani a39e06cf19 [Positioning] Stock::closest_calibration_request()
Add CalibrationRequest Stock::closest_calibration_request(Request).
2011-05-13 10:51:52 +02:00
Matteo Cypriani 1fb6e39d27 [Positioning] Handle AP reading from a CSV file
Add class AccessPointsReaderCSV and make InputDataReader to use it.

Stock: Add function find_create_ap(const AccessPoint&).
2011-03-16 14:36:24 +01:00
Matteo Cypriani 29ce5a51af [Positioning] Stock: reorganise with Doxygen groups 2011-03-16 14:36:24 +01:00
Matteo Cypriani 1e605ae16d [Positioning] Stock: add some comments 2011-03-16 14:36:24 +01:00
Matteo Cypriani c731bf578f [Positioning] Add positioning algorithm Basic FRBHM
Add class FRBHMBasic, which derives FBCM and RADAR.

ReferencePoint: Add functions friis_index_for_ap() and
friis_indexes_for_ap() (that takes code away from
Stock::update_all_friis_indexes()).

CartographyAlgorithm and MultilaterationAlgorithm now extend
PositioningAlgorithm with "public virtual" instead of "public".

CartographyAlgorithm: select_point() must now return a ReferencePoint.

MultilaterationMethod: Add pure virtual function multilaterate_2d().

MinMax: Add function multilaterate_2d().

MultilaterationAlgorithm: Add function multilaterate_2d() to map
MultilaterationMethod::multilaterate_2d().

Makefile: Fix some dependencies.
2011-03-16 14:36:24 +01:00
Matteo Cypriani e12db08b0d [Positioning] Add positioning algorithm FBCM
Add class FBCM.

AccessPoint: Add attribute friis_index.

Measurement: Add function get_ss_list_size().

Stock: Add function update_all_friis_indexes().
2011-03-16 14:36:23 +01:00
Matteo Cypriani e9eab6876d [Positioning] Add RADAR positioning algorithm
Add classes RADAR and CartographyAlgorithm, which is the super-class of
SS map based algorithms.

Measurement: Add functions:
- add_ss_list(), to add several SS in one operation.
- merge(), to merge a Measurement into another.
- ss_square_distance() (from old commented code), to compute the
  distance to a SS value or another Measurement.

posexcept: Add exception cannot_merge, used by Measurement::merge().

ReferencePoint:
- Add ss_square_distance() and functions used by it:
  complete_with_dummy_measurements(), compute_ss_square_distance() and
  get_all_measurements_sorted(). Use of sorted values (map instead of
  unordered_map) is useless, should be fixed soon.
- Delete old commented code: getPowerForAp(), addMeasurement() and old
  getSsSquareDistance().

Stock: Add function closest_reference_point().
2011-03-16 14:36:23 +01:00
Matteo Cypriani 2c62e30ff9 [Positioning] Define hash_value() for several classes
For object types that we needed to store into an unordered_set, we used
string-based hashes, defined into stock.cc. We now define new hash
functions as friend of target classes, based on boost::hash_combine.

The following classes now have a hash_value() function:
- Request
- CalibrationRequest
- Direction
- Timestamp
- Point3D
- ReferencePoint
2011-03-16 14:36:23 +01:00
Matteo Cypriani 14902181af [Positioning] TopologyReaderCSV: read waypoints
Stock: add Waypoint list and support functions.

Waypoint:
- Use an unordered_set instead of a vector for the Building list.
- Add functions add_building(), add_buildings() and remove_building().
- Add operator string().

cfg/waypoints.csv: change format (add building name).
2011-03-16 14:36:23 +01:00
Matteo Cypriani a30b08ac3c [Positioning] Stock: add Building list & complete tests 2011-03-16 14:36:23 +01:00
Matteo Cypriani c82b95f8f0 [Positioning] Stock::find_create_{ap,mobile}()
Add function find_create_ap() and find_create_mobile() in Stock.
Use these functions in InputCSV instead of Stock::get_mobile() and try…
catch blocks.
2011-03-16 14:36:22 +01:00
Matteo Cypriani c559b827ee [Positioning] Directory reorganization
Move "new" source files in src/.
Update Doxyfile and Makefile.

Delete old useless files:
- libowlps-positioning.*
- positioning.*
- server.*
- treatment.*
2011-03-16 14:36:21 +01:00