Our sorting robot has two threads so it can sort while moving. The threads access different servos, but sometimes when both threads are moving a servo it does this weird glitch. Both servos go into this state where they iterate to one value and then slam back to a low value. Currently we stop the sorting while doing iteration of our arm, but we would like to solve this.
Currently I'm looking around in the source code trying to find the cause and a solution. Aside from throughly confusing myself, I have accomplished absolutely nothing doing that.
Try putting:
at the top of your program (VERY top). Also, be sure that you are not including pthread twice after doing this. I wrote this on the fly and I'm not sure it will work. The Link is very picky about threads. By any chance are you using create_read_block() anywhere while the thread is running? Is it even a create? I've been meaning to submit a but report about that function not liking threads. I'm not sure why really.
-Marty Rand
{
Senior programmer at Norman Advanced Robotics
Former senior programmer at Whittier Middle School
Youth Advisory Council
All around nerd
}