0
$\begingroup$

Rosanswers logo

I have just completed ros Beginner Level Tutorials. At Level 3 a package is created by the name "beginner_tutorials". At level 10 we add msg file called "Num.msg" to msg folder of the same package.

When I made the package I made sure that Num.msg file is empty. So "int64 num" not there in the file.

Later at levels 11 and 13 we add and run simple publisher and subscriber.

Now Program runs smoothly. talker publish "hello world' and listener picks it up.

Can anybody explain how it publish using empty Num.msg file.


Originally posted by Jayantha on ROS Answers with karma: 1 on 2015-04-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I don't get what you mean.
If I understand well, you deleted the msg folder in beginners_tutorial AND the generated Num.h in catkin_ws/devel/inclute/beginners_tutorial and you can still publish Num messages ?

In ROS the messages includes files are created at build time, that is why these packages depends on message_generation (in CMakeLists.txt). The directive generate_messages takes care of that. The generated messages are stored in catkin_ws/devel/include/PACKAGE_NAME. As long as they're present in this directory you can include them and use them in your codes

If you removed only the Num.msg file, the Num.h generated during previous build is not deleted. As long as Num.h exists you can process Num messages.

Hope this helps


Originally posted by marguedas with karma: 3606 on 2015-04-22

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.