Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Where does Windriver printf (http://www.chiefdelphi.com/forums/showthread.php?t=115003)

omsahmad 14-03-2013 20:05

Where does Windriver printf
 
So I know you can setup smartdashboard or DriverStationLCD, but where does Windriver print a line if you just put in the following (as seen in vision example):
Code:

        if(scoreCompare(scores[i], false))
        {
                printf("particle: %d  is a High Goal  centerX: %f  centerY: %f \n", i, report->center_mass_x_normalized, report->center_mass_y_normalized);
                printf("Distance: %f \n", computeDistance(thresholdImage, report, false));
        } else if (scoreCompare(scores[i], true)) {
                printf("particle: %d  is a Middle Goal  centerX: %f  centerY: %f \n", i, report->center_mass_x_normalized, report->center_mass_y_normalized);
                printf("Distance: %f \n", computeDistance(thresholdImage, report, true));
        } else {
                printf("particle: %d  is not a goal  centerX: %f  centerY: %f \n", i, report->center_mass_x_normalized, report->center_mass_y_normalized);
        }
        printf("rect: %f  ARinner: %f \n", scores[i].rectangularity, scores[i].aspectRatioInner);
        printf("ARouter: %f  xEdge: %f  yEdge: %f  \n", scores[i].aspectRatioOuter, scores[i].xEdge, scores[i].yEdge);       
}
printf("\n");

DriverStationLCD is pretty limited and I am still figuring stuff in SmartDashboard.

Thanks.

Tanaythan 14-03-2013 20:12

Re: Where does Windriver printf
 
Printf's go to the NetConsole for cRio or to the target console that can be accessed from Windriver. NetConsole is much more convenient as it does not go away when the cRio reboots; if you enabled NetConsole with your cRio imaging tool, I highly recommend the use of NetConsole. You can monitor all printfs from there.

omsahmad 15-03-2013 14:40

Re: Where does Windriver printf
 
Quote:

Originally Posted by rawrxp (Post 1248273)
Printf's go to the NetConsole for cRio or to the target console that can be accessed from Windriver. NetConsole is much more convenient as it does not go away when the cRio reboots; if you enabled NetConsole with your cRio imaging tool, I highly recommend the use of NetConsole. You can monitor all printfs from there.

Awesome, thanks

bob.wolff68 15-03-2013 15:45

Re: Where does Windriver printf
 
Just be careful of sending a printf() in your while(IsOperatorControl()) loop. The frequency of such a thing is very high and will quickly swamp the network/cRio etc. Often we will use a static int counter or a timer.HasPeriodPassed(500) to only allow a printf to occur a few times per second.

bob

rbmj 15-03-2013 21:18

Re: Where does Windriver printf
 
Quote:

Originally Posted by bob.wolff68 (Post 1248532)
Just be careful of sending a printf() in your while(IsOperatorControl()) loop. The frequency of such a thing is very high and will quickly swamp the network/cRio etc. Often we will use a static int counter or a timer.HasPeriodPassed(500) to only allow a printf to occur a few times per second.

^This. Another good option is to printf() in a separate task that sleeps for 100ms or so every loop - we did this for our DriverStationLCD stuff and any printf()s we needed for debugging last year.


All times are GMT -5. The time now is 12:50.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi