Unit 2 topics exercise 2.2

I am doing ros in 5 days course, i created my own custom message in newsubscriber_package and then compiled using catkin_make but when i launch the file it is showing

No module named newsubscriber_package.msg

Hi @abhinavabhi742 can you tell me more about it, perhaps a screenshot!

1 Like

Hi @abhinavabhi742,

Did you also run

source ~/catkin_ws/devel/setup.bash

on every terminal after that?

By the way, welcome to the community!

Hello @bayodesegun,

I am getting permission denied when i use ~/catkin_ws/devel/setup.bash

Hi @abhinavabhi742, did you type

source ~/catkin_ws/devel/setup.bash

or just


You need to include the command source, that is, use the former.


The same problem occured. No module named newsubscriber_package.msg


  • Is there a package named newsubscriber_package ?
  • Have you properly created and setup a custom message in that package, following the example given?
  • Have you run catkin_make and then the source command?

The error is saying that it cannot find the custom message you’re trying to load in the given location.

Hi @bayodesegun

I have done all the three steps but still the error occurs


But when i use rosshow Age , i am getting the info about Age

This is strange. On this same shell, can you run the following and try again?

source devel/setup.bash

PS; no need to put ~/catkin_ws/ since you’re already in that directory.

Hello @bayodesegun,

No improvement.Still the same error .No module

Whew, something is definitely missing :sweat:. Can you send the packages giving you problems to baderinola@theconstructsim.com? I’ll take a look later in the day and let you know.

Just download each package by right-clicking on the package folder in the IDE and choosing Download.

I have sent the packages to the above mentioned id.

1 Like

Hi @abhinavabhi742,

I did not find any problem with this package itself. Just that catkin_make did not complete at first because of the custom_service package, which was preventing catkin_make from completing.

I suggest you fix the custom_service package (as hinted on the thread for it), remove build and devel and compile again:

cd ~/catkin_ws/
rm -rf build devel 
source devel/setup.bash # run this on every terminal

Hi @bayodesegun,

Everything works fine now. Thanks for the help. Could you explain me the importance of queue_size=1 while creating Publisher because without this the program doesnt run ?

1 Like

Hi @abhinavabhi742,

You’re welcome! Glad to hear that you have everything working.

Read about queue_size here:

Hi @bayodesegun,

Ok understood . Thank you.