MATLAB Answers

ROS Action Client in Simulink

2 views (last 30 days)
SMEAC
SMEAC on 26 Nov 2019
Commented: SMEAC on 8 Dec 2019
Does anyone know if it is possible to use a ROS Action Client in Simulink? Combined with Stateflow it would be a lovely alternative to FlexBE.
Many thanks in advance

  0 Comments

Sign in to comment.

Answers (1)

Cam Salzberger
Cam Salzberger on 5 Dec 2019
I am afraid that it is currently not possible (as of R2019b), but I have passed along your suggestion to the relevant people. They will consider it for inclusion in a future release of MATLAB.

  3 Comments

SMEAC
SMEAC on 5 Dec 2019
Hello Cam,
Thanks for your response but I have actually since got it working, action clients combined with Stateflow. If you are interested, I will put together a simple demo and get it uploaded.
Regards
Gavin
Cam Salzberger
Cam Salzberger on 6 Dec 2019
Ah, do you mean that you used the MATLAB rosactionclient within Stateflow? Sorry, I was thinking only of a Simulink action client block. It's great that you got it working, and I'm sure that other users looking to perform a similar workflow would love to have an example to work from!
SMEAC
SMEAC on 8 Dec 2019
Hello Cam,
Yes, I actually did at first want a Simulink Action Client Block, but after developing it, I found in the end, the more elegant solution for my need was a direct integration into Stateflow. I have now uploaded both solutions as small demo programs. They are not finished completely, the only interesting point really is tracking the goal ID from a request to the feedback and status. And what needs to be updated, is that at present, there is no waitForServer working. In Matlab, I can detect if a Server is running using a few tricks with rosnode(), but in Simulink that fails with coder.extrinsic and the need to access the mxarray. An alternative is to monitor the server publishers, but then you would have to rely on a timeout.
The Action Client Block can be found here:
The Action Client inside Stateflow can be found here:
Regards
Gavin

Sign in to comment.

Sign in to answer this question.