0
$\begingroup$

Rosanswers logo

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/n211hzuvjrr4rdj/Screenshot%202015-04-29%2016.21.35.png?dl=0

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/7d4fv3ad2h277at/%20log.png?dl=0

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

Thanks

Max


Originally posted by Twista3579 on ROS Answers with karma: 31 on 2015-04-29

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by bvbdort with karma: 3034 on 2015-04-30

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Twista3579 on 2015-04-30:
many thanks, this solve my problem. Navigation works ! :-D

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.