by krzyzani » Fri Aug 19, 2011 1:26 am
by krzyzani
Fri Aug 19, 2011 1:26 am
Hi,
Thanks for your interest in my work. Your question is insightful and critical. I appreciate your scrutiny, and I will attempt to provide a sufficient answer.
The main problem is that Robotis' CM730 class is not thread-safe, but the MotionManager detaches a thread and polls the CM730 on that thread. Therefore, while the the MotionManager is running, any attempt to communicate with the CM730 on, say, the program's main thread will bungle the stream of bytes going between the main controller and the sub-controller, resulting in some kind of crash (the state-machine usually gets stuck waiting for bytes that are not coming). Of course, if you only want to move the servos, there would be no need to communicate with CM730 on the main thread. However, if, say, you want to change the color of the eyes, then your only option is to first kill the MotionManager. Worse is that the MotionManager only polls 2 axes of the accelerometer, but not the third, nor the gyroscope, and since these components are on the CM730, they are similarly inaccessible while the MotionManager is running. Therefore, I have chosen to bypass the MotionManager entirely. Even if such problems did not exist, I do not believe that any functionality could be gained by using the MotionManager directly (as the initial draft of TellDarwin, in fact, did). Furthermore, Darwin's battery-life is lamentably short. Polling the CM730 while the robot is not doing anything seems like a waste of electricity.
I hope this makes sense. If anyone sees a better way of doing things I am always open to suggestions.
Mike
Hi,
Thanks for your interest in my work. Your question is insightful and critical. I appreciate your scrutiny, and I will attempt to provide a sufficient answer.
The main problem is that Robotis' CM730 class is not thread-safe, but the MotionManager detaches a thread and polls the CM730 on that thread. Therefore, while the the MotionManager is running, any attempt to communicate with the CM730 on, say, the program's main thread will bungle the stream of bytes going between the main controller and the sub-controller, resulting in some kind of crash (the state-machine usually gets stuck waiting for bytes that are not coming). Of course, if you only want to move the servos, there would be no need to communicate with CM730 on the main thread. However, if, say, you want to change the color of the eyes, then your only option is to first kill the MotionManager. Worse is that the MotionManager only polls 2 axes of the accelerometer, but not the third, nor the gyroscope, and since these components are on the CM730, they are similarly inaccessible while the MotionManager is running. Therefore, I have chosen to bypass the MotionManager entirely. Even if such problems did not exist, I do not believe that any functionality could be gained by using the MotionManager directly (as the initial draft of TellDarwin, in fact, did). Furthermore, Darwin's battery-life is lamentably short. Polling the CM730 while the robot is not doing anything seems like a waste of electricity.
I hope this makes sense. If anyone sees a better way of doing things I am always open to suggestions.
Mike