Fail to create custom message rosgenmsg in Matlab 2020b

8 ビュー (過去 30 日間)
Van Chuong Nguyen
Van Chuong Nguyen 2021 年 2 月 9 日
コメント済み: Cam Salzberger 2021 年 2 月 10 日
Hi,
I have a problem, hope that someone can take a look and give me some insight/ advice about it.
So I have Matlab 2020b in Window OS (host computer), and ROS Gazebo in VM Ubuntu.
I already copied the ROS packages from VM to the host computer as picture bellow, and set the folderpath as
folderpath='C:\Program Files\MATLAB\R2020b\custom_msgs\packages';
However, after I run rosgenmsg(folderpath), it shows the error:
Based on the error I guess, I checked inside the msg folder here, I realize that the .msg files are already exists:
Thus, it really makes me confused with this issue.
Thanks for your help!
  2 件のコメント
Adam Danz
Adam Danz 2021 年 2 月 9 日
編集済み: Adam Danz 2021 年 2 月 9 日
My guess: it's a path problem that can be solved with addpath(__), using the path the msg files. If that fixes it, the question becomes, why isn't this path added in the first place?
Van Chuong Nguyen
Van Chuong Nguyen 2021 年 2 月 9 日
編集済み: Van Chuong Nguyen 2021 年 2 月 9 日
Thanks Adam, I am not sure what do you mean.
Could you please write it in detail with addpath?
As I see from here, we only use addpath after it create custom message successfuly?

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

回答 (1 件)

Cam Salzberger
Cam Salzberger 2021 年 2 月 9 日
Hello Van,
You are providing the "package directory" to rosgenmsg, when it is looking for the "interfaces directory". This is because many users have multiple packages of custom messages. In this case, you would be looking to provide the path to "custom_msgs", not "package".
See here for more details on folder structure.
Also, your result message names will be along the lines of "package/Cartesian". Are you sure that is the correct package name you want to use? MATLAB takes its cues from the folder name, so ensure that it is named appropriately.
-Cam
  2 件のコメント
Van Chuong Nguyen
Van Chuong Nguyen 2021 年 2 月 9 日
編集済み: Van Chuong Nguyen 2021 年 2 月 9 日
Thanks Cam,
You're right, I should provide the path to custom_msgs. After I provided that, the error does not appear, but it shows another error
Although, I already chose a complier by running 'mex -setup cpp' as showned below.
Could you please give me some more insights about it?
Thanks for your help
Cam Salzberger
Cam Salzberger 2021 年 2 月 10 日
There are specific requirements to be installed on your system, depending on the MATLAB version and your platform. For Windows with R2020b it requires Python 2.7 (exactly version 2.7), CMake 3.15.5+, and Visual Studio 2017 (exactly version 2017, not later).
-Cam

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

カテゴリ

Help Center および File ExchangePublishers and Subscribers についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by