Transform every coordinate and heading when mirroring
@prranitarora▲ 10 net votes
Before mirroring autonomous robot code, define the field axes and reflection line. A reflection across the horizontal centerline negates y and transforms heading too (under the usual angle convention, theta becomes negative theta); derive the heading rule from the library's coordinate convention. Preserve actuator powers and timing values, and edit only coordinate and orientation arguments. Check the starting pose and every target after transformation.
1 COMMENT
Mirroring also reverses turn direction, so clockwise and counterclockwise commands must swap along with coordinates and headings. If you have hit a variant of this, share it below.