Communicate the refbox via OPC-UA, closely mimicking the behavior of the real MPS machines:
Spawn a freeopcua server for each MPS with the expected nodes
For each MPS, read the action ID and the payloads to get the command that is supposed to be executed
Execute each command in the background, so we do not block the main thread
Set the flags busy/ready to true/false, as the refbox expects, and in the same way as the real machines do:
When starting a command, set busy to true
When a command finishes, set busy to false
If there is a workpiece at the machine's output, set ready to true
Set ready to false if the workpiece has disappeared
Do not get the MPS state from the game info, instead actually use the commands sent to the machine
Improve the RS slide by expecting the workpiece to hit the MPS (i.e., the expected height of the workpiece is 0.8), thereby reducing false positives
Stack the RS slide workpieces next to the slide (note that the model is still wrong, so the slide is actually in the wrong position)
Log things with spdlog; create additional log files for each MPS
Things not working yet:
The storage station
Machine resets; they have never worked before though, either, as the refbox does not actually send resets to the machine (or more precisely, it resets the machine after every command, which is a different kind of reset)
Communicate the refbox via OPC-UA, closely mimicking the behavior of the real MPS machines:
busy
/ready
totrue
/false
, as the refbox expects, and in the same way as the real machines do:busy
to truebusy
to falseready
to trueready
to false if the workpiece has disappearedThings not working yet: