Go Down

Topic: Error message: 'Shading' too many output args./ Arduino Engineering Kit (Read 268 times) previous topic - next topic

lanzooo

Mar 18, 2019, 09:25 pm Last Edit: Mar 18, 2019, 09:35 pm by lanzooo Reason: added code
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);

arduino_new


lanzooo

This is a project from the Arudino Engineering Kit - Mobile Rover. While the coding is in MATLAB it is a script from Arduino's toolbox files which is provided for use of the kit.

Mathworks has not helped me since it is an "Arudino Product"

UKHeliBob

Is there any chance of you posting the code that runs on the Arduino ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

lanzooo

so there isn't actually any code that is running on the arduino. its all in matlab. the matlab algorithms are using the camera and the robot to calibrate a coordinate system it can display on the arudino to be used for moving the robot in real time. I attached a screen shot of the section of the arduino tutorial I am working on.

The coordinate system is what I should see however I run into the shading error. I understand this is an arduino forum but I was hoping someone with some insight into this problem can help since it is an arduino product even though its using matlab.

thanks

ieee488

All the programming is done in Matlab and Simulink.

The only thing that is Arduino is the Arduino MKR1000 that is included in the kit.

Apparently you are suppose to start from the basics and build on from there.
If you are choosing to bypass the fundamentals, you should rethink that idea.

Most of us don't know anything about Simulink or Matlab.

.

Go Up