[ros-users] Navigaation/tutorials/TF - error in Broadcasting.cpp

Eitan Marder-Eppstein eitan at willowgarage.com
Thu Mar 18 17:25:58 UTC 2010


I updated the tutorial with the corrected code. Thanks for catching this,
and even better, for providing the code.

Hope all is well,

Eitan

On Thu, Mar 18, 2010 at 7:51 AM, shashank sharma
<sonicboomshanky at gmail.com>wrote:

> http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/TF
>
> In the above page the "tf_braodcaster.cpp" file has an error as the
> sendTransform() function has unmatched arguments.
>
> here is the corrected code:
>
> #include <ros/ros.h>
> #include <tf/transform_broadcaster.h>
>
> int main(int argc, char** argv){
>   ros::init(argc, argv, "robot_tf_publisher");
>   ros::NodeHandle n;
>
>   ros::Rate r(100);
>
>   //corrected code
>   tf::Transform transform;
>   transform.setOrigin(tf::Vector3(0.1, 0.0, 0.2));
>   transform.setRotation(tf::Quaternion(0, 0, 0));
>
>
>
>   tf::TransformBroadcaster broadcaster;
>
>   while(n.ok()){
>     /*broadcaster.sendTransform(
>         btTransform(btQuaternion(0, 0, 0), btVector3(0.1, 0.0, 0.2)),
>         ros::Time::now(),
>         "base_laser", "base_link");
>     */
> broadcaster.sendTransform(tf::StampedTransform(transform, ros::Time::now(),
> "base_laser", "base_link"));
>  r.sleep();
>   }
> }
>
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100318/a7ad0ed4/attachment-0003.html>


More information about the ros-users mailing list