void opcontrol() {
pros::Vision vision_sensor (10);
pros::vision_signature_s_t RED_SIG =
pros::Vision::signature_from_utility(1, 8973, 11143, 10058, -2119, -1053, -1586, 5.4, 0);
pros::vision_signature_s_t BLUE_SIG =
pros::Vision::signature_from_utility(1, 8973, 11143, 10058, -2119, -1053, -1586, 5.4, 0);
vision_sensor.set_signature(1, &RED_SIG);
vision_sensor.set_signature(2, &BLUE_SIG);
vision_sensor.set_exposure(56);
while (true) {
vision_object_s_t rtn = vision_sensor.get_by_size(0);
// Gets the largest object
std::cout << "sig: " << rtn.signature;
pros::delay(2);
}
}
When I run the code with a blue and red ball in view, no matter what rtn.signature will equal the red sig, even if it the red ball is smaller than the blue ball, unless there is no red ball in view. I tried printing the height and width and confirmed that the blue vision object is larger, but it still favored the red sig. I tried switching the signature numbers, so blue is 1 and red is 2, and the same thing happens where signature 1 (the blue signature in this case) is favored over size.
NOTE: the values in the signature_from_utility are not actually what they are in the real code because I cannot access the computer they are on currently. The values were just copied from the utility in the real code.