Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // AUTHOR : SHANKER KESHAVDAS , DFKI SAARBRUECKEN
- #ifndef TAROT_RobotControl_TFLaserPublisher_CPP_
- #define TAROT_RobotControl_TFLaserPublisher_CPP_
- #include <ros/ros.h>
- #include <tf/transform_broadcaster.h>
- #define LASERPOSITION_X 0.17
- #define LASERPOSITION_Y 0.0
- #define LASERPOSITION_Z 0.298
- // Publishes a static transform from frame /base_link to /laser. This denotes the position of the laser with respect to the center of the robot on the 2D map.
- int main(int argc, char **argv)
- {
- ros::init(argc, argv, "Tarot_TFLaserPublisher");
- static tf::TransformBroadcaster br;
- tf::Transform transform;
- transform.setOrigin( tf::Vector3(LASERPOSITION_X,LASERPOSITION_Y,LASERPOSITION_Z) );
- transform.setRotation( tf::Quaternion(0, 0, 0, 1) );
- ros::Rate r(10);
- while(ros::ok())
- {
- br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "base_link", "laser"));
- r.sleep();
- }
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement