MATLAB Answers

0

Error shading - mobile rover - Arduino Engineering Kit

Asked by Anthony Lanza on 27 Mar 2019
Latest activity Edited by Madhu Govindarajan on 28 Mar 2019
hello
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.
thanks
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
L=150;
thXE = discCenterX - L*cosd(shading); %ERROR HERE
thYE = discCenterY - L*sind(heading);
% Display the orthogonal view of the arena
imshow(orthoViewRover);
hold on;
% Display the center of the rover and the target in the image
plot(discCenterX,discCenterY,'wx');
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);

  0 Comments

Sign in to comment.

1 Answer

Answer by Madhu Govindarajan on 28 Mar 2019
Edited by Madhu Govindarajan on 28 Mar 2019

That variable should be heading. That is the problem.

  0 Comments

Sign in to comment.