Ask Your Question
1

transform broadcaster for multiple senors

asked 2013-07-08 00:42:28 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello all,

I'm a new user to ros navigation stack. I've a kurt2 robot to work on with 6 super sonic sensors and 8 infrared sensors on it. I'd as per the tutorial in navigation if I've 1 sensor the code as per the tutorial.

int main(int argc, char** argv){
  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"));
    r.sleep();
  }
}

How about my case with 6 Sonar n 8 IR sensors? Please let me know

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-07-08 10:13:26 -0500

David Lu gravatar image

The best solution would be to use a urdf and the robot state publisher

Watch me ramble on the subject here

edit flag offensive delete link more

Comments

Oooh! I like this =) (I'm leaving my answer as it has a lower threshold to get working, but this is far superior)

lindzey gravatar image lindzey  ( 2013-07-08 11:16:02 -0500 )edit
0

answered 2013-07-08 07:20:53 -0500

lindzey gravatar image

If I understand your question correctly, you need to broadcast the transforms from /base_link to each sensor, and these transforms will not be changing over time. In this case, you don't even need to write a ROS node - just give each sensor a unique name, and use the static transform publisher.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-07-08 00:42:28 -0500

Seen: 890 times

Last updated: Jul 08 '13