Skip to content

Add publish_tf rosparam functionality and updated launch file accordingly #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jack-digilabs
Copy link
Contributor

-adds check on rosparam publish_tf when publishing rosparam pose
-updated fiducial_slam.launch to include publish_tf and tf_publish_interval

@jack-digilabs
Copy link
Contributor Author

This also addresses issue #148 . @elisabethwelburn this is the code you'll want.

@elisabethwelburn
Copy link

Hey thanks for doing this if only everyone on the internet was as helpful as you ! :-) I found a solution that also works for the original fiducial_slam code is to set the tf_publish_interval to 0 as well :)

@jack-digilabs
Copy link
Contributor Author

jack-digilabs commented Feb 19, 2019 via email

@elisabethwelburn
Copy link

Thats a good point but my understanding is that it doesn't register the new fidcials if you set it as a read only map so all fiducials are pre-defined within the global frame upon starting up the ROS node? If it's performing SLAM as well then sure it'll mess up your tfs

@rohbotics rohbotics self-requested a review February 24, 2019 05:49
Copy link
Member

@rohbotics rohbotics left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting the pull request, sorry it took so long for me to get to it.

I have some minor comments, once those are patched up I can merge this.

@@ -195,6 +195,7 @@ Map::Map(ros::NodeHandle &nh) : tfBuffer(ros::Duration(30.0)){
nh.param<std::string>("base_frame", baseFrame, "base_link");

nh.param<float>("tf_publish_interval", tfPublishInterval, 1.0);
nh.param<bool>("publish_tf", publishPoseTf, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please default to true.

publishTf();

if (publishPoseTf)
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Move the brace to the end of the previous line for if statements

@@ -511,7 +516,7 @@ void Map::publishTf()
void Map::update()
{
ros::Time now = ros::Time::now();
if (havePose && tfPublishInterval != 0.0 &&
if (publishPoseTf && havePose && tfPublishInterval != 0.0 &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the tf publish interval check redundant here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost but not exactly. The tfPublishInterval is used when you want fiducial_slam to re-publish the TF when a fiducial isn't detected. For example, you may want TF's to be published only when a fiducial is detected so you'd set publishPoseTf=True and tfPublishInterval=0.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohbotics Need anything else to keep the ball rolling?

Copy link
Member

@rohbotics rohbotics left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay on merging this.

@rohbotics rohbotics merged commit e0ea0a2 into UbiquityRobotics:kinetic-devel Mar 25, 2019
@rohbotics
Copy link
Member

Thanks for your contribution, I found the same bug again and remembered this PR. Sorry for the making you wait so long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants