santdiego/simExtSimulink

Issue about reading the image to simulink

Closed this issue · 2 comments

Hi,

Your work is excellent! I used it with the RL toolbox to train the agent. Previously I just read the position and velocity table to Simulink, which works fine. Last week I saw you upload the reading camera example so I tried to use the block you provide to create a visually trained agent. But I noticed that the block open/run/stop doesn't work in the camera example, I have to manually start the simulation in CoppeliaSim then read the image in Simulink, so RL training is impossible because it needs iteratively start/stop from simulink. If you have a plan to solve this issue, it will be a great help to my research. Thanks!

Hi. Please note the following:
The client block (Simulink in this case) tries to obtain the size and data type from the server (CoppeliaSim). If the server isn' running (as it happens at the beginning of the simulation), it will try to obtain the size / type of data by the Simulink propagation rules. If the next block does not have a fixed size/data type, then it will use the default initialization, with data type "double" and "128 bytes" size.
In the exampleCam example, you will notice that I modified the input signal attributes of the "toRGB" block to force a size of 786432 bytes and data type uint8. This is enough for the block to infere the size of the output by propagation.
image

I close this issue due to inactivity.