Project

mlr

0.0
No commit activity in last 3 years
No release in over 3 years
ruby wrapper for https://github.com/kamalshadi/Localization
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.17
~> 5.0
~> 0.10
~> 10.0

Runtime

~> 1.0
 Project Readme

Mlr

multilateration solution based on https://github.com/kamalshadi/Localization python library

multelateration

Installation

Add this line to your application's Gemfile:

gem 'mlr'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mlr

Also you need python libraries

$ pip install localization
$ pip install numpy
$ pip install scipy
$ pip install shapely

Usage

from_points

detect point from Mlr::AnchorPoint struct

# Mlr::AnchorPoint2D.new(X, Y, D)
# Mlr::AnchorPoint3D.new(X, Y, Z, D)

Mlr.from_points([
  Mlr::AnchorPoint2D.new(0, 100, 50),
  Mlr::AnchorPoint2D.new(100, 100, 50),
  Mlr::AnchorPoint2D.new(100, 0, 50)
])
=> #<struct Mlr::ResultPoint2D x=59.103629855759586, y=59.10363763568137>

from_array

detect point from Array of Arrays

# 3xN (2d result)

Mlr.from_array([
  [0, 100, 50],
  [100, 100, 50],
  [100, 0, 50]
])

=> #<struct Mlr::ResultPoint2D x=59.103629855759586, y=59.10363763568137>


# or 4xN (3d result)
Mlr.from_array([
  [0, 100, 0, 50],
  [100, 100, 100, 50],
  [100, 0, 200, 50]
])

=> #<struct Mlr::ResultPoint3D x=56.699519667205976, y=56.69946167965226, z=99.99998609719331>