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

Revision history [back]

click to hide/show revision 1
initial version

ROS provides the laser_geometry package to do just this. Give that a shot. It will make your life much easier.

ROS provides the laser_geometry package to do just this. Give that a shot. It will make your life much easier.

Edit: Here's some code to publish your odom information. You would publish this at a certain interval in your odometry node, and laser_geometry would be able to read it.

static tf::TransformBroadcaster tfb;
tf::Transform xform;
xform.setOrigin(tf::Vector3(pose3D.position.x, pose3D.position.y, pose3D.position.z));
xform.setRotation(pose3D.orientation);
tfb.sendTransform(tf::StampedTransform(xform, ros::Time::now(), "base_frame", "target_frame"));

For more information, check the tf tutorials.

ROS provides the laser_geometry package to do just this. Give that a shot. It will make your life much easier.

Edit: Here's some code to publish your odom information. You would publish this at a certain interval in your odometry node, and laser_geometry would be able to read it.

static tf::TransformBroadcaster tfb;
tf::Transform xform;
xform.setOrigin(tf::Vector3(pose3D.position.x, pose3D.position.y, pose3D.position.z));
xform.setRotation(pose3D.orientation);
tf::Quaternion qt = pose3D.orientation;
xform.setRotation(qt);
tfb.sendTransform(tf::StampedTransform(xform, ros::Time::now(), "base_frame", "target_frame"));

For more information, check the tf tutorials.

ROS provides the laser_geometry package to do just this. Give that a shot. It will make your life much easier.

Edit: Here's some code to publish your odom information. You would publish this at a certain interval in your odometry node, and laser_geometry would be able to read it.

static tf::TransformBroadcaster tfb;
tf::Transform xform;
xform.setOrigin(tf::Vector3(pose3D.position.x, pose3D.position.y, pose3D.position.z));
tf::Quaternion qt = pose3D.orientation;
qt(pose3D.orientation.x, pose3D.orientation.y, pose3D.orientation.z, pose3D.orientation.w);
xform.setRotation(qt);
tfb.sendTransform(tf::StampedTransform(xform, ros::Time::now(), "base_frame", "target_frame"));

For more information, check the tf tutorials.