Closed bilal9876 closed 3 years ago
Hi, Please remove all "\n" in plan graph Then it will work Thank you
Hello both,
This is to do with how the topic is subscribed to. When using rostopic echo, use the argument "-p" for pretty-print. This will format correctly to your screen/file and you'll not have an issue with DOT.
Michael
Gerard has a script for generating PDF, which uses this line:
rostopic echo /rosplan_plan_dispatcher/plan_graph -n 1 -p | sed "N;s/.*digraph/digraph/g" | dot -Tpdf > $OUTPUT
Here's the fulle script (which we can add to the repo)
#!/bin/bash
# Usage: ./show_plan.sh <path_to_plan>.pdf
# i.e. ./show_plan.sh /tmp/my_plan.pdf
OUTPUT="/tmp/plan.pdf"
if [ ! -z "$1" ]; then
OUTPUT=$1
fi
rostopic echo /rosplan_plan_dispatcher/plan_graph -n 1 -p | sed "N;s/.*digraph/digraph/g" | dot -Tpdf > $OUTPUT
xdg-open $OUTPUT &
echo "Esterel plan has been printed in $OUTPUT"
Just added the script in a PR (#283)
I generated the plan.dot from the terminal by executing: " rostopic echo /rosplan_plan_dispatcher/plan_graph"
I copied the data from the terminal and i removed the "data:" keyword from the plan
when i tried to convert the plan into pdf by using: dot -Tpdf plan.dot > plan.pdf
" Error: plan.dot: syntax error in line 103 near "
i don't know what is the problem, really i try to modify the generated plan several times, but no solution.
the output data is not correct.
rostopic echo /rosplan_plan_dispatcher/plan_graph data: "digraph plan {\n0[ label="plan_start",style=filled,fillcolor=black,fontcolor=white];\n 1[ label="undock_start\n(kenny,wp0)"];\n2[ label="undock_end\n(kenny,wp0)"];\n 3[ label="localise_start\n(kenny)"];\n4[ label="localise_end\n(kenny)"];\n5[ \ label="goto_waypoint_start\n(kenny,wp0,wp0)"];\n6[ label="goto_waypoint_end\n (kenny,wp0,wp0)"];\n7[ label="goto_waypoint_start\n(kenny,wp0,wp1)"];\n8[ label=" goto_waypoint_end\n(kenny,wp0,wp1)"];\n9[ label="goto_waypoint_start\n(kenny,wp1,wp0)"\