Coder Social home page Coder Social logo

milosgajdos / go-estimate Goto Github PK

View Code? Open in Web Editor NEW
110.0 6.0 8.0 883 KB

State estimation and filtering algorithms in Go

License: Apache License 2.0

Go 99.62% Makefile 0.38%
golang filtering estimator particle-filter extended-kalman-filter unscented-kalman-filter kalman-filter particle-filters sensor-fusion

go-estimate's Introduction

go-estimate: State estimation and filtering algorithms in Go

Build Status go.dev reference GoDoc License Go Report Card codecov

This package offers a small suite of basic filtering algorithms written in Go. It currently provides the implementations of the following filters and estimators:

In addition it provides an implementation of Rauch–Tung–Striebel smoothing for Kalman filter, which is an optimal Gaussian smoothing algorithm. There are variants for both LKF (Linear Kalman Filter) and EKF (Extended Kalman Filter) implemented in the smooth package. UKF smoothing will be implemented in the future.

Get started

Get the package:

$ go get github.com/milosgajdos/go-estimate

Get dependencies:

$ make dep

Run unit tests:

$ make test

You can find various examples of usage in go-estimate-examples.

TODO

Contributing

YES PLEASE!

go-estimate's People

Contributors

dependabot[bot] avatar milosgajdos avatar soypat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

go-estimate's Issues

kalman filtering for non fixed time delta updates

Hi, I was using kalman filter, where I need to call predict but at varying timesteps. I am referring to example where fixed delta t are used for state propagation. My measurement updates and predictions are async and can come at varying time intervals so first update can be called at 1s, next at 5s, and next at 6s... so on. from the source code it seems not doable as m ie. model is private and is fixed during initialization, now I can change A matrix(reflecting delta t multiplication) in model itself but this won't be reflected in kf object, as its pass by value, not pass by pointer. Can you please suggest, if there already exists something for this in library or a workaround.

interface definitions with nomenclature

It would be of great use if interfaces where arguments are ambiguous, for example Observer and Filter, named their arguments according to control theory typical nomenclature.

This is current interface definition

// Filter is a dynamical system filter.
type Filter interface {
	// Predict estimates the next internal state of the system
	Predict(mat.Vector, mat.Vector) (Estimate, error)
	// Update updates the system state based on external measurement
	Update(mat.Vector, mat.Vector, mat.Vector) (Estimate, error)
}

// Propagator propagates internal state of the system to the next step
type Propagator interface {
	// Propagate propagates internal state of the system to the next step
	Propagate(mat.Vector, mat.Vector, mat.Vector) (mat.Vector, error)
}

// Observer observes external state (output) of the system
type Observer interface {
	// Observe observes external state of the system
	Observe(mat.Vector, mat.Vector, mat.Vector) (mat.Vector, error)
}

Problems with this definition include:

  • All arguments are mat.Vector. What convention is being used?
  • Comments do not help either. Overall lackluster documentation

Other interfaces with this problem:

  • filter.DiscreteModel. This one is fixed easy: StateMatrix() (A mat.Matrix). A,B,C and D matrices are standard nomenclature for these matrices

Possible solutions

Below is a mix of adding a little bit of documentation + naming the variables.

type Filter interface {
	// Predict estimates the next internal state of the system. x is state, u are inputs
	Predict(x,u mat.Vector) (filter.Estimate, error)
	// Update updates the system state based on external measurement. x is state, u are inputs, z is the measurement
	Update(x, u, z mat.Vector) (filter.Estimate, error) 
}

Cannot run bf.go example

When I copy bf.go into my project and run it I get the following output:
../esp/go/pkg/mod/github.com/milosgajdos83/[email protected]/noise/gaussian.go:44:32: g.dist.CovarianceMatrix(nil) used as value
But if I run it from the examples dir it works as expected.

Question on motion model for drones

Hi,

We are looking for an UKF for motion modelling a drone path where degrees of freedom are very high. Just wanted to check this library is generic enough to incorporate any complex motion model.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.