Parallel alignment of robot with a wall
I need advise on how to dynamically rotate my robot to an exact angle so it can travel parallel to a wall.
My robot is successfully stopping half a meter from the wall in my simulation and at that point I need to turn it so as to make the robot move beside the wall with a consistent gap between it and the robot.
My video shows everything I just descibed ( apologies for the 2+ minutes of slow robotic manuvering ).
Is there a technic I can use to determine when my robot is exactly parallel with the wall ?
I thought of turning the robot from it's starting position and publishing to cmd_vel so that it travels to the wall in a straight line. But I face the same problems at the begining and end of that straight line journey. Especially at the start, the exact value to issue to twist.angular.z for the robot to be aimed at the wall.
I also considered using odometry to find the robots standing orientation before it begins its manuever and somehow use that to determine how far the robot should turn when it reaches the wall --- in order for the robot to be facing the same general direction. However, the robot is unlikely to be perfectly aligned in the desired direction before it begins its move towards the wall. So using that orientation data might make the rotation flawed.
Advise would be very appreciated.