So I’ve decided to use Iterative Robot over Simple Robot. I’m editing the BuiltinDefaultCode project. I notice they use the autonomous and teleoperated periodic functions but not the continuous. I was wondering what the relationship is between the periodic and continuous. If you put code in both, how do they run relative to one another? Also, what specifically is the difference? And I guess, all this leads to the question, what should I use (or based on what should I decide?)
Also, I’ve found the code I need for getting data from the sensors, but I’m not very familiar with C++ and object oriented programming so I’m not really sure of where to put what.
I’ve got this for the camera. Which parts go wherever I decide to refresh my sensors? For that matter, where is it a good idea for me to refresh my sensors? Also, is there other necessary camera configuration stuff I need to put in somewhere in my code?
double timestamp; // timestamp of image returned
Image cameraImage = frcCreateImage(IMAQ_IMAGE_RGB);
if (!cameraImage) { printf(“error: %s”, GetErrorText(GetLastError()) };
if ( !GetImage(cameraImage, ×tamp) ) {
printf(“error: %s”, GetErrorText(GetLastError()) }; *
And then there’s this, which I assume will go right after I get my image:
imaqImageToArray(const Image image, Rect rect, int* columns, int* rows);*
And finally there’s this: basically, I’m not sure what parts of this (if any) set up the sensors, and which parts just get the data.
- Ultrasonic ultra(ULTRASONIC_PING, ULTRASONIC_ECHO);
ultra.SetAutomaticMode(true);
double range = ultra.GetRangeInches();*
Any help would be appreciated…there isn’t much programming experience on my team. Thanks!