Created
May 7, 2012 06:19
-
-
Save PierrickKoch/2626230 to your computer and use it in GitHub Desktop.
Test ROS topic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| testresult=$(mktemp) | |
| roscore & | |
| rospid=$! | |
| sleep 5 # TODO find better way to wait roscore init (no flush stdout...) | |
| echo " | |
| ############################################################################### | |
| Start Testing | |
| ###############################################################################" | |
| rostopic echo -n1 /test > $testresult & | |
| rostopic pub -1 /test std_msgs/String "ProteusTestSucceed" | |
| kill $rospid | |
| wait $rospid | |
| if grep "ProteusTestSucceed" $testresult; then | |
| echo " | |
| ############################################################################### | |
| Test Passed OK | |
| ###############################################################################" | |
| else | |
| echo " | |
| ############################################################################### | |
| Test Failed | |
| ###############################################################################" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment