Vision Sensor Error!

Hey, I recently started using the VEX V5 vision sensor and I have come up with an error relating to the arrays and converting from vex::vision::signature to ‘int’. The program is below.

#pragma once

#include “robot-config.h”
#include “vex.h”
#include “LeftPID.h”
#include “rightPID.h”
#include “VisionSensor.h”

bool FindMOGO = true;

int locateMOGO(){
while(FindMOGO){
if(Vision1.takeSnapshot (RED_M) >= 1){
if (Vision1.objects[RED_M].centerX > 60.0){

}

}

}
}

Well, signatures are C++ classes, an instance of a signature cannot be converted to int.

access the Vision1.objects array using an int such as 0 for first found object, 1 for second etc.

3 Likes