Info

This question is locked. 请重新打开它进行编辑或回答。

Simulink ROS2 subscriber transport stopped

13 次查看(过去 30 天)
Hello,
I am trying to subscribe to a ros2 topic, but I get the following error:
STD exception 'mwboost::wrapexcept<std::runtime_error>': 'Transport stopped.' was caught.
My Simulink model is the same as the example given in the tutorial, except I changed the subscriber topic to /controller_output to match my code.Inside the subsystem block at the bottom of my screenshot, I changed the bus assignment from the tutorial from x,y to torque, delta according to my message definition.
In my Linux terminal, I can see the messages being posted by using ros2 topic echo /controller_output
ROS2 subscriber block with sample time 0.01, topic /controller_output, message /custom_msgs/ControllerCommand
QoS: Reliable and Volatile
My setup:
Ubuntu 20.04
Matlab R2022b
ROS2 Humble
My message definition in ControllerCommand.msg
float64 torque
float64 delta
  1 个评论
Prabeen Sahu
Prabeen Sahu 2022-10-27
编辑:Prabeen Sahu 2022-10-27
Hello Renzo,
Please restart the model and see if the issue still exists.
I need some more information to help you on this issue.
  • Does the original example work fine in your PC ?
  • Do you see this issue only with custom_msgs/ControllerCommand message or with other standard messages also ? Instead of custom_msgs/ControllerCommand please publish standard messages(geometry_msgs/Point) from "Ubuntu 20.04 ROS2 Humble" to a different topic(/location1). Please change the subscriber topic to /location1 and change the bus assignment to x,y in the Simulink model. Please run the model with these changes and check if this works.
  • Please also attach the support file generated by the command ros.internal.generateSupportFile
- Prabeen

回答(0 个)

This question is locked.

类别

Help CenterFile Exchange 中查找有关 ROS Network Access in Simulink 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by