How can I manage more complex ROS messages in Simulink? (e.g. JointTrajectory)

6 次查看(过去 30 天)
I'm computing the joint values using simulink. Now I want to send the values to ROS using the Publish block in simulink. However, i can't fin a way of filling the fields for the message as i want. Not even with a Matlab function. Do you have any ideas how to fill the struct message?

回答(1 个)

Cam Salzberger
Cam Salzberger 2019-4-8
Hello David,
You can create an empty message structure of your desired type using the Blank Message block, and fill in the values using a Bus Assignment block. There are a couple of examples of this in the "Getting Started" models.
-Cam
  1 个评论
David Morilla Cabello
Thanks, I went trough that already. My main problem was the data type management, but I found the example I needed. I will leave it here in case someone has the same problem.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Publishers and Subscribers 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by