Need clarity on file structure of ROS project in ROS Basics in 5 Days?

There are 5 sections to implement.
In first section 3 tasks are given
-create a pkg
-build a publisher
-build a subscriber
my confusion should the publisher and subscriber be written is separate python file?If yes is there any key naming convention that needs to be followed to name the python file?

Hi @vasank1958,

It’s easier to have both publisher and subscriber in the same python file, especially if the publisher needs to take decisions based on feedback from the subscriber. A good example of this is the Topics Quiz, where the robot needs to react based on the distance from the wall, which is supplied by a subscriber taking data from the laser scan topic.

That said, you can put them in different files if you find it necessary and appropriate. You just need to correctly do the necessary imports from one file to another.