Main Page
Classes
Files
File List
File Members
src
ros
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>
5
#include <
tf/transform_broadcaster.h
>
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
tf::Quaternion
transform_broadcaster.h
tf::Quaternion::setRPY
void setRPY(const tfScalar &roll, const tfScalar &pitch, const tfScalar &yaw)
publish_2D_transform
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
tf::Transform
tf::TransformBroadcaster::sendTransform
void sendTransform(const StampedTransform &transform)
ros.h
ros::Time::now
static Time now()
tf::TransformBroadcaster
tf::StampedTransform
tf::Vector3
tiny_slam
Author(s):
autogenerated on Mon Jun 10 2019 15:30:57