Finite State Machine in multithread enviroment



  • Hi,

    we are working for a project where we have to control a complex robotical system. The external interface module is performed by a TCP modbus server, and internally, the robot have to deal with three CAN slaves (two motors and a robotic hand).

    All the code is Qt C++ with some CANopen and Modbus libraries.

    The behavior of the robot has been designed according to the following state machine:

    !http://s1.postimg.org/ba5tphhin/maquina_Deestados.png(State Machine)!

    We are in the design stage and have some general question:

    There are so many information about State Machine in C++ that cannot figure out what's the best way, maybe someone in the forum has experience with this and can advice us! :)

    Thanks a lot.



  • I have to admit I used Qt State Machine framework too little for an advice, but I can say it's part of the QtCore, so for sure is suitable for any type of application, not just for graphical widgets.

    EDIT: regarding multi-threading, almost all features are already async.

    bq. The state machine executes asynchronously, i.e. it becomes part of your application's event loop.



  • Thank you for your opinion, cincirin, I finally started to implement the state machine with the QState Machine Framework.

    I will tell you how it went! :)

    Regards.



  • [quote author="inejose" date="1396958638"]I finally started to implement the state machine with the QState Machine Framework.[/quote]

    Good luck ! & happy coding :-)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.