Custom ROS msg type does not get added to rosmsg list even after MATLAB restart
조회 수: 3 (최근 30일)
이전 댓글 표시
I'm following this guide to create a custom ROS message type (https://www.mathworks.com/help/robotics/ug/ros-custom-message-support.html).
This is the structure of my msg
path_planning_msgs FOLDER
--- path_planning_msgs FOLDER
--- package.xml (copied from guide, replace w <name>path_planning_msgs</name>
--- Path.msg
Contents of package.xml
<package>
<name>path_planning_msgs</name>
<version>1.1.01</version>
<build_depend>message_generation</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>std_msgs</build_depend>
</package>
Contents of Path.msg
Header header
path_planning_msgs/VehicleState[] states
Then I executed these commands and everything seemed to work (I'm on Ubuntu 16.04 LTS)
![Screenshot from 2019-03-18 19-58-40.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/209112/Screenshot%20from%202019-03-18%2019-58-40.png)
Then I edited javaclasspath.txt to add the line
![Screenshot from 2019-03-18 19-59-11.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/209113/Screenshot%20from%202019-03-18%2019-59-11.png)
Then I ran the addpath and savepath
![Screenshot from 2019-03-18 19-59-36.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/209114/Screenshot%20from%202019-03-18%2019-59-36.png)
Then I closed MATLAB to restart it.
Then I checked rosmsg list but the path_planning_msgs/Path type is nowhere to be found.
![Screenshot from 2019-03-18 20-06-42.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/209115/Screenshot%20from%202019-03-18%2020-06-42.png)
Thank you in advance.
댓글 수: 0
채택된 답변
Sebastian Castro
2019년 3월 19일
편집: Sebastian Castro
2019년 3월 19일
Hi An,
Pretty sure the ROS package requires your .msg file to be inside a subfolder called msg.
So your folder structure should be as follows:
path_planning_msgs FOLDER
--- package.xml
--- msg FOLDER
--- Path.msg
Try that and let us know if it works!
- Sebastian
댓글 수: 6
Sebastian Castro
2019년 3월 19일
An,
That latest error is exactly because you don't have a VehicleState.msg file defined! If you look at the error text it will show you it's pointing at an undefined symbol "VehicleState".
By the way, in future it would be much more useful instead of screenshots to copy-paste the error message text. This makes the question searchable if others have similar errors!
- Sebastian
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Custom Message Support에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!