我正在尝试使用 PID 控制器来实现目标 FPS 和延迟。对于 PID 控制器,我使用了https://github.com/tekdemo/MiniPID。
这就是我在while
循环中设置它的方式:
while(true){
/* Create the command with all the given values.*/
char Run_Command[150];
sprintf(Run_Command,
"./%s --threads=4 --threads2=2 --target=NEON --n=%d --partition_point=%d --partition_point2=%d --order=%s > output.txt",
graph.c_str(), N_Frames, PartitionPoint1, PartitionPoint2,
Order.c_str());
/* Run the command and parse the results.*/
system(Run_Command);
ParseResults();
/* Both Latency and Throughput Requirements are Met.*/
if ( FPSCondition && LatencyCondition ){
printf("Solution Was Found.\n TargetBigFrequency:%d \t TargetLittleFrequency:%d \t PartitionPoint1:%d \t PartitionPoint2:%d \t Order:%s\n",
BigFrequencyTable[BigFrequencyCounter],LittleFrequencyTable[LittleFrequencyCounter], PartitionPoint1, PartitionPoint2, Order.c_str());
break;
}
printf("Target Perfromance Not Satisfied\n\n");
/* Get the output of the PID. */
double output_FPS=pid.getOutput(Sensor_FPS, Target_FPS);
double output_Latency=pid.getOutput(Sensor_Latency, Target_Latency);
/* Do something with the output of the PID. */
}
我不明白 PID 控制器的输出指示什么,以及如何使用它来过渡到我的目标 FPS 和延迟。