<div><div>Hi everybody, I have a question about frames , transforms and TF. I would like to extend the simples Turtle tf tutorials (<a href="http://www.ros.org/wiki/tf/Tutorials">http://www.ros.org/wiki/tf/Tutorials</a>) based on a 2D space but I'm having a lot of troubles doing it. Unfortunately I didn't find (yet) something on the mailing list or on ros-answers...</div>

<div>I have this 3 frames:</div></div><div><ul><li>world_frame</li><li>odom_frame (with a fixed transform respect to world)</li><li>cart_frame (I move this frame with the odometry data</li></ul><div>Here is the code:</div>

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

static tf::TransformBroadcaster br;<br>static tf::TransformListener tf_;<br></blockquote><div> </div><div>and this </div><div><br></div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

while (ros::ok()){</blockquote><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

<br>transform.setOrigin(tf::Vector3(3,3,0));<br>transform.setRotation(tf::createQuaternionFromRPY(0.0,0.0,0.0));<br>br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "/world", "/odom"));<br>

</blockquote></div><div><br></div><div>here, with updateOdom I calculate the x,y,theta position from the odometry (like the <a href="https://code.ros.org/svn/ros-pkg/branches/trunk_cturtle/stacks/ros_pkg_tutorials/turtle_tf/src/turtle_tf_broadcaster.cpp">tutorial</a>)</div>

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

updateOdom(1);</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

try</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

{</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

<span class="Apple-tab-span" style="white-space:pre"> </span>transform.setOrigin(tf::Vector3(x,y,0));</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

<span class="Apple-tab-span" style="white-space:pre"> </span>transform.setRotation(tf::createQuaternionFromRPY(0.0,0.0,th));</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

<span class="Apple-tab-span" style="white-space:pre"> </span>br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "/odom", "/cart_frame"));</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

}  catch(tf::TransformException e)</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

{<span class="Apple-tab-span" style="white-space:pre">        </span>ROS_WARN("errore transformpose (%s)", e.what()); }</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

 </blockquote><div><br></div><div>Now what I'm trying to do is move the cart_frame not only with the x+y+th params but with a full 6-dof transform, as if the the cart_frame was moving on a circular garage car ramp, and here starts my question: the simplest way is to add the information to the odometry, so I can call the sendtransform() directly, but what if I had a situation where the odometer always sends only 2D transforms? </div>

<div>In the example I tried to send a transform with a small pitch at the beginning of the while (ros ok())</div><div><br></div><div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

transform.setOrigin(tf::Vector3(3,3,0));<br>transform.setRotation(tf::createQuaternionFromRPY(0.0,0.4,0.0));<br>br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "/world", "/odom"));</blockquote>

</div><div><br></div><div>and this is the outcome <a href="http://www.youtube.com/watch?v=d4ktwwukCV0">http://www.youtube.com/watch?v=d4ktwwukCV0</a>, not properly what I want...</div><div><br></div><div>Ok, probably  I am very tired and confused today but if someone can tell me where I'm wrong I'll be infinitely grateful =)</div>

<div>Thank you </div><div><br></div><div>Augusto</div><meta http-equiv="content-type" content="text/html; charset=utf-8"></div>