I am having a problem with the edit roverLocalization algorithm for the mobile rover arudino eng kit project. I attached a picture of the error message and my arena setup as viewed by matlab.
the arena is 45x60 cm measured pretty accurately, and is well lit. Instead of the usb webcam provdied I used my iphone to live stream for better quality. also its above the 100 cm threshold as specified.
the error message is in step 5 of the alg. so I'm pretty close just don't really understand the error/how to fix it.
i have recalibrated the alg many times using the roverCalibration script and made sure to follow the steps accurately so I know its not a result of human error.
any help would be greatly appreciated as I've tried many different things to fix this. This is a tutorial that I downloaded so I know the code has not been changed.
Step 5: Visualize the results
Once we have the location and heading information for the rover, we can visualize the results by plotting it on top of the image from the webcam.
% Set the points to draw the lines for the heading and the center of the rover
thXE = discCenterX - L*cosd(shading); %ERROR HERE
thYE = discCenterY - L*sind(heading);
% Display the orthogonal view of the arena
% Display the center of the rover and the target in the image
plot(targetCenterX, targetCenterY, 'wx');
% Display the heading (angular orientation) of the rover in the image
plot(discCenterX + [-L L], [discCenterY discCenterY],'r--','LineWidth',2);
plot([discCenterX thXE], [discCenterY thYE],'b','LineWidth',2);