utils.h
Go to the documentation of this file.
1 #ifndef __SLAM_FMWK_ROS_UTILS_H
2 #define __SLAM_FMWK_ROS_UTILS_H
3 
4 #include <string>
6 #include <ros/ros.h>
7 
14 inline void publish_2D_transform(const std::string &target_frame,
15  const std::string &base_frame,
16  double x, double y, double th) {
17 
18  tf::Vector3 translation(x, y, 0);
19  tf::Quaternion rotation;
20  rotation.setRPY(0, 0, th);
21 
22  tf::Transform tr(rotation, translation);
23  tf::StampedTransform st_trans(tr, ros::Time::now(), base_frame, target_frame);
24 
25  static tf::TransformBroadcaster br;
26  br.sendTransform(st_trans);
27 }
28 
29 #endif
void setRPY(const tfScalar &roll, const tfScalar &pitch, const tfScalar &yaw)
void publish_2D_transform(const std::string &target_frame, const std::string &base_frame, double x, double y, double th)
Converts internal a robot state to a 2D robot pose and publishes it.
Definition: utils.h:14
void sendTransform(const StampedTransform &transform)
static Time now()


tiny_slam
Author(s):
autogenerated on Mon Jun 10 2019 15:30:57