MATLAB Answers

How to use rosgenmsg when package.xml file is in different directory and msg directory is in different directory?

최근 활동 Cam Salzberger 님이 답변함. 26 Apr 2019
I'm using ROS Kinetic and MATLAB R2018b on Ubuntu 16.04.5.
Now, I want to use MATLAB for the localization of TurtleBot3 but as MATLAB R2018b does not support ROS Kinetic, I'm getting md5sum error.
For that, I found out that, I have to create custom ROS messages using rosgenmsg(folder_path) command in MATLAB.
But in that, what about folder_path? Because in case of TurtleBot3, msg folder is in completely directoy/package; package.xml is also in different directory/package. So, what should I do now?
Please help!
Thanks a lot in advance!

  댓글 수: 0

로그인 to comment.

답변 수: 1

Cam Salzberger 님의 답변 26 Apr 2019

Hello Milan,
If you check out the example workflow and packages that are used in the custom message example here, you can see that the path passed to rosgenmsg is to the folder containing the message package folders. In other words, the example looks like this:
custom_msgs/
├── A/
├── msg/
└── DependsOnB.msg
└── package.xml
├── B/
├── msg/
└── Standalone.msg
└── package.xml
└── C/
├── msg/
└── DependsOnB.msg
└── package.xml
In this case, "A", "B", and "C" are your package folders. You would provide the path to the "custom_msgs" folder to rosgenmsg.
Since you are looking into regenerating all built-in messages, you can find more detailed instructions on this answer. The most important folder to regenerate would be the common_msgs folder, which contains most of the messages packages used in ROS.
In terms of TurtleBot3, the majority of it uses the common messages, but there is a separate turtlebot3_msgs package that you can add to your custom message folder if you want to use them.
-Cam

  댓글 수: 0

로그인 to comment.



Translated by