How to run certain launch files within nodes?
I am working on an autonomous which requires different modes in which the robot will be running at. One such mode is a SLAM mode, but I feel that running SLAM for the whole time that the robot is running would be extremely inefficient. Is it possible to run SLAM only when a certain condition is met? Would this condition go in the .launch file or in some node? (for example, when a certain distance is travelled by the robot).
I am writing in python.