Commit Graph

301 Commits

Author SHA1 Message Date
Matteo Cypriani 602f9c5399 [Positioning] ReferencePoint: variable renaming 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 2b12e49374 [Positioning] Fix ReferencePoint::delete_generated_requests()
Use a while loop instead of for to check the requests.
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 6c48bc7e29 [Positioning] Add Stock::get_aps() 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 1abe54b7be [Positioning] Add PosUtil::int_to_mac() 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 9c76d87b0c [Positioning] Add option accept-new-mobiles
The option positioning.accept-new-mobiles allows the program to add
on-line mobiles that are not declared in the mobiles' configuration
file. This was the default till now; now this option is unactivated by
default to avoid unexpected Wi-Fi devices retransmitting positioning
requests.
2011-07-25 14:18:17 +02:00
Matteo Cypriani 6b662a597a [Positioning] Add Stock::mobile_exists() 2011-07-25 14:18:17 +02:00
Matteo Cypriani 0b43e7f5fc [Positioning] Read mobiles characteristics
Add MobilesReaderCSV, that reads the known mobiles from a CSV file.
2011-07-25 14:18:17 +02:00
Matteo Cypriani 8878bb2390 [Positioning] Add Stock::nb_mobiles() 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 d9bfd9e2c2 [Positioning] AccessPointsReaderCSV: s/ap/device/ 2011-07-25 14:18:17 +02:00
Matteo Cypriani f5a4f4fedc [Positioning] Point3D: fix angle()
Use doubles instead of floats.
Handle the cases where points are equal.
2011-07-25 14:18:16 +02:00
Matteo Cypriani 33b027d472 [Positioning] Tweak ReferencePoint::friis_indexes_for_ap() 2011-07-25 14:18:16 +02:00
Matteo Cypriani f418fc15f1 [Positioning] Add Point3D::angle() 2011-07-25 14:18:16 +02:00
Matteo Cypriani 855291b31d [Positioning] Add PosUtil::rad2deg() 2011-07-25 14:18:16 +02:00
Matteo Cypriani 948bd577a2 [Positioning] Output*: do not output empty RequestList 2011-07-25 14:18:16 +02:00
Matteo Cypriani 773fd559cd [Positioning] Add ResultList::empty() 2011-07-25 14:18:16 +02:00
Matteo Cypriani d43267fcd3 [Positioning] Positioning: catch compute exceptions
Catch the exception potentially thrown by
PositioningAlgorithm::compute().
2011-07-25 14:18:16 +02:00
Matteo Cypriani 0df91eaa94 [Positioning] Input*: skip requests without measurements 2011-07-25 14:18:16 +02:00
Matteo Cypriani 1f46075aa3 [Positioning] Add option accept-new-aps
The option positioning.accept-new-aps allows the program to add on-line
APs that are not declared in the APs' configuration file.
2011-07-25 14:18:16 +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 37997242c5 [Positioning] Uppercase all MAC addresses on input 2011-07-25 14:18:16 +02:00
Matteo Cypriani e9e8308a9c [Positioning] PosUtil: add string functions
Add PosUtil::to_upper(string) and PosUtil::assert_uppercase(string).
2011-07-25 14:18:16 +02:00
Matteo Cypriani 05859da49b [Positioning] Reorder 2 headers in stock.hh 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 b8bd2acf44 [Positioning] Add option accept-new-calibration-requests
The option positioning.accept-new-calibration-requests allows the
calibration requests sent during the positioning phase to be added to
the Stock. They are added to the calibration requests read by
InputDataReader during the start-up phase.
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 de9513e4b4 [Positioning] Add option update-ap-coordinates-online
In InputUDPSocket, update the AP's coordinates when receiving a
calibration or autocalibration request that contains the coordinates.
This is done if the option positioning.update-ap-coordinates-online is
activated.
2011-07-25 14:18:16 +02:00
Matteo Cypriani 0dd57b8ea7 [Positioning] InputUDPSocket: use AP's coordinates
Use the transmitting AP's coordinates when receiving an autocalibration
request that does not contain the coordinates.
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 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 88aaded78c [Positioning] Add Stock::get_reference_point() 2011-07-25 14:18:16 +02:00
Matteo Cypriani 032f4b8fa0 [Positioning] Doxyfile: change project's name
Change from "OWLPS Positioning" to "OwlPS Positioning".
2011-07-25 12:46:19 +02:00
Matteo Cypriani 8377b00905 [Positioning] Makefile: add -O2 2011-07-23 17:27:51 +02:00
Matteo Cypriani fc13bc296c [Positioning] Fix ReferencePoint::operator<<() 2011-07-22 11:36:05 +02:00
Matteo Cypriani cf7bcecd10 [Positioning] Input: delete unused header
The function add_request_to_stock() was declared in input.hh, but not
defined anywhere.
2011-07-22 11:11:26 +02:00
Matteo Cypriani 25c3f53983 [Point3D] Fix Doxygen warning with operator string 2011-07-18 13:38:29 +02:00
Matteo Cypriani c63da8bdfc [Positioning] InputDataReader: print nb requests
In verbose mode, display the number of calibration requests stored.
2011-06-29 10:56:08 +02:00
Matteo Cypriani 65487af736 [lib] Makefile: remove unneeded -lrt & -lm
-lrt is now added as needed in each module Makefile, but not directly in
the library. Furthermore, the Makefiles add -lrt only if the platform is
Linux.
2011-06-27 10:09:14 +02:00
Matteo Cypriani 7dade1c36b Makefiles: get rid of echo -e
Use one call to echo for each line, because the echo's -e option is not
standard.
2011-06-27 10:09:14 +02:00
Matteo Cypriani f54b0d11e1 Makefiles: remove -v incompatible with BSD commands
The -v 'verbose' switch of the standard commands (rm, cp, mkdir, etc.)
is not implemented in BSD versions of the commands, so we avoid using
it.
2011-06-27 10:09:14 +02:00
Matteo Cypriani 84ea723528 [Positioning] Direction: 0 is valid to construct
Accept 0 as a "valid" value for the constructor and operator=()
(constructing a Direction with 0 value was possible any way, using the
default constructor).
This fixes the reception of requests on UDP.
2011-06-24 16:48:55 +02:00
Matteo Cypriani 2ebb8c49bc [Positioning] *.hh: fix typos in comments 2011-06-20 12:11:20 +02:00
Matteo Cypriani 3b8121643b [Positioning] InputCSV: --verbose instead of #ifdef
Test if the verbose mode is activated instead of using #ifdef DEBUG.
2011-06-16 14:21:12 +02:00
Matteo Cypriani 67ccf674a5 [Positioning] InputDataReader: print --verbose info
Display the number of elements read when the verbose mode is activated.
2011-06-16 14:10:43 +02:00
Matteo Cypriani abd4b0803e [Positioning] UserInterface: add --verbose option
Currently, --verbose / -v is only a switch. It would probably be better
to have a verbose level instead.
2011-06-16 13:46:21 +02:00
Matteo Cypriani 332881b305 [Positioning] Standardise InputCSV & InputUDPSocket 2011-06-16 13:13:13 +02:00
Matteo Cypriani cce949f32a [Positioning] Fix some Doxygen comments 2011-06-14 16:44:17 +02:00
Matteo Cypriani 48fa965c54 [Positioning] UserInterface: reformat strings 2011-06-08 19:05:48 +02:00
Matteo Cypriani 3ac6b440e4 Update TODOs 2011-06-08 10:56:14 +02:00
Matteo Cypriani 507072bd24 [Positioning] Option radar-average-reference-points
For RADAR, the default is now to compare the current positioning request
to each stored CalibrationRequest instead of each ReferencePoint
(averaging the calibration requests associated with the reference
point).

