I'm getting error.......Don't know how to solve


Sir, in rospy.Publisher(), how do we know the topic name? Is it something we can write on our own. Or it’s already created somewhere. If it is already created, why is that? Because we didn’t create anything like topic.

Sir, I don’t understand this error below in the screenshot. It’s refering to .xml file, but I don’t understand what because apparently I’ve not done anything wrong there.

All my code files are below. Please have a look at them





Hello @abdulbasitisdost,

To the 1st question, it depends. You can create a new topic and publish to it if you want, or you can connect to a topic which already exists (like you did previously with the /cmd_vel topic). The topics which already exist in this case, are already provided by the simulation so you don’t have to create them.

As for the 2nd question, the error is in the launch file age_publisher.launch. In the error message itself it indicates you that the error is because of a duplicate attribute in line 3. If you have a look, you will see that you have the attribute name 2 times, which is not correct.

Best,

Sir, what’s this error. I was trying to run catkin_make command to compile it when I got this error

I changed the name from age.msg to Age.msg and changed all the code in .py accordingly. Is that causing any problem. And how do I deal with it?

Yes, you have to update the name of the message in the CMakeLists.txt file as well. If you have a look at the error message it’s telling you exactly this.

1 Like