Skip to content

Commit 0be113c

Browse files
committed
Merge branch 'develop' into kinetic-devel
2 parents fe1dd0a + a4fdb69 commit 0be113c

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

fiducial_slam/include/fiducial_slam/map.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ class Map {
211211

212212
bool havePose;
213213
float tfPublishInterval;
214+
bool publishPoseTf;
214215
ros::Time tfPublishTime;
215216
geometry_msgs::TransformStamped poseTf;
216217

fiducial_slam/launch/fiducial_slam.launch

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<arg name="odom_frame" default="odom"/>
88
<arg name="base_frame" default="base_link"/>
99
<arg name="publish_tf" default="true"/>
10+
<arg name="tf_publish_interval" default="0.2"/>
1011
<arg name="future_date_transforms" default="0.0"/>
1112
<arg name="publish_6dof_pose" default="false"/>
1213
<arg name="fiducial_len" default="0.14"/>
@@ -19,6 +20,8 @@
1920
<param name="map_frame" value="$(arg map_frame)" />
2021
<param name="odom_frame" value="$(arg odom_frame)" />
2122
<param name="base_frame" value="$(arg base_frame)" />
23+
<param name="publish_tf" value="$(arg publish_tf)" />
24+
<param name="tf_publish_interval" value="$(arg tf_publish_interval)" />
2225
<param name="future_date_transforms" value="$(arg future_date_transforms)" />
2326
<param name="publish_6dof_pose" value="$(arg publish_6dof_pose)" />
2427
<param name="do_pose_estimation" value="$(arg do_pose_estimation)"/>

fiducial_slam/src/map.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ Map::Map(ros::NodeHandle &nh) : tfBuffer(ros::Duration(30.0)){
195195
nh.param<std::string>("base_frame", baseFrame, "base_link");
196196

197197
nh.param<float>("tf_publish_interval", tfPublishInterval, 1.0);
198+
nh.param<bool>("publish_tf", publishPoseTf, false);
198199
nh.param<float>("systematic_error", systematic_error, 0.01f);
199200
nh.param<double>("future_date_transforms", future_date_transforms, 0.1);
200201
nh.param<bool>("publish_6dof_pose", publish_6dof_pose, false);
@@ -491,7 +492,11 @@ int Map::updatePose(vector<Observation>& obs, const ros::Time &time,
491492
poseTf = toMsg(outPose);
492493
poseTf.child_frame_id = outFrame;
493494
havePose = true;
494-
publishTf();
495+
496+
if (publishPoseTf)
497+
{
498+
publishTf();
499+
}
495500

496501
ROS_INFO("Finished frame\n");
497502
return numEsts;
@@ -511,7 +516,7 @@ void Map::publishTf()
511516
void Map::update()
512517
{
513518
ros::Time now = ros::Time::now();
514-
if (havePose && tfPublishInterval != 0.0 &&
519+
if (publishPoseTf && havePose && tfPublishInterval != 0.0 &&
515520
(now - tfPublishTime).toSec() > tfPublishInterval) {
516521
publishTf();
517522
tfPublishTime = now;

0 commit comments

Comments
 (0)