
Have a look at this: roslaunch if condition
when the destination is reached after the path is planned.
<arg name="path_planned" default="true"/>
Condition True
<group if="$(arg path_planned)">
<!-- stuff that will only be evaluated if path_planned is true -->
</group>
Condition False
<group unless="$(arg path_planned)">
<!-- stuff that will only be evaluated if path_planned is false -->
</group>
Now, path_planned = true when the destination is not reached and else it is false when the destination is reached.
Originally posted by Ranjit Kathiriya with karma: 1622 on 2021-09-06
This answer was NOT ACCEPTED on the original site
Post score: 2
Original comments
Comment by SuleKayiran on 2021-09-06:
Thanks for your help. I will try your suggestion. Also, I have another question. After reducing it to 150 degrees, I will need to increase the angle I reduced to 150 degrees to 180 degrees before my robot can move autonomously while planning the path again. Can I apply your suggestion for 180 degrees and write it in the startup file again? @Ranjit Kathiriya
Comment by Ranjit Kathiriya on 2021-09-06:
I am sorry! I couldn't get your question.
Comment by SuleKayiran on 2021-10-05:
I'm sorry for the late reply. It started to make more sense to deal with cpp files in my question, I applied your suggestions, they helped, but I realized that I needed to do something different, I realized that what I really wanted was not to deal with the launch file. Thank you for your help. @Ranjit Kathiriya