Commit Graph

15 Commits

Author SHA1 Message Date
Matteo Cypriani 6b7e5668fa Add/update headers on the top of each source file 2012-02-06 16:44:09 +01:00
Matteo Cypriani 141515b5db [Positioning] operator=() return non-const reference
Change the return type of all operator=() from const reference to
non-const reference.
2011-07-30 20:46:32 +02:00
Matteo Cypriani 602f9c5399 [Positioning] ReferencePoint: variable renaming 2011-07-29 23:02:25 +02:00
Matteo Cypriani 232551c150 [Positioning] ReferencePoint::delete_generated_requests() 2011-07-29 23:02:25 +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 f84276d8d7 [Positioning] ReferencePoint::average_measurements()
Add double ReferencePoint::average_measurements(string mac_transmitter),
that allows to get the average of all the Measurements sent by a given
transmitter.

Add, as protected functions, get_all_measurements(string
mac_transmitter) and get_requests(string mac_transmitter), that do the
same as get_all_measurements(void) and get_requests(void), but filtering
on the transmitter of the packets.
2011-07-25 14:18:16 +02:00
Matteo Cypriani 2ebb8c49bc [Positioning] *.hh: fix typos in comments 2011-06-20 12:11:20 +02:00
Matteo Cypriani cce949f32a [Positioning] Fix some Doxygen comments 2011-06-14 16:44:17 +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 c525372ed3 [Positioning] Some ReferencePoint code -> PosUtil
ReferencePoint::complete_with_dummy_measurements(
  map<string, Measurement>,
  map<string, Measurement>)
becomes PosUtil::complete_with_dummy_measurements(
  unordered_map<string, Measurement>,
  unordered_map<string, Measurement>)

ReferencePoint::compute_ss_square_distance(
  map<string, Measurement>,
  map<string, Measurement>)
becomes PosUtil::ss_square_distance(
  unordered_map<string, Measurement>,
  unordered_map<string, Measurement>)

map<string, Measurement> ReferencePoint::get_all_measurements_sorted()
is now private, returns an unordered_map instead of a map, and is
renamed ReferencePoint::get_all_measurements().

Note that we now use unordered_maps for these functions. The use of
sorted lists (maps) was useless, as stated in the commit message of
e9eab687 (Wed Jun 2 12:37:43 2010 +0200).
2011-05-13 10:51:52 +02: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 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 ee0499afad [Positioning] Code and comments clean-up
- Where possible, use initialisation lists in class definition instead
  of explicit variable initialisations in source file.
- Rename some variables (use of "source" in copy constructors and
  operators…).
- Suppress useless Doxygen comments, allow non-documented members in
  Doxyfile.
2011-03-16 14:36:21 +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