Exercise 4.3 import Age module error

I compiled successfully and rosmsg list | grep Age gives the proper output so does rosmsg Age it shows everything year, month, day all float32. I finally checked the solution and found my CMakeList.txt was exactly like that show in the solution. The package.xml was slightly different I kept the build_depends, exec_depends and build_export_depends all grouped together. The solution had the build_depends followed by build_export_depends like:

I was surprised it didn’t work since rosmsg showed everything the tutorial showed, but import module error persisted even after changing package.xml. I know the order doesn’t really matter but tried anyway and I sourced devel/setup.bash after compile completed each time. During the entire exercise I received no errors until I launched the launch file, rosrun gives the same error as I expected, rosmsg output is all correct. The only thing I did was accidentally hit the green button at the top which I posted in another topic don’t know if that would cause a problem . Made sure names of everything were different. I’m still learning a lot and enjoying the course occasional problems are to be expected with a relatively new and what must be a complex website.

Try deleting your build/ and devel/ folders:

cd catkin_ws/
rm -rf build/
rm -rf devel/

If that doesn’t work, can you share what the error says? It sounds like something might be off with the node.



Solved, I often tell friends and family that I learn more from my mistakes and solving system errors than I do from anything else and that was certainly true here. I know far more about messages, CMakeLists and package.xml than I ever would have had it worked the first time. Rodrigo’s suggestion was the crucial step needed to get back on track. I finally deleted everything and started from scratch.


A post was split to a new topic: Package and Age custom message not found