We recently received our V5 Vision Sensor; The programming is quite confusing and our programmers cannot understand it at all. Would you be able to explain to us how to program the Vision Sensor exactly? And also, is the Vision Sensor only used for autonomous? Thank you in advance.
Welcome! Have you done a search of this forum, youtube, or the internet yet? If not, you’ll find lots of stuff posted. I think that would be a great start.
To help you are going to have to give us a bit more info as its a bit program language specific.
What programming language/IDE are you using? (Pros, Vex Coding Studio, Vex Code, Robot Mesh?)
It is just a camera that automatically detect some specified colors for you. You can use it however you want (during autonomous and usercontrol). Though it is much more useful during autonomous since there are no drivers controlling the robot.
Also I have never used the vision sensor but people say that it has problems detecting the colors if the light changes, which would happen whenever you go to a competition, but I do think there are some functions to help with that.
There are a couple of getting started videos I posted here for VCS, although VCS is now obsolete the same procedure is used in VEXcode.
For VEXcode V5 blocks, there’s a help article here.
The same concepts apply to VEXcode text, you just need to create a new vision header file and select the configure button.
The vision sensor can be used during driver control and autonomous, as with all other sensors. Once you have setup the vision sensor correctly, it can return coordinates of the colors/objects that it recognizes based on where they appear in the sensors field of view. Then you can use that sensor feedback to determine how the robot should move. For example, if the middle x coordinate the object is 10, but you know that the robot will be aligned with the target when the middle x coordinate is 0, then you would turn until its 0.
I’m going to assume that you are looking for PROS support since this thread has that tag, so I would recommend carefully reading the following links, experimenting with some of the features, and returning if you have any more questions.
Pay close attention to the data structures, such as when they are used, which functions use them, and what information they hold. Having a clear understanding of them will help you understand what the other functions do, and how to utilize them.
We only use Vex Coding Studio, C++ Pro