How can I use user defined type message in rossubscriber?

1 view (last 30 days)
Hi, I want to connect a topic with rossubscriber in MATLAB. But there is a problem. While the basic form of a message(std_msgs, sensor_msgs etc.) was connected, I couldn't connect the type of message which is defined by my .msg files. For example, if The topic name is '/right_arm_status' and the MessageType is 'com_pkg/MotionStatus') , the following error appears: Failed to create a subscriber with topic name /right_arm_status and type com_pkg/MotionStatus.
What can I do?
if true
sub = rossubscriber('/right_arm_status', 'com_pkg/MotionStatus')
end

Answers (1)

Cam Salzberger
Cam Salzberger on 14 Mar 2019
Hello Yun,
For any non-standard (non-built-in) message types, you can make them available for use in MATLAB by using the Custom Message workflow. This will involve installing the support package for Custom Messages, and then generating the files required by MATLAB to use the custom messages. Once you do that, you should be able to create publishers and subscribers that use the message types you built.
-Cam

Categories

Find more on Specialized Messages in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!