Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem setting member variables using callback #1

Open
upstarter opened this issue Nov 12, 2020 · 1 comment
Open

Problem setting member variables using callback #1

upstarter opened this issue Nov 12, 2020 · 1 comment
Labels
bug Something isn't working question Further information is requested

Comments

@upstarter
Copy link

upstarter commented Nov 12, 2020

I am trying to use your KalmanKt library, and I was wondering if you could tell me what I'm doing wrong:
I use it like this to set an instance variable on the class that _kalmanProcessor is in, but it does not set the instance variables on member object _heartbeatInfo, can you suggest a fix?:

_kalmanProcessor!!.setLocationCallback(100) {
   kalmanFilterCallback(it)
}
 fun kalmanFilterCallback(locationKt: LocationKt) : LocationInfo? {
   val alt = locationKt.getAltitude()
   val lat = locationKt.getLatitude()
   val lon = locationKt.getLongitude()
   val bearing = locationKt.getBearing()
   val speed = locationKt.getSpeed()

   _heartbeatInfo!!.latitude = lat
   _heartbeatInfo!!.longitude = lon
   _heartbeatInfo!!.heading = bearing
   _heartbeatInfo!!.altitude = alt
   _heartbeatInfo!!.speed = speed

   return _heartbeatInfo!!
 }
@WindSekirun
Copy link
Owner

This library is no longer maintained. (I plan to archive soon.) However, it does not seem to be understood with the attached code.

After setting the callback, I think I can check whether the location information is injected through the process method, and whether it is actually executed as a breaking point. (KalmanProcessor is an example code, you can control it directly with KalmanFilter)

@WindSekirun WindSekirun added bug Something isn't working question Further information is requested labels Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants