Commit Graph

54 Commits

Author SHA1 Message Date
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 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 a898af4389 [Positioning] Write all results simultaneously
Write results computed by several algorithms for the same request
simultaneously for a given medium. This allows to have only one CSV line
for a given request.
To achieve that, the class ResultList was created.
2011-04-05 11:52:10 +02:00
Matteo Cypriani 4752198ce7 [Positioning] Include algorithm name in results 2011-03-31 19:42:35 +02:00
Matteo Cypriani 5945617994 Update TODOs 2011-03-31 16:03:22 +02:00
Matteo Cypriani 5669540d8b [Positioning] Warn about the non-maintained tests 2011-03-18 15:24:37 +01:00
Matteo Cypriani 6f0c0af5be [Positioning] PosUtil::wifi_channel_to_hz(): throw exception
posexcept: Add exception bad_channel.

PosUtil::wifi_channel_to_hz() now throw bad_channel if the argument is
not a valid channel nor a 802.11 frequency value in Hz.
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 630df51702 [Positioning] Del MultilaterationAlgorithm::mobile
Makefile: Use colorgcc.
Update TODO.
2011-03-16 14:36:23 +01:00
Matteo Cypriani 814ff2b651 [Positioning] Positioning & UserInterface: add Interlink 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 208c989c53 [Positioning] Add InputDataReader & TopologyReaderCSV
InputDataReader handles all data input, i.e. data needed to prepare
computation (topology, calibration measurements, etc.).

TopologyReaderCSV reads topology from a CSV file (just Building and Area
for the moment).

cfg/topo.csv: change format (add building name and reorder coordinates).

UserInterface: add data input options.

posexcept: add data input exceptions.
2011-03-16 14:36:23 +01:00
Matteo Cypriani 1a51d234c6 [Positioning] Add InterlinkNetworks, MinMax & associates
Add classes:
- MultilaterationMethod
- MinMax (extends MultilaterationMethod)
- MultilaterationAlgorithm (extends PositioningAlgorithm)
- InterlinkNetworks (extends MultilaterationAlgorithm)
2011-03-16 14:36:22 +01:00
Matteo Cypriani 8bb0036512 [Positioning] Request: timestamp -> time_sent 2011-03-16 14:36:21 +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 175719db6d [Positioning] PosUtil: channel defs -> posutil.cc
Move channels defines into posutil.cc.
Remove some useless includes in PosUtil and InputCSV.
2011-03-16 14:36:21 +01:00
Matteo Cypriani 80fe1c505d [Positioning] ASSERT(a != b) instead of ASSERT_DIFFERS(a, b)
In cxxtest, TS_ASSERT_DIFFERS(a, b) tests !(a == b) and not (a != b).
Therefore, to test a::operator!=(b), we must avoid TS_ASSERT_DIFFERS()
(that will test !a::operator==(b)) and write instead TS_ASSERT(a != b).
2011-03-16 14:36:21 +01:00
Matteo Cypriani 92e58686f8 [Positioning] Add class Positioning
The new class Positioning is the interface between Input and Output,
using positioning algorithms to compute results from requests.
Update UserInterface to add option "positioning.algorithm"; update posexcept.
2011-03-16 14:36:21 +01:00
Matteo Cypriani 9ed1000bb3 [Positioning] Add class Output
Add class Output to handle outputs.
Update UserInterface to add option "output.medium"; update posexcept.
2011-03-16 14:36:21 +01:00
Matteo Cypriani 96808115bd [Positioning] Add class Result 2011-03-16 14:36:21 +01:00
Matteo Cypriani 0430b1a5da [Positioning] Redesign Timestamp
Use almost only operators for the public interface.
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
Matteo Cypriani e70a255083 [Positioning] InputCSV: handle calib. requests (end)
InputCSV now handles CalibrationRequest, adding position and direction
information.

Input:
- Add add_request_to_stock().

