ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Problems with Transform-Broadcaster on custom Bot

asked 2015-04-29 14:09:42 -0500

Twista3579 gravatar image

updated 2015-04-30 03:15:55 -0500

Hi Everyone,

i hope someone can answer me a question. I have a custom robot and i would like to use the Navigation-Stack of ROS. i follow this tutorial: ( http://wiki.ros.org/navigation ) The Problem is that anything is incorrect on my Transform-Boradcaster. The tf-tree is map-->odom-->base_link-->base_laser.

Here is my Transform-Broadcaster:

#include <ros/ros.h>
#include <tf/transform_broadcaster.h>

int main(int argc, char** argv){

ROS_INFO("starte tf_broadcaster!");
ros::init(argc, argv, "robot_tf_publisher");
ros::NodeHandle n;

ros::Rate r(100);

tf::TransformBroadcaster broadcaster;

while(n.ok()){
  broadcaster.sendTransform(
     tf::StampedTransform(
     tf::Transform(tf::Quaternion(0, 0, 0, 1), tf::Vector3(0.1, 0.0, 0.2)),
     ros::Time::now(),"base_link", "base_laser"));

     broadcaster.sendTransform(
     tf::StampedTransform(
     tf::Transform(tf::Quaternion(0, 0, 0, 0), tf::Vector3(0.0, 0.0, 0.0)),
     ros::Time::now(),"odom", "base_link"));

     broadcaster.sendTransform(
     tf::StampedTransform(
     tf::Transform(tf::Quaternion(0, 0, 0, 0), tf::Vector3(0.0, 0.0, 0.0)),
     ros::Time::now(),"map", "odom"));

  r.sleep();
 }
}

If i start the Ros-Navigation the last Message is "odom received". All is ok! So when i click on "2D Pose Estimate" the result is this: https://www.dropbox.com/s/n211hzuvjrr...

The Odom-Frame and the base_link/base_laser-Frame are on two different places. Why?

if i still click on the button "2D Nav Goal" the robot rotates in a circle and i get an Error:

"Rotate recovery can't´t rotate in place because there is a potential collision. cost -1.00"

Here is the log: https://www.dropbox.com/s/7d4fv3ad2h2...

I think the Problem is the Transform-Broadcaster. Can anybody help me?

Thanks

Max

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2015-04-30 04:06:22 -0500

bvbdort gravatar image

odom -> base_link transform should not be static as you are publishing . Check how to publish odom.

edit flag offensive delete link more

Comments

many thanks, this solve my problem. Navigation works ! :-D

Twista3579 gravatar image Twista3579  ( 2015-04-30 07:33:34 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-04-29 14:09:42 -0500

Seen: 373 times

Last updated: Apr 30 '15