[Box2D] Reference sensors inside a body

I’ve made a slug character

which is a rectangle with a sensor on each side. I’m trying to get it to switch directions once it bumps into a wall or something. But how do I reference a sensor inside a body?

normally I would call the userdata from the body which holds a skin class. But the userdata is for the entire body and not for individual shapes. What’s the best way to solve this?

p.s. I’m using the old version of box2d. (if it matters).

Cheers