12 #include <geometry_msgs/PoseStamped.h> 13 #include <geometry_msgs/Pose.h> 24 int main(
int argc,
char ** argv)
27 ros::init(argc, argv,
"robot_pose_publisher");
32 std::string map_frame, base_frame;
33 double publish_frequency;
37 nh_priv.
param<std::string>(
"map_frame",map_frame,
"/map");
38 nh_priv.
param<std::string>(
"base_frame",base_frame,
"/base_link");
39 nh_priv.
param<
double>(
"publish_frequency",publish_frequency,10);
40 nh_priv.
param<
bool>(
"is_stamped", is_stamped,
false);
43 p_pub = nh.
advertise<geometry_msgs::PoseStamped>(
"robot_pose", 1);
45 p_pub = nh.
advertise<geometry_msgs::Pose>(
"robot_pose", 1);
57 listener.lookupTransform(map_frame, base_frame,
ros::Time(0), transform);
60 geometry_msgs::PoseStamped pose_stamped;
61 pose_stamped.header.frame_id = map_frame;
64 pose_stamped.pose.orientation.x = transform.
getRotation().getX();
65 pose_stamped.pose.orientation.y = transform.
getRotation().getY();
66 pose_stamped.pose.orientation.z = transform.
getRotation().getZ();
74 p_pub.publish(pose_stamped);
76 p_pub.publish(pose_stamped.pose);
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
TFSIMD_FORCE_INLINE const tfScalar & getY() const
int main(int argc, char **argv)
TFSIMD_FORCE_INLINE const tfScalar & getW() const
TFSIMD_FORCE_INLINE const tfScalar & getZ() const
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
TFSIMD_FORCE_INLINE const tfScalar & getX() const