Quote:
Originally Posted by sircedric4
Code:
void CamSource :: SetSource (double sourcedum)
{
source = sourcedum;
}
double CamSource :: PIDGet()
{
return source;
}
|
We've done pretty much exactly the same thing as you did here. I think we're running into a small concurrency problem though, and would like to hear from you as well.
As once in a blue moon your camera "spaz" while it is tracking?
Very rarely, but often enough to make it a pain, our camera tracker will move out of position quickly then recover for no apparent reason.
I think it's because of a classic concurrency issue where source is being read and written at the same time.
The PID controller runs in a separate task, and so potentially both SetSource and PIDGet could be called at the same time.
Would any more experienced programmers out there recommend locks? And if so, how would you implement them in the quoted code?