Sensor localization: beginner questions

31 views
Skip to first unread message

Theodore Quinn

unread,
Jan 27, 2018, 4:20:49 PM1/27/18
to LibBi Users
I'm trying to use an SMC approach for localization of sensors moving around a room in two dimensions. I have a handful of fixed sensors and a handful of moving sensors. The moving sensors roughly follow Gaussian random walks within the four walls of the room. At regular time intervals, all of the sensors exchange radio pings with each other simultaeously. The received signal strength indication (RSSI) of the pings falls off roughly as the inverse distance squared, but with a lot of (roughly) Gaussian noise.

I have implemented a particle filter approach from scratch in Python with the positions of the moving sensors as the state variables and the RSSI of the received pings as the observation variables. I have been treating the positions of the fixed sensors as known constants. It works and I can do inference on the positions of the moving sensors. However, now I want to treat the positions of the fixed sensors as parameters and do inference on them, as well. In the process, I'm trying to migrate from my home-grown Python solution to LibBi, both for performance and to simplify my code. However, I'm brand new to LibBi and I have a ton of newbie questions.

I've attached my first attempt at a LibBi model file, mostly as a way of sketching what I'm trying to do (I'm quite sure it won't run as-is). I'll take any and all advice, but some of my specific questions are:
  1. I'm trying to read the size of my various dimensions (e.g., number of spatial dimensions, number of sensors) from a file. Is that allowed?
  2. I'd also like to read a number of other fixed quantities (scalar, vector, and matrix) from a file rather than hardcoding them into the LibBi model. I'm currently declaring these as input variables. Is that right? Is there a better way to do this?
  3. It really simplifies the code if I can define a couple of intermediate matrix values as I specify the probability distribution for the observation variables (the sensor_positions and distances variables in sketch). Currently, I'm defining these as observation variables with no output. Is there a better way to do this?
  4. In the observation block, I'm painfully combining the positions of the fixed and moving sensors into an overall sensor position variable using restricted ranges. Will this work? Is there a better way?
  5. The actual observed RSSI data is missing the diagonal (sensors don't send pings to themselves). For simplicity, I've nevertheless defined the RSSI observation variable as a square matrix, knowing that the observation data file will not, in fact, include any data for the diagonal. Will this work? Is there a better way? In Python, I handled this by defining a boolean mask which extracted and flattened the allowed RSSI values from the square matrix, but I'm assuming there's no equivalent approach here. (And yes, I know my logarithm will blow up for the diagonal because those distances will be zero; taking this one step at time)
  6. Rather defining a noise variable and adding it to the mean RSSI, I've just specified the observed RSSI variable as a Gaussian directly. Is there a reason to prefer one approach over the other?
  7. Is it permissible to break long lines as I have?
Once I get this working, I have a follow-up question about how to model missing values, but I'm trying to start simple. Sorry again for the novice questions. Thanks in advance for any advice.

Ted

SensorLocalization.bi
Reply all
Reply to author
Forward
0 new messages