This is a bit of an XY problem situation. You do not need to parse /rosout to get the status of the current goal. You can ask the move base instance what the status of the goal is. Move base API and actionlib python tutorial should get you most of the way to where you want to get.
Of course you you could (but should not) just subscribe to the /rosout
topic and filter the messages by the /rosout/name
and look for "goal reached" in /rosout/msg
. If you do for what ever reason want to proceed with parsing the output use /rosout_agg
instead of plain /rosout
. /rosout_agg
is published by the rosout node, subscribing directly to /rosout
would connect your node to all of the nodes that publish to /rosout, which would be basically all of the running nodes.
If having it in "separate Python script" is somehow preventing you from doing this then you would need to elaborate on what you mean by "separate Python script" and why you want to use said script instead of having it in a ros package.
Originally posted by Reamees with karma: 591 on 2020-06-03
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by anonymous55390 on 2020-06-03:
Thanks for your fast and useful response! I will definitely use the move base API instead of /rosout, that is indeed a better option. This will certainly help me achieve my goal :)
I'm not sure if my Python script has to be seperate (by which I mean that it is not a ROS package, but it is a .py file in my home folder that I execute through a terminal), but that's the way I set it up initially. But with your solution, the Python script can remain seperate, so thanks a lot! :)
Comment by anonymous55390 on 2020-06-03:
Just as an update:
I've been able to use rospy and MoveBaseActionResult from move_base_msgs.msg to "read" whether the robot has reached its destination. This all works within my Python script now. So thanks again for your information!