Commit Graph

90 Commits

Author SHA1 Message Date
Matteo Cypriani 2c1697b78a Enable compilation on GNU/kFreeBSD 2012-02-06 13:27:05 +01:00
Matteo Cypriani 08a8626354 Makefiles: improve static compilation
Add a static target for Listener, Aggregator and Positioning.
Strip the static and semistatic targets.
2012-01-11 16:50:39 +01:00
Matteo Cypriani 3d05f203aa [Positioning] Rename RADAR -> NSS
The algorithm RADAR is renamed "NSS", which is more neutral.
2012-01-09 11:11:30 +01:00
Matteo Cypriani 61124e4cfc Makefiles: test CC prior to surcharge it
Verifies that CC is at its default value prior to try to surcharge it
with colorgcc.
2012-01-09 11:11:30 +01:00
Matteo Cypriani 700782f9a6 [Positioning] Makefile: disable the 'test' target
Unit tests are unmaintained. It's nicer to tell it to the user.
2012-01-09 11:11:30 +01:00
Matteo Cypriani 39300aaa85 Makefiles: translate help
Translate help messages from French.
2012-01-09 11:11:30 +01:00
Matteo Cypriani 220289e83f [Positioning] Makefile: display minimal GCC version
The help target displays the minimal GCC version required to compile the
program.
2011-08-30 17:06:32 +02:00
Matteo Cypriani 8327357290 Makefiles: allow to enable -g easily
Add a commented line DEBUG=-g in each Makefile.
2011-08-22 22:43:35 +02:00
Matteo Cypriani 2c887899b3 [Positioning] Fix FBCM with autocalibration
Regenerate Friis indexes at each call of the algorithm when
autocalibration is used (without this fix, FBCM given always the same
result autocalibration activated, because of the Friis indexes equal to
zero).
2011-08-01 20:41:14 +02:00
Matteo Cypriani d9adbc3f88 [Positioning] Fix InputMedium::fill_calibration_request_data()
The first test was logically wrong.
2011-08-01 18:24:39 +02:00
Matteo Cypriani 90f26261a2 [Positioning] InputMedium::fill_calibration_request_data()
Refactor some code of Input{CSV,UDPSocket}::fill_current_request() into
the new function InputMedium::fill_calibration_request_data().
2011-08-01 18:24:39 +02:00
Matteo Cypriani cd25c4ddcd [Positioning] Add class OutputNetworkSocket
Factorise code of OutputUDPSocket and OutputTCPSocketEvAAL.
2011-07-30 20:46:32 +02:00
Matteo Cypriani 8295666178 [Positioning] Add Result::in_which_area() 2011-07-29 23:02:26 +02:00
Matteo Cypriani d5fcfed1f2 [Positioning] Add OutputTCPSocketEvAAL 2011-07-29 23:02:26 +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 f418fc15f1 [Positioning] Add Point3D::angle() 2011-07-25 14:18:16 +02:00
Matteo Cypriani 8377b00905 [Positioning] Makefile: add -O2 2011-07-23 17:27:51 +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 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 e067efb42a [Positioning] Doxyfile: use $OWLPS_VERSION 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 3196e5a2e0 Makefiles: resolve OWLPS_VERSION earlier 2011-04-26 10:15:04 +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 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 40fb159a91 Merge branch 'dev-outputsocket' into dev
Adds OutputUDPSocket.
OutputUDPSocket::write(ResultList) is a mock function, since important
changes have to be done before that.

Conflicts:
	owlps-positioning/src/userinterface.cc
2011-04-05 12:05: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 22cad4c214 [Positioning] OutputSocket -> OutputUDPSocket 2011-04-05 11:27:44 +02:00
Florian Taillard 6fbb0874e7 [Positioning] Add OutputSocket 2011-03-25 12:19:52 +01:00
Matteo Cypriani 161157dae7 [Positioning] Add InputUDPSocket
The positioning server can now read the requests sent by the aggregator
via UDP. This data exchange does not concern (auto)calibration requests
yet.
2011-03-25 11:48:25 +01:00
Matteo Cypriani c4f413b862 [Positioning] Fix compilation (-lstdc++) 2011-03-16 16:45:38 +01:00
Matteo Cypriani 0676462082 Makefiles: use colorgcc (only) if it exists
owlps-positioning/Makefile used to use colorgcc as the default compiler,
without testing its existence. This is fixed.
The makefiles for libowlps and infrastructure-centred modules now use
colorgcc when available.
2011-03-16 16:44:32 +01:00
Matteo Cypriani 3027df22a7 [Positioning] Makefile: add help 2011-03-16 16:44:32 +01: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 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 630df51702 [Positioning] Del MultilaterationAlgorithm::mobile
Makefile: Use colorgcc.
Update TODO.
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 8e6883cfc9 [Positioning] Add class CSVFileReader
CSVFileReader is a specialisation of TextFileReader, that allow reading
a CSV line field by field.

TextFileReader:
- Make private attributes protected to allow derivation.
- Add attribute current_line_nb.
- Add function read_nonblank_line().
- Delete useless accessor get_name().

Update InputCSV to use CSVFileReader.

Adapt unit tests for InputCSV and InputLogCSV: EOF is not reached right
after reading the last line, but after trying (and failing) to read one
more line.
2011-03-16 14:36:22 +01:00
Matteo Cypriani b707dae1f1 [Positioning] Fix dependencies in Makefile 2011-03-16 14:36:22 +01:00
Matteo Cypriani 58ed434d6b [Positioning] Add class TextFileReader
TextFileReader read lines from a text file. It is aimed to be used by
all classes that read from a text file, as TextFileWriter is used by
those which write to a text file.

Code of TextFileReader is taken from class InputCSV.

Minor fixes on the TextFileWriter unit test.
2011-03-16 14:36:22 +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 64715f7a79 [Positioning] OutputFileMedium -> TextFileWriter
TextFileWriter:
- OutputFileMedium becomes TextFileWriter.
- Method write_string_to_file() becomes write_text() and is made public.
- Add a unit test.

InputLogCSV and OutputCSV do not extend OutputFileMedium anymore, but
use a TextFileWriter as an attribute.
2011-03-16 14:36:22 +01:00
Matteo Cypriani 56c45b3334 [Positioning] Add class OutputCSV
OutputCSV writes Result to a CSV file. It extends OutputFileMedium.

Update:
- Output.
- UserInterface (add option "output.csv-file").
- posexcept (add class no_output_csv_file).
2011-03-16 14:36:22 +01:00