Robotics StackExchange | Archived questions

How do I convert costmap information to odom or pose information?

I can convert pose or odom data to costmap(Occupancy Gird Map) index, with this i = (width * y) + x. I learned how to do so from here. Is there a way to get x and y from i? I know its two unknowns thats why Im trying to figure out if there is some way.

Asked by distro on 2022-02-07 15:19:14 UTC

Comments

It’s possible to solve but you need to discard for complex solutions in your case.

Take a look at this: https://math.stackexchange.com/questions/336740/is-it-possible-to-solve-for-two-unknowns-from-one-equation

Asked by osilva on 2022-02-07 17:05:35 UTC

Answers

There are two unknowns, but you know width of costmap already.

x = i % width
y = (i - x) / width

Asked by harderthan on 2022-02-08 08:02:26 UTC

Comments

I have some documentation on the math here

Asked by David Lu on 2022-03-16 11:57:08 UTC

Comments