Robot software: Difference between revisions

Content deleted Content added
syntaxhighlight instead of code
Line 136:
Another interesting approach is worthy of mention. All robotic applications need parallelism and event-based programming. Parallelism is where the robot does two or more things at the same time. This requires appropriate hardware and software. Most programming languages rely on threads or complex abstraction classes to handle parallelism and the complexity that comes with it, like concurrent access to shared resources. [[URBI]] provides a higher level of abstraction by integrating parallelism and events in the core of the language semantics.
 
<syntaxhighlight>
<code>
whenever(face.visible)
{
Line 143:
headTilt.val += camera.yfov * face.y
}
</syntaxhighlight>
</code>
 
The above code will move the <code>headPan</code> and <code>headTilt</code> motors in parallel to make the robot head follow the human face visible on the video taken by its camera whenever a face is seen by the robot.