Structure of ROS python program
Hi! I want to write some ros scripts in python language. My question is about structure of program.
Where is place to initiate variables, where is place for topics or other rospy objects and how to write an infinite loop with access to all variables and objets. For example like in Arduino program, where are setup() and loop() functions. Whats the difference between if __name__=='__manin__'
and while not rospy.is_shutdown()
Can u give me something like a template? Im making a lot of mess in my programs and cant understand exact way of program working without this knowledge
How would you write a non-ROS Python program? It probably won't be much different than that
We would really recommend working through some python programming tutorials and becoming familiar with that language before attempting to work with ROS. It is not an easy place to start and we discourage people from using it as a way to learn programming.
Once you're comfortable with python you can then work through the first ROS tutorials which should all make sense to you by then.