dummy_slam_broadcaster.cpp
Go to the documentation of this file.
2 
3 //-------------------------------------------------------------------------------------------------
5 {
6  map_publisher_ = node_handle_.advertise<nav_msgs::OccupancyGrid>("/map",1);
8 
9  node_handle_.param("broadcast_zero_pose_enabled",broadcast_zero_pose_enabled_,1);
11  {
12  pose_publisher_ = node_handle_.advertise<geometry_msgs::PoseStamped>("/slam_out_pose",10);
14  }
15 }
16 
17 //-------------------------------------------------------------------------------------------------
19 {
20  empty_map_.header.stamp = ros::Time::now();
22 }
23 
24 //-------------------------------------------------------------------------------------------------
26 {
27  tf::Transform t;
28  t.setOrigin( tf::Vector3(0,0,0) );
29  t.setRotation(tf::Quaternion( 0,0,0,1 ));
31 
32  geometry_msgs::PoseStamped pose;
33  pose.pose.position.x = 0;
34  pose.pose.position.y = 0;
35  pose.pose.position.z = 0;
36 
37  pose.pose.orientation.w = 0;
38  pose.pose.orientation.x = 0;
39  pose.pose.orientation.y = 0;
40  pose.pose.orientation.z = 0;
41 
42  pose.header.frame_id = "/map";
43  pose.header.stamp = ros::Time::now();
44 
46 }
47 
48 //-------------------------------------------------------------------------------------------------
50 {
51  const std::size_t mapSize = 2500;
52  empty_map_.header.frame_id = "/map";
53  empty_map_.info.resolution = 0.04;
54  empty_map_.info.width = mapSize;
55  empty_map_.info.height = mapSize;
56  empty_map_.info.origin.position.x = -50;
57  empty_map_.info.origin.position.y = -50;
58  empty_map_.info.origin.position.z = 0;
59 
60  empty_map_.info.origin.orientation.x = 0;
61  empty_map_.info.origin.orientation.y = 0;
62  empty_map_.info.origin.orientation.z = 0;
63  empty_map_.info.origin.orientation.w = 1;
64 
65  empty_map_.data.resize(mapSize*mapSize,-1);
66 }
67 
68 //-------------------------------------------------------------------------------------------------
69 int main(int argc, char **argv)
70 {
71  ros::init(argc, argv, "dummy_slam_broadcaster");
73  ros::spin();
74  return 0;
75 }
TFSIMD_FORCE_INLINE void setRotation(const Quaternion &q)
void publish(const boost::shared_ptr< M > &message) const
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ROSCPP_DECL void spin(Spinner &spinner)
int main(int argc, char **argv)
bool param(const std::string &param_name, T &param_val, const T &default_val) const
void sendTransform(const StampedTransform &transform)
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void broadcastPose(const ros::TimerEvent &e)
tf::TransformBroadcaster tf_pose_broadcaster_
static Time now()
nav_msgs::OccupancyGrid empty_map_
void broadcastMap(const ros::TimerEvent &e)
TFSIMD_FORCE_INLINE void setOrigin(const Vector3 &origin)


dummy_slam_broadcaster
Author(s):
autogenerated on Mon Jun 10 2019 14:12:46