MATLAB Answers

Fail to create ROS Publisher and ROS subscriber

20 views (last 30 days)
Hi all,
I am creating subscriber and publishers for the turtle bot robot. For most topics, after using rosinit, I can create properly
publishers and subscribers. However, I fail to create a publisher for the /sound topic.
For instance, for topic cmd_vel I get:
r1 = Publisher with properties:
TopicName: '/cmd_vel'
IsLatching: 1
NumSubscribers: 0
MessageType: 'geometry_msgs/Twist'
It works perfect, but for topic sound I get:
Failed to create a publisher with topic name /sound and type turtlebot3_msgs/Sound.
Can anyone give me any hint about why this behaviour?
Thank you very much in advance,


Sign in to comment.

Accepted Answer

Cam Salzberger
Cam Salzberger on 17 Jun 2019
Hello Ignacio,
The message type "geometry_msgs/Twist" is one of the standard, built-in ROS message types. However, the message type "turtlebot3_msgs/Sound" is a custom message type specific to the TurtleBot3. You'll need to make that message type available to MATLAB by building the "turtlebot3_msgs" package with the MATLAB Support Package for ROS Custom Messages.


Sign in to comment.

More Answers (0)

Sign in to answer this question.