Exercise 23 custom message issue

Hi i am having an Issue with the section and exercise on custom message generation in chapter 4.
I copied the code from the solution after not being able to get everything to work by myself but i experienced the same issue with the copied code as my own solution.
the catkins_make process compiles without Errors,
i can find the custom message Age when executing rosmsg list.
But when i run the publisher neither the topic is created and neither can i read the topic with rostopic echo.
I verified that the problems comes from importing the custom message.
If i use a standard message everything works fine. But as soon as i import the custom message (while still trying to only publish the standart message) the publisher stops working.
There is no error generated when executing the package.

Could you please verify that your example code is working correctly? Again i copy pasted everything, no error in the build process, no errors on package execution…so I am a bit helpless

by the way the rostopic echo generates:

WARNING: topic [/age_info] does not appear to be published yet

as the publisher is not working

Hi Sebastian,

Well, that’s pretty strange. Specially the fact that you don’t see any error message. I’ve just tested this Exercise with the code provided in the solutions, and it worked fine for me. I would suggest the following:

  • Remove your build and devel folders, to make sure that you don’t have any files there messing things up
  • Move to another Unit (which uses a different simulation) and go back to this one. This will restart the whole environemnt, making sure that there are no problems with the simulation. Sometimes Gazebo just crashes, which may cause strange errors.
  • Also, make sure to source all the shells where you are going to use the new message (both for publishing it and for reading it): source ~/catkin_ws/devel/setup.bash

If this does not solve your problem, let me know and I will check your files.

Best,

Ok thanks I will try

the build and devel files will be rebuild after catkin_make? So i can just delete them completly?

allready answered my own question, catkin_make will rebuild both folders

Actually, @sebastian.grede not everything is rebuilt, only the parts that you have modified in your last edit to the code. This could lead sometimes to strange errors (because things are mixed from different builds that do no longer match).

So, in general, you can just issue the ´catkin_make´ and your stuff will be rebuilt. In case you see strange errors or you manipulate the files in strange ways, manually delete the build and devel directories and compile everything from scratch

I’m having the same issue. Tried deleting build and devel and then catkin_make again but no luck.
Did you figure out how to proceed?

after deleting build and devel, issuing catkin_make, and source devel/setup.bash…
now when i do roscd cd … it takes me to…:

user:/home/simulations/public_sim_ws$

in src theres a folder called “all”… with a lot of other folders. please stop me from messing it up further.

When you come back everything should be back to normal. It seems you deleted some files you shouldn’t. When you want to delete these folders, be sure to run the commands from catkin_ws, like this:

cd ~/catkin_ws/
rm -rf build/ devel/
catkin_make
source devel/setup.bash