The new option --positioning.radar-average-reference-points allows to
activate the old behaviour (compare to reference points).

Note: the bug fixed in the previous commit caused the creation of
a ReferencePoint for each CalibrationRequest, implying the 'new'
default behaviour (one ReferencePoint was associated to only one
CalibrationRequest, so comparing each ReferencePoint or each
CalibrationRequest was giving the same result). Anyway, there was
(hopefully) no such bug in OwlPS v0.8, so it is actually the old
behaviour :-)
2011-06-08 10:25:38 +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 920e4491ef [Positioning] Stock: s/look for/search for/ 2011-05-13 10:51:52 +02:00
Matteo Cypriani 3aae38c409 [Positioning] Add Request::ss_square_distance() 2011-05-13 10:51:52 +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 d71bbcf2b8 [Positioning] PosUtil: use channels from owlps.h
Use channel frequencies declared in owlps.h.
Handle frequencies in MHz as well as channel numbers and frequencies in
Hz.
2011-05-13 10:51:52 +02:00
Matteo Cypriani d285d2b4b7 [Positioning] UserInterface: catch by reference 2011-05-13 10:51:52 +02:00
Matteo Cypriani fac5af8655 [Positioning] Fix Measurement::operator bool()
Use !ss.list.empty() instead of ss_list.size() > 0.
2011-05-13 10:51:52 +02:00
Matteo Cypriani 799af46e57 [Positioning] Result: fix operator=() & ==() 2011-05-13 10:51:52 +02:00
Matteo Cypriani 506917b5ec [Positioning] Compute the error if Real is used
If the pseudo-algorithm Real is used, the distance error is computed for
the others algorithms.
2011-05-05 13:22:33 +02:00
Matteo Cypriani 0eef6e8577 [Positioning] RealPosition: handle non-calib. requests
RealPosition is now able to return a relevant result when called with
non-calibration requests.
2011-05-05 13:22:33 +02:00
Matteo Cypriani 17e12a9735 [Positioning] Input*: initialise real_position
When provided for non-calibration requests, the real position is
initialised.
2011-05-05 13:22:33 +02:00
Matteo Cypriani 00bbc9c49d [Positioning] Add Request::real_position 2011-05-05 13:22:33 +02:00
Matteo Cypriani 1bb589b460 [Positioning] Add Point3D::operator bool() 2011-05-05 13:22:33 +02:00
Matteo Cypriani 6c3647410d [Positioning] Result: compute error if possible
If the real coordinates are passed to the constructor, the distance
error is computed. One can also use Result::compute_error() on a
constructed object.
2011-05-05 13:22:33 +02:00
Matteo Cypriani 2d2b49947a [Positioning] Add PositioningAlgorithm::get_name() 2011-05-05 13:22:32 +02:00
Matteo Cypriani bd992f28ed [Positioning] "Null" is a false friend 2011-05-05 13:22:32 +02:00
Matteo Cypriani e067efb42a [Positioning] Doxyfile: use $OWLPS_VERSION 2011-05-05 13:22:32 +02:00
Matteo Cypriani b1d706bf9c Update TODOs 2011-05-05 13:22:32 +02:00
Matteo Cypriani eb61dfc0e0 [Positioning] Add minmax-start & minmax-stop opts.
The start and stop coordinates for the MinMax multilateration method
used to be hard-coded. One should now provide the good coordinates using
the new options positioning.minmax-start and positioning.minmax-stop.
2011-04-27 19:01:43 +02:00
Matteo Cypriani ccb57c86ec [Positioning] Add Point3D::Point3D(string) 2011-04-27 18:51:25 +02:00
Matteo Cypriani ceb035ed19 [Positioning] Change default configuration file
UserInterface: default configuration file is now in
/usr/local/etc/owlps instead of ./cfg.
2011-04-27 17:48:33 +02:00
Matteo Cypriani 38c3402a15 [Positioning] Update/clean configuration files 2011-04-27 17:41:01 +02:00
Matteo Cypriani 1cebc82bfd [Positioning] Minor edits
InputDataReader: minor refactoring.
Request: fix a comment.
2011-04-26 17:18:53 +02:00
Matteo Cypriani ea8da6d8ec [Positioning] Fix InputMedium::…_to_calibration_request()
Fix InputMedium::current_request_to_calibration_request(), that was
resulting in a blank request.
2011-04-26 17:18:53 +02:00
Matteo Cypriani c9d26033e9 [Positioning] InputCSV: add debug info 2011-04-26 17:18:53 +02:00
Matteo Cypriani 77c66bf194 [Positioning] CalibrationRequest: default args in .cc
Move default argument declaration from .hh to .cc.
2011-04-26 16:47:02 +02:00
Matteo Cypriani a54b8ab06b [Positioning] Timestamp: update operator bool()
Test tv_sec and tv_usec independently instead of using operator
uint64_t().
2011-04-26 14:14:01 +02:00
Matteo Cypriani 810a29cec3 [Positioning] Translate READMEs 2011-04-26 10:28:51 +02:00
Matteo Cypriani 3196e5a2e0 Makefiles: resolve OWLPS_VERSION earlier 2011-04-26 10:15:04 +02:00
Florian Taillard 08a407e0f3 [Positioning] Fix reading csv calibration file
Add uint16_t into inputcsv to fix read type packet.
The uint8_t is detected as a char.
2011-04-18 16:31:10 +02:00
Florian Taillard 8d2a2b3e5a [Positioning] Fix accesspoint reading frequency
Change long to unsigned long in accesspointsreadercsv.cc.
The frequency value exceed a long lenght in arch 32bits.
2011-04-18 13:52:43 +02:00
Matteo Cypriani 6fa1ae15d0 [Positioning] Print version info with -V 2011-04-13 00:12:30 +02:00
Matteo Cypriani 273c2adfc7 [Positioning] Fix Makefile: remove prepare target 2011-04-12 12:17:31 +02:00
Matteo Cypriani d31ac3864e Position endianess conversion in all modules 2011-04-07 16:15:46 +02:00
Matteo Cypriani e8332fd0f6 Update TODOs 2011-04-07 11:57:14 +02:00
Matteo Cypriani 55886734d5 [Positioning] Makefile: call prepare before *.o
When compiling in parallel (make -j), the directory 'obj' was sometimes
created too late (i.e. after the end of the first compilation, so the .o
could not be written on the disk). This is now fixed.
2011-04-07 09:17:46 +02:00
Matteo Cypriani 43ca7a3426 [Positioning] Makefile: run cppcheck with --quiet 2011-04-07 09:17:46 +02:00
Matteo Cypriani 80c914647f [Positioning] CSVFileReader::print_error_cast() const 2011-04-07 09:17:46 +02:00
Matteo Cypriani 878ee7e495 [Positioning] Fix/add some Doxygen comments 2011-04-07 09:17:46 +02:00
Matteo Cypriani 2467c3261e [Positioning] TextFileReader: '-' for stdin
The user can now use '-' as file name to read inputs from stdin.
2011-04-07 09:17:23 +02:00
Matteo Cypriani d25aa4276b [Positioning] TextFileWriter: '-' for stdout
The user can now use '-' as file name to write results or logs to
stdout.
2011-04-07 09:16:25 +02:00
Matteo Cypriani dc9e5a72f4 [Positioning] UserInterface: fix output.udp-host 2011-04-05 16:00:52 +02:00
Matteo Cypriani 3719f58b65 [Positioning] OutputUDPSocket: finish cleaning
Use libowlps for socket creation.
Use Result::to_csv() and ResultList::to_csv().
2011-04-05 16:00:52 +02:00
Matteo Cypriani 2324c8e5d1 [Positioning] Move OutputCSV::*to_csv()
OutputCSV::result_to_csv() becomes Result::to_csv().
OutputCSV::results_to_csv() becomes ResultList::to_csv().
2011-04-05 15:42:57 +02:00