Model-based design, simulation and automatic code generation for embedded systems and robotic applications