Simulink codegen(with ROS2 Node) output error

4 次查看(过去 30 天)
I have generated code with a simple controller in Simulink model with a ROS2 node within it. After I build it manually(On my Linux machine) ,there is successful communication b/w diff nodes and the output is perfect. However, upon terminating the nodes and attempting to rerun the identical build file, now connected to the same ROS node, the output becomes significantly incorrect. Even rebuilding and running the file doesn't rectify the issue. Strangely, after restarting my Linux computer, rebuilding, and running the file again, everything operates perfectly once more

回答(1 个)

Josh Chen
Josh Chen 2024-2-13
Hi Rahul,
It is hard to tell what's going on based on the description. When this happens, were you able to launch the generated node without any warning/error?
I think couple things you can try for finding the culprit are:
  1. After killing the node with 'Ctrl+C', check with 'ros2 node list' to see if there's any unexpected node available on the network
  2. Is this related to some other nodes in the same domain? You may try to run the node under another domain ID to verify this.
  3. After restarting, and terminating again, if you rerun, did it still give you the wrong value?
If the above steps still can't find the root cause, please provide more information (reproduction steps, deployment environment, MATLAB versions) through MathWorks Technical Support, and we can look closer into this issue.
Thanks,
Josh

类别

Help CenterFile Exchange 中查找有关 Simulink Coder 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by