As per my understanding you want to rotate the axes to match obstacles in the map.
Rotating the axes can be performed by using the function “camroll()”. Refer to the documentation on camroll for further information.
scan = lidarScan(ranges, angles);
plot(scan)
title('Ego View')
helperPlotRobot(gca, [0 0 Vehiclepose(3)]);
camroll(-90);
For the above code from the example below is the output which is mentioned.
Alternatively, you can use the following command with the example code as shown below
scan = lidarScan(ranges, angles);
plot(scan)
title('Ego View')
helperPlotRobot(gca, [0 0 Vehiclepose(3)]);
set(gca,'XDir','reverse');
Output of the ego view for the above code is shown below
Making a combination of both “camroll()” and “set()” function will help in matching the ego view with the obstacles in the map.