Allow zero pose_publish_period (#933)

To compare different SLAM software online, it is necessary to
disable tf broadcast.
Because we already have a parameter "pose_publish_period_sec",
we use a zero value here to turn off tf broadcast.
master
gaschler 2018-07-10 17:52:18 +02:00 committed by Wally B. Feed
parent 944b22575f
commit 427fbe6d2e
1 changed files with 5 additions and 3 deletions

View File

@ -131,9 +131,11 @@ Node::Node(
wall_timers_.push_back(node_handle_.createWallTimer( wall_timers_.push_back(node_handle_.createWallTimer(
::ros::WallDuration(node_options_.submap_publish_period_sec), ::ros::WallDuration(node_options_.submap_publish_period_sec),
&Node::PublishSubmapList, this)); &Node::PublishSubmapList, this));
if (node_options_.pose_publish_period_sec > 0) {
publish_local_trajectory_data_timer_ = node_handle_.createTimer( publish_local_trajectory_data_timer_ = node_handle_.createTimer(
::ros::Duration(node_options_.pose_publish_period_sec), ::ros::Duration(node_options_.pose_publish_period_sec),
&Node::PublishLocalTrajectoryData, this); &Node::PublishLocalTrajectoryData, this);
}
wall_timers_.push_back(node_handle_.createWallTimer( wall_timers_.push_back(node_handle_.createWallTimer(
::ros::WallDuration(node_options_.trajectory_publish_period_sec), ::ros::WallDuration(node_options_.trajectory_publish_period_sec),
&Node::PublishTrajectoryNodeList, this)); &Node::PublishTrajectoryNodeList, this));