# Using sensor data and a know reference point infer the position of a moving robot

Say, the robot is starting at a known position and I've data coming off of the robot as it traverses the grid layout. Exploiting the nuances captured in the data - like the implication of unequal rpm in the wheels indicating the robot is turning off to the side of slower wheels- I would like to dynamically infer the location of the robot relative to its starting position.

The ideal solution would be as the data is streaming in my model would dynamically infer its location from the data. I'd like to know if there are any existing solutions for this problem or any ideas that can help me get started are appreciated.

• it's not that this is ill-suited to machine learning, but that it's very well studied as standard localization problems with algorithms such as SLAM and particle simulators; robotics.stackexchange.com/questions/tagged/localization Dec 22, 2020 at 16:43

I see two classes of solutions to your problem:

Solutions without machine learning

The way we did this when I studied realtime systems was to analyze the data coming from the wheel sensors by hand:

First, plot the rate of rotation of the robot w.r.t. the wheel speeds. Is the rate of rotation linear with the difference in speed of the two wheels? The ratio of speeds? Try to find a relation between these variables so that you can later calculate the change in the orientation of the robot from its wheel speeds over a period of time.

Second, do the same with forward and backward movement: when the wheels are turning at rpm X, how fast does the robot move? Is it a linear relation? Find an equation for it.

Once you have these two relations defined, you can dynamically update the position of the robot by determining its direction (based on previous direction and current rate of rotation) and speed (based on wheel rpm), and adding those to the previous position.

This approach is a lot of work, but will help you understand how the wheel speeds influence your robot's movement.

Solutions with machine learning

Given the popularity of machine learning in data science, I presume it might be what you were looking for when asking your question here.

What you have is time series data with two variables: speed for two wheels.

You could drive your robot around the grid for a little while, accelerating, decelerating, turning, stopping, etc. while recording the robots position as well as its wheel speeds at regular, short intervals. This is how you would build a training dataset. You will need to find a way to record the position: perhaps you could use triangulation to locate the robot in the grid, or an overhead camera. You will end up with a sequence of data points (or multiple sequences), each with two wheel speeds (the input variables) and two position coordinates (the output variables).

You would then need to train a model on the time series data, with the position at each step of the time series as your model output (a regression with two output variables).

What kind of model would suit this purpose? It would be very interesting to see what a RNN, with LSTM or GRU units, could do in this situation. The only way to find out if it'll work, however, is to give it a try.

This approach is also quite a bit of work, and will not help you understand the impact of the wheel speeds on movement much (because the model will most likely not be interpretable).

• Thank you. I'm inclined towards using ML to solve the problem as I might have to generalize the model to other applications alike. Could you help me figure out how to look for similar problems on Google. Perhaps I'm not using the right keywords as a result I'm not able to get nearly enough hits pertaining to this specific problem when I google. Sep 26, 2018 at 18:11