Indeed you're right.  There is a mistake in which variable is used for initial orientation.  The fix is checked in r30363, I'll make a release tomorrow.<br><br>Thanks,<br>John<br><br><div class="gmail_quote">On Mon, Jun 21, 2010 at 3:59 AM, Leonardo Scandolo <span dir="ltr"><<a href="mailto:lscandolo@gmail.com">lscandolo@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Sorry, I seem to have messed things up a little, actually the error does not present itself with set_model_state, but with spawn_gazebo_model. The behavior I'm getting is this:<div>

<br></div><div>I call gazebo/spawn_gazebo_model with orientation x: 0 y: 0 z: 0.70709 w: 0.707123 (obtained from tf::createQuaternionMsgFromYaw(3.1415 / 2.0) to make sure)</div>
<div><br></div><div>This spawns the object in gazebo, but with the wrong orientation, since afterwards I get</div><div><br></div><div><div>$rosservice call gazebo/get_model_state '{model_name: person, relative_entity_name: map}'</div>


<div>pose: </div><div>  position: </div><div>    x: -0.00155193534221</div><div>    y: 0.000118788809867</div><div>    z: 0.0239993194685</div><div>  orientation: </div><div>    x: -1.93747979438e-07</div><div>    y: -4.43560139729e-07</div>


<div>    z: 0.0141537562013</div><div>    w: 0.999899804592</div><div>twist: </div><div>  linear: </div><div>    x: -0.000347819470335</div><div>    y: 0.000233947168454</div><div>    z: -0.000113238493213</div><div>  angular: </div>


<div>    x: -0.000709853426088</div><div>    y: -0.00107237440534</div><div>    z: -3.73239927285e-05</div></div><div><br></div><div>This is the orientation for a (PI / 2) degrees yaw rotation, which is what shows on the gazebo gui : rpy: 0 0 1.57.</div>


<div><br></div><div>Hope this helps to clarify things a little bit.</div><div><br></div><font color="#888888"><div>Leonardo</div></font><div><div></div><div class="h5"><div><br></div><div><br><div class="gmail_quote">On Fri, Jun 18, 2010 at 9:02 PM, John Hsu <span dir="ltr"><<a href="mailto:johnhsu@willowgarage.com" target="_blank">johnhsu@willowgarage.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Leonardo,<br><br>I've just tried the following,<br><br><br><ul><li>roslaunch gazebo_worlds  empty_world.launch</li>


<li>rosrun gazebo spawn_model -file `rospack find gazebo_worlds`/objects/000.580.67.model -gazebo -model cup -z 2</li>

<li>rosservice call gazebo/get_model_state '{model_name: cup}'<br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">rosservice call gazebo/get_model_state '{model_name: cup}'<br>




pose: <br>  position: <br>    x: 0.0<br>    y: 0.0<br>    z: 1.99999995232<br>  orientation: <br>    x: 0.0<br>    y: 0.0<br>    z: 0.0<br>    w: 1.0<br>twist: <br>  linear: <br>    x: 0.0<br>    y: 0.0<br>    z: 0.0<br>



  angular: <br>
    x: 0.0<br>    y: 0.0<br>    z: 0.0<br>success: True<br>status_message: GetModelState: got properties<br></blockquote></li><li>rosservice call /gazebo/set_model_state '{model_state: { model_name: cup, pose: { position: { x: 0, y: 0 ,z: 1 }, orientation: {x: 0, y: 0.7071, z: 0, w: 0.7071} }, reference_frame: world } }'<br>




<blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">success: True </blockquote><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">




status_message: SetModelState: set model state done<br></blockquote></li><li><div> rosservice call gazebo/get_model_state '{model_name: cup}'<br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">




pose: <br>  position: <br>    x: 7.45058056917e-10<br>    y: 0.0<br>    z: 1.0<br>  orientation: <br>    x: 0.0<br>    y: 0.70710682869<br>    z: 0.0<br>    w: 0.70710682869<br>twist: <br>  linear: <br>    x: 0.0<br>    y: 0.0<br>




    z: 0.0<br>  angular: <br>    x: 0.0<br>    y: 0.0<br>    z: 0.0<br>success: True<br>status_message: GetModelState: got properties<br></blockquote></div></li></ul>the model state seems to be as expected, not sure if I have the right steps you are referring to in order to recreate the error?<br>




thanks,<br><font color="#888888">John<br><br><br></font><div class="gmail_quote"><div><div></div><div>On Fri, Jun 18, 2010 at 6:10 AM, Leonardo Scandolo <span dir="ltr"><<a href="mailto:lscandolo@gmail.com" target="_blank">lscandolo@gmail.com</a>></span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div>

Hello, I've been trying out the new CTurtle Gazebo API and I've seem to stumbled into a bug, but since I'm not really sure about it maybe you can clarify the behavior I'm seeing before creating a ticket.<div>





<br></div><div>The problem is this: when using the gazebo/set_model_state service, apparently the orientation quaternion appears to be translated to roll pitch and yaw and handed to gazebo, but the problem is that the rpy values handed are in radians and gazebo seems to work with degrees.</div>





<div>Even if I input the orientation quaternion obtained from gazebo/get_model_state back in through gazebo/set_model_state, it will produce the same error (the quat obtained from get_model_state seems to be correct). For example if the rpy in the gazebo gui for a model is '90 0 0', I will get orientation quat '0.707114 0 0 0.7071' from get_model_state, send it back in through set_model_state and it will come up as rpy '0.78 0 0' in gazebo, which is the correct rpy, only that now it is in radians. Am I missing something here ?</div>





<div><br></div><font color="#888888"><div>Leonardo Scandolo</div><div><br></div>
</font><br></div></div><div>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org" target="_blank">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br></div></blockquote></div><br>
<br>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org" target="_blank">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br></blockquote></div><br>