Stock:
- Add list of ReferencePoint.
- Add list of CalibrationRequest.
2011-03-16 14:36:20 +01:00
Matteo Cypriani 516a1d9196 [Positioning] Update TODO 2011-03-16 14:36:20 +01:00
Matteo Cypriani 0b461bf4d0 [Positioning] InputCSV: read direction as int
Prepare handling of calibration requests.
2011-03-16 14:36:20 +01:00
Matteo Cypriani fc1ceb25c7 [Positioning] Add Input & posexcept.{hh,cc}
- Add files posexcept.{hh,cc} that contains exception classes.
- Add class Input, that handles InputMedium (and InputLogMedium, in the
  future). Note that for the moment, the unit test is *very* minimal.
- UserInterface: Add options for the input medium and the CSV file.
2011-03-16 14:36:19 +01:00
Matteo Cypriani 0ddef4c747 [Positioning] Add TestUtil, utilitary test class
Add the class TestUtil, that provides functions used in several unit
tests. For the moment, it contains two function:
- fill_file(), that creates and fills a test file.
- remove_file(), that deletes a test file.
2011-03-16 14:36:19 +01:00
Matteo Cypriani 9cf4daca3b [Positioning] Add Configuration and UserInterface
- Add class Configuration, a stock for the configuration structure.
- Add class UserInterface, that handles the configuration input.
- Update owlps-positioning.cc (delete old stuff like configuration) and
  delete owlps-positioning.hh: we now have a compilable executable.
2011-03-16 14:36:19 +01:00
Matteo Cypriani 12d14b805f [Positioning] Measurement: test avg. computation
This commit pass finally all unit tests without any warning!

Measurement:
- Finish unit test (test the average SS).
- Fix update_average_ss() and add_ss().
- average_ss is now double.
2011-03-16 14:36:19 +01:00
Matteo Cypriani b921263795 [Positioning] Add class Timestamp
Add a class Timestamp that boxes the structure timespec from <ctime>.
timespec manipulation functions are removed from PosUtil.
2011-03-16 14:36:19 +01:00
Matteo Cypriani 1ddebc9cf4 [Positioning] Area: Suppress debug cout
Suppress the last preprocessor-controlled debug display in Area.
2011-03-16 14:36:19 +01:00
Matteo Cypriani c5eff5f857 [Positioning] const_iterators instead of iterators 2011-03-16 14:36:19 +01:00
Matteo Cypriani 910d9a04d9 [Positioning] InputCSV: handle auto EOF & closing
InputCSV:
- Add eof_close() to automatically close the file when EOF is reached.
- Add read_next_line(), that read the next non-blank line and skips
  blank characters.
- Add current_line, a string containing the current line data.
- Update unit test.

InputMedium:
- Rename InputMedium::current_line to current_line_nb.
2011-03-16 14:36:19 +01:00
Matteo Cypriani ec10ed71a1 [Positioning] Add test for InputCSV
- Add unit test for InputCSV.
- Request: Add get_measurements().
- Stock:
  - Add clear().
  - Update tests to use it.
2011-03-16 14:36:19 +01:00
Matteo Cypriani efac35a515 [Positioning] Get rid of STLport, complete Request
- Now use Boost.TR1 instead of STLport, for unordered_map.
- Add operator=(), operator==(), operator!=() and a copy constructor to
  Request.
2011-03-16 14:36:10 +01:00
Matteo Cypriani 7c6492645d [Positioning] Fix some errors
Fix some errors revealed during writing of unit tests.

Building: Fix wrong #ifndef in building.hh.

Measurement: New default constructor.

PosUtil:
- Remove nanosecond-precision functions.
- Add timespec_round_to_ms() to lower the precision of a struct timespec
  to millisecond.
- Add timespec_equals to compare two struct timespec (maybe an
  operator==() would be better?).
2011-03-16 14:36:10 +01:00
Matteo Cypriani f4c825c2d9 [Positioning] const_cast & other minor enhancements
- In all classes where we used a C-style cast to suppress const, we now
  use a const_cast.
- Area: Add operator=().
- InputCSV:
	- Document get_next_request().
	- Handle exception when using Stock::get_{ap,mobile}().
	- In constructor, throw an exception in case of error when opening the
	  input file.
- CalibrationMeasurement: Remove operator<<() which is useless (it is a
  simple call to Measurement operator<<()).
- Makefile: Add target 'check'.
2011-03-16 14:36:10 +01:00
Matteo Cypriani 1f1d7de4f5 [Positioning] Doxygen comments + fixes
- Add/update comments to be Doxygen compliant. Translate existing
  comments in English.
- Various fixes (more or less importants):
	- NULL pointer verification when adding an element to a vector of
	  pointers.
	- Add some missing accessors.
	- Add some more error handling with exceptions. Class Stock: correct
	  accessors (pure read accessors do not create a missing element any
		more, but throw an exception).
- Makefile: Add 'doc' target.
- Update TODO (some things noticed when reviewing the code for
  comments).
2011-03-16 14:36:10 +01:00
Matteo Cypriani ab3302ff28 [Positioning] Beautify code
In all classes:
- Read accessors return a const reference instead of a value.
- operator=() returns a const reference.
- Use '\n' instead of std::endl in all stream manipulations, when
  buffer flush is not required.
- Use pre-incrementing where possible, instead of post-incrementing.

- Point3D: Destructor must be virtual (thanks cppcheck!).
- Update TODO.
2011-03-16 14:36:10 +01:00
Matteo Cypriani cc31b5dcc6 [Positioning] Add class Stock, finish InputCSV
Add AP and mobile management in InputCSV. Lists of known APs and mobiles
are static attributes of the class Stock.
2011-03-16 14:36:10 +01:00
Matteo Cypriani 5f8f955a3d [Positioning] Add Request, complete InputCSV
== code/owlps-positioning ==

- Add new class Request (split of Measurement).
- Update Measurement and CalibrationMeasurement (suppress the 'mobile'
  attribute).
- Update InputCSV (and InputMedium) to use Request instead of
  Measurement. Complete the file reading (mobile & ap pointers remain to
  be implemented).
- PosUtil: Add timespec_to_ms(), timespec_to_ns(), ms_to_timespec(), and
  ns_to_timespec().
- Makefile: Update to use stlport, fix all deps and add new classes.
- Minor fixes.
- TODO: Add UML-related things, updates Measurement & Request.

== code ==

- libowlps: Add ms_to_timeval() (commented), may be useful later.
- Add TODO.
2011-03-16 14:35:56 +01:00
Matteo Cypriani 8f071d13b0 [Positioning] Add classes InputMedium & InputCSV
- Add classes InputMedium and InputCSV. They handle Measurements.
- Measurement: add set_ss_list() and clear().
- Add new files in Makefile.
- TODO: thinking about Measurement vs. a new class Request.
2011-03-16 14:35:45 +01:00
Matteo Cypriani 1cf560309a [Positioning] Several fixes
- Makefile: fix waypoint.o.
- UTF-8 calibrationmeasurement.{hh,cc}, measurement.cc.
- CalibrationMeasurement: fix destructor.
- Measurement: fix const functions, add operator bool().
- Update TODO.
2011-03-16 14:07:24 +01:00
Matteo Cypriani d156e91379 [Positioning] Inline short functions
Short functions (accessors and simple operators) are declared inline and
moved in header files, after the class definition.
2011-03-16 14:07:24 +01:00
Matteo Cypriani 96023d8285 [Positioning] Suppress "using" directives in *.hh
(and add .gitignore)
2011-03-16 14:07:24 +01:00
Matteo Cypriani 40617901f6 [Positioning] Class declarations, vector.at(), iterators
- Add section « C++ en action » in TODO.
- Where possible, class declarations instead of #include.
- Use of iterators and at() instead of operator[] for vectors.
- Const arguments for operator<< where forgotten.
2011-03-16 14:07:24 +01:00