Updated the coordinate system in /spawn service for consistency
Hi! I try to call the spawn service but the turtles appear in different positions from the ones entered. How can I do to solve this problem?thanks
Update:
my launch file is this
<?xml version= "1.0"?>
<launch>
<!-- definisce un parametro nTurtle di valore 3-->
<param name="nTurtle" value="3" />//parametro comune???
<!-- avvia il simulatore turtlesim con una tartaruga di default-->
<node pkg="turtlesim" type="turtlesim_node" name="simulator" />
<!--si va ad avviare quella che sarĂ la nostra prima tartaruga-->
<node pkg="consensus" type="consensus_node" args="myturtle1 3 3 1" name="turtlenode1" launch-prefix="xterm -geometry 120x31+10+10 -e "/>
<!-- si richiama un nodo che va ad uccidere la tartaruga di default -->
<node pkg="consensus" type="kill_turtle" name="kill_turtle" />
<!-- le altre nostre due tartarughe-->
<node pkg="consensus" type="consensus_node" args="myturtle2 9 8 1" name="turtlenode2" launch-prefix="xterm -geometry 120x31+210+110 -e "/>
<node pkg="consensus" type="consensus_node" args="myturtle3 3 8 1" name="turtlenode3" launch-prefix="xterm -geometry 120x31+410+210 -e "/>
</launch>
but one of them is spawned at 9 3 instead of 9 8
Comments from deleted answer
- Q. And are the other two turtles correctly spawned ? A. yes..I think that there is a rotation
- Q. Ans have you try launching all the nodes separately ? A. no I haven't
What do you mean by
different positions from the one entered
? What nodes are you lauching ? Maybe you are using a map that have an offset on the origin coordinates (you can check it withrostopic echo /map
) and substract those coordinates to the ones you find to retrieve the ones entered.