Skip to content
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

Rolling namespace in title #1074

Merged
merged 21 commits into from Nov 9, 2023

Conversation

maxbader
Copy link
Contributor

@maxbader maxbader commented Oct 9, 2023

Hi

I like to request a merge, with the proposed changes RVIZ shows the currently used namespace in the title. This comes very handy when using multiple robots with namespaces.
See #1073

@maxbader maxbader requested a review from ahcorde as a code owner October 9, 2023 18:59
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

@maxbader
Copy link
Contributor Author

Sorry, I fixed the linters error

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

Can you please remove all of the unrelated changes? It makes it hard to review what is actually changed here.

@maxbader
Copy link
Contributor Author

Sorry, I used the ament_clang_format --reformat and ament_uncrustify --reformat on the files I changed.

@clalancette
Copy link
Contributor

Sorry, I used the ament_clang_format --reformat and ament_uncrustify --reformat on the files I changed.

Hm, it is interesting that those made all the changes they did, since we already run them (without --reformat) on every pull request. But it's a mystery for another time.

@maxbader
Copy link
Contributor Author

I also put some efforts to get it working for humble. It would be nice to merge that pull #1073 request as well.
(it was some effort because humble rviz is not using C++17 and I had to use QString ....)

Comment on lines 759 to 764
/// Adding a namespace prefix on the window frame title
std::string node_namespace;
node_namespace = rviz_ros_node_.lock()->get_raw_node()->get_namespace();
if (node_namespace.compare("/") != 0) {
title = node_namespace + " - " + title;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should add this by default. I think that the title is already too long. Let's remove this for now, since the rest of the PR already adds in the ability for the user to set it to what they want.

rviz_common/src/rviz_common/visualization_frame.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

This is getting closer! A few more changes that I think will clean this up.

rviz_common/include/rviz_common/visualization_frame.hpp Outdated Show resolved Hide resolved
rviz_common/src/rviz_common/visualization_frame.cpp Outdated Show resolved Hide resolved
rviz_common/src/rviz_common/visualization_frame.cpp Outdated Show resolved Hide resolved
rviz_common/src/rviz_common/visualization_frame.cpp Outdated Show resolved Hide resolved
maxbader and others added 4 commits November 5, 2023 09:36
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Markus Bader <markus.bader@tirol.com>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

One more minor thing to fix, then we can run CI on this.

rviz_common/include/rviz_common/visualization_frame.hpp Outdated Show resolved Hide resolved
Copy link
Contributor Author

@maxbader maxbader left a comment

Choose a reason for hiding this comment

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

Missing " added

@clalancette
Copy link
Contributor

Missing " added

Hm, I don't see it for some reason? Did you maybe forget to push?

@maxbader
Copy link
Contributor Author

maxbader commented Nov 6, 2023

Missing " added

Hm, I don't see it for some reason? Did you maybe forget to push?

Yes, sorry

Copy link
Contributor

@clalancette clalancette 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 all of the iteration here! I'll run full CI on this next to see where it is.

@clalancette
Copy link
Contributor

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@clalancette
Copy link
Contributor

So it looks like Windows is unhappy with this change:

01:48:52.854 C:\ci\ws\src\ros2\rviz\rviz_common\src\rviz_common\visualization_frame.cpp(773,81): error C2664: 'void rviz_common::VisualizationFrame::setDisplayConfigFile::<lambda_1cd49f53e1d41e008ea030c2db9d75cb>::operator ()(std::string &,const std::string &,const std::string &) const': cannot convert argument 3 from 'std::filesystem::path' to 'const std::string &' [C:\ci\ws\build\rviz_common\rviz_common.vcxproj]

01:48:52.854 C:\ci\ws\src\ros2\rviz\rviz_common\src\rviz_common\visualization_frame.cpp(773,81): message : Reason: cannot convert from 'std::filesystem::path' to 'const std::string' [C:\ci\ws\build\rviz_common\rviz_common.vcxproj]

@maxbader
Copy link
Contributor Author

maxbader commented Nov 7, 2023

Sorry, I am not working with Windows. But I think I have a solution. It seems that the convention of path to string works with under Linux but not under Windows. I just added now c_str() to the path arguments, this is the suggested way.

@clalancette
Copy link
Contributor

Sorry, I am not working with Windows. But I think I have a solution. It seems that the convention of path to string works with under Linux but not under Windows. I just added now c_str() to the path arguments, this is the suggested way.

Sounds good, thanks. I'll run CI on it again.

  • Windows Build Status

Copy link
Contributor Author

@maxbader maxbader left a comment

Choose a reason for hiding this comment

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

Hi, I hope that was the issue, I do not have any Windows machine around for testing.

Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Markus Bader <markus.bader@tirol.com>
@clalancette
Copy link
Contributor

Here's another try on Windows:

  • Windows Build Status

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

I think if you apply the latest changes, it will now work. At least, I verified locally that it compiles on Windows for me. I also noticed that "relative_path" isn't what we want; we actually want "parent_path". With these things fixed, we can give CI another go.

rviz_common/src/rviz_common/visualization_frame.cpp Outdated Show resolved Hide resolved
rviz_common/src/rviz_common/visualization_frame.cpp Outdated Show resolved Hide resolved
maxbader and others added 2 commits November 9, 2023 11:36
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Markus Bader <markus.bader@tirol.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Markus Bader <markus.bader@tirol.com>
@clalancette
Copy link
Contributor

Here's another go at CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@clalancette clalancette merged commit ea2dbb3 into ros2:rolling Nov 9, 2023
2 checks passed
@maxbader maxbader deleted the rolling_namespace_in_title branch November 10, 2023 12:23
@ahcorde
Copy link
Contributor

ahcorde commented Nov 24, 2023

https://github.com/Mergifyio backport humble iron

Copy link

mergify bot commented Nov 24, 2023

backport humble iron

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Nov 24, 2023
* Update visualization_frame.cpp

* window title format option added

Signed-off-by: Markus Bader <markus.bader@tirol.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
(cherry picked from commit ea2dbb3)

# Conflicts:
#	rviz_common/src/rviz_common/visualizer_app.cpp
mergify bot pushed a commit that referenced this pull request Nov 24, 2023
* Update visualization_frame.cpp

* window title format option added

Signed-off-by: Markus Bader <markus.bader@tirol.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
(cherry picked from commit ea2dbb3)

# Conflicts:
#	rviz_common/src/rviz_common/visualizer_app.cpp
ahcorde added a commit that referenced this pull request Nov 27, 2023
* Rolling namespace in title (#1074)

Signed-off-by: Markus Bader <markus.bader@tirol.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
(cherry picked from commit ea2dbb3)
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
ahcorde added a commit that referenced this pull request Nov 27, 2023
* Rolling namespace in title (#1074)

Signed-off-by: Markus Bader <markus.bader@tirol.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
(cherry picked from commit ea2dbb3)
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
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.

None yet

3 participants