![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1278335/image.png)
Error occurs when executing 'rosinit'
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, I ran 'rosinit' command on R2022b with Ubuntu 20.04.5 LTS and got the error shown in the image below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1277090/image.png)
The cause of this error appears to be a timeout. However, I do not know how to resolve it.
Also, I had a problem with the python path before, so maybe there is still a problem with the python path.
I set the python path as shown in the image below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1277095/image.png)
I also tried to run 'rosinit' on a different port, but it did not work.
Thank you for your help.
0 Kommentare
Antworten (1)
Josh Chen
am 30 Jan. 2023
Hello Ryo,
Before running "rosinit", have you used "ROS Toolbox Preference" to setup the environment? In there, if there is any conflict or incompatibility regarding environment, you can see more information. You can open "ROS Toolbox Preference" by navigating to "HOME tab>Environment>Preferences>ROS Toolbox>Open ROS Toolbox Preferences"
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1278335/image.png)
Another thing to quickly check is the version of python. As an issue in R2022b, please use python 3.9.13.
Hope this helps,
Josh
4 Kommentare
Josh Chen
am 2 Feb. 2023
Hi Ryo,
This issue looks pretty strange. "roscore" is only required by ROS, however, in the error message, it points to something inside ros2_humble (i.e. ROS 2). Based on this error message, I assume you have both ROS and ROS 2 installed?
I am suspecting some environment variables setup got messed up between ROS and ROS 2 on this device. Which could also be the reason why you are not able to launch ros core through MATLAB.
Note that MATLAB does not require you to have ROS installed on your device. You may consider to either dig deeper to see which enviorment variables are causing this issue, delete both ROS and ROS 2, or do a clean reinstallation for ROS.
Best,
Josh
Siehe auch
Kategorien
Mehr zu Network Connection and Exploration finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!