Help with deciding Linux capability for Real-Time application
I had noticed a few threads on Real-time application on Linux, but felt that i must start a new thread regarding the question in mind.
Background information --->
I am working on robotics with vision. I interface with the robot using an interface box, provided by the manufacturer. The communication takes place between the interface box and computer over a CAN bus. (The manufacturer chose to use CAN as the communication medium).
The interface box sends the robot current status information in two packets with a gap of 20ms. So at time T ms it sends Status (1st half of complete status) and at (T+20)ms it sends Status (2nd half of complete status). Then it sends a third packet requesting any use input, i.e asks to provide a new velocity profile or new position information that robot needs to move in. The robot waits for the entire duration of 20ms to accept the information. After this the above sequence repeats.
On my Linux box, I need to run three things
1. CAN Communication routine which runs every 20ms or when i need to send the new status information to the robot.
2. A high level control algorithm (runs for less than 1ms)
3. Image processing. This takes a lot of computational resources and needs to run all the time on the computer and be preempted when the CAN communication routine or the control routine run
Now I wondering if this would be classified as a hard real-time or a soft real-time system. In either case, could anyone suggest possible Linux distributions to use. Will a general desktop Linux distribution be able to handle the time constraints and computational requirements in this application?
I was thinking of using RTLinux. Could anyone suggest if they have worked on a similar thing, what they have done. I am traditionally from Windows background but have some working experience with Linux. But done very little programming on Linux.
One of the problems that I faced when using the Windows machine is that, it does not preempt the Image processing routine in time and runs for nearly 40ms and more before relinquishing control to the CAN communication routine. I am sure there could be ways for doing it on Windows, but could anyone provide me the Linux alternative.
Any suggestions would be greatly appreciated!!