-
Notifications
You must be signed in to change notification settings - Fork 201
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
Re-implemented setName for tools #989
Conversation
In the migration towards RViz2 dynamically setting a tool name seems to got dropped. This commit adds this feature again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahcorde should be fixed now. |
@fmauch, can you share a gif or explain how this feature work? |
Sorry for being so brief, I was assuming that this got kicked out when migrating to RViz2 so I didn't add much explanation. Reading back, it might be that the changes were added to RViz1 in December 2020 after RViz2 was forked out. Basically, this goes back to this issue and this PR for ROS1 RViz. Reasoning for the changes is well explained in ros-visualization/rviz#1570 (comment). TLDR: calls to I've created a custom tool with a Basically, our initialization looks as follows: void NavGoalTool::onInitialize()
{
PoseTool::onInitialize();
setName(m_name_ptr->getString());
// ... more unrelated stuff here...
} where m_name_ptr.reset(new rviz_common::properties::StringProperty(
"Name", "2D Nav Goal", "The display name", getPropertyContainer(), SLOT(updateName()), this)); The void NavGoalTool::updateName()
{
setName(m_name_ptr->getString());
} The docs of With the changes from this PR applied, the same screenshot with an RViz2 started from the same config looks like this: With this modification we can at least copy the tools inside the config file and rename them so we get a goal tool for each robot: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed explanation @fmauch . In short, this looks good to me, so I'll run CI on it next.
Thank you for merging. Is there any chance this could get backported to Humble? |
https://github.com/Mergifyio backport iron humble |
✅ Backports have been created
|
In the migration towards RViz2 dynamically setting a tool name seems to got dropped. This commit adds this feature again. (cherry picked from commit 2052e48)
In the migration towards RViz2 dynamically setting a tool name seems to got dropped. This commit adds this feature again. (cherry picked from commit 2052e48)
Re-implemented setName for tools (backport #989)
In the migration towards RViz2 dynamically setting a tool name seems to got dropped. This PR adds this feature again.
We use one central RViz instance in a multi-mobile-robot application where we have a NavGoal tool for each robot. Not being able to rename the tools is a bit hard to use as you'll have to memorize the actual order.
I don't know whether there is a specific reason why this got dropped, but I think this is valid and useful to keep.
As we currently use ROS 2 Humble, I think this should also be backported to Humble. I can open a second PR if desired.