![]() |
Vision Code question.
Having finished writing the vision code, I tested our vision code. The only problem is that it did not seem to work. :(
if you can pinpoint our problem, it would be very helpful. This is my first year coding camera code in c++, so... i expect many things to go wrong :P the vision.h: Code:
#ifndef VISION_HCode:
#include "../Robotmap.h"Code:
while (vision->Center_Mass() <159 || vision->Center_Mass() > 161){ |
Re: Vision Code question.
There's obviously some parts missing (declarations for your targeting code like vision and center mass, so this is assuming those are right). Have you verified yet that the center of mass X you're finding in the image processing is the same as the value being passed into your targeting code?
|
Re: Vision Code question.
Also note that the first particle in the list is particle 0 not particle 1. Unless you have a reason to skip particle 0, that could be one of the bugs. In addition, you should not blindly access the particle array within checking the particles->size(). It is possible that the vision code found no target. In that case, your code will fault.
|
Re: Vision Code question.
Thanks for the suggestions. I have heavily modified our vision code so that it should work now. Unfortunately, due to the lack of time plus the fact that it seems that we are capable of aiming the camera quite well with just the stream on the driverstation, we may not need to use the targeting code at all this year. However, it was great practice for next year :)
|
| All times are GMT -5. The time now is 17:40. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi