Generated ROS node from Simulink, does not work on the target ROS device when launching it manually from Linux terminal without Simulink

1 回表示 (過去 30 日間)
JF
JF 2022 年 4 月 26 日
回答済み: Josh Chen 2022 年 11 月 7 日
Dear Mathworks Community,
I am using Simulink R2020a. I have designed a Simulink model that I wanted to be deployed and run on a ROS device. I am using the virtual machine, provided by Mathworks, that come preconfigured with ROS.
when using the first method,build and run directly from simulink, automatically the ROS node is generated succesfully and the real robot achieve the desired motion accordingly.
When using the second method of deployment, generate the node from simulink then transfer the tgz file to the ROS device and built it there to become an executable package, the robot does not move after the running the node from the linux terminal. The node generated from Simulink was built successfully on the ROS device. Even though when I run the node, no errors popup and I can see the name of the node when typing rosnode list, and I can also visuliaze it in the ROS graph in rqt . This means that the node is actually active, but why the robot does not move at all like the first method ?
the name of the node generated from simulink is "robot_test", to run the node directly from the ROS device, I type in the linux terminal :
rosrun robot_test robot_test_node.
I highly appreciate your help and thank you in advance
  3 件のコメント
JF
JF 2022 年 5 月 12 日
Thanks for the response, how can I reach the MathWorks Technical support team as requested ?

サインインしてコメントする。

回答 (1 件)

Josh Chen
Josh Chen 2022 年 11 月 7 日
Hi JF,
Other quick things to try are:
1. Check whether the Gazebo world has been reset or not. Sometimes you may need to reset Gazebo. You can do this by Ctrl+R or click Edit > Reset World.
2. Run the following command on a new terminal on Linux and check whether expected messages has been published. Replace <topic-name> by the topic the generated node is publishing to (may also worth checking whether Gazebo is publishing any message).
$ source /opt/ros/noetic/setup.bash
$ rostopic echo <topic-name>
Please also forward this information when you reach out to MathWorks Techncial Support.
Thanks,
Josh

カテゴリ

Help Center および File ExchangeROS 2 Node Generation and Deployment についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by