-
Notifications
You must be signed in to change notification settings - Fork 212
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
usage for rviz_common::VisualizationManager function #664
Comments
@JaehyunShim I took a look for similar code in rviz and found this: https://github.com/ros2/rviz/blob/ros2/rviz_common/src/rviz_common/visualization_frame.cpp#L325-L350 I suggest that you review that code for differences. Otherwise, you can submit a test case that can be used to reproduce the issue. |
@mjeronimo Thank you for your comment. I copypasted the code in this guy's comment and tested it but it didn't work. The program dies when running the function (setEnable) I mentioned in this comment. If visualization_manager is going to be added to Rviz2 for the next distro anyway (as you can see it here) and there are already use cases of the feature (to be migrated to ROS2) out there, I think verifying that it works without issues this time is not a bad idea. Thank you for your help in advance! |
@mjeronimo ping |
@JaehyunShim I've used the code as a starting point and have reproduced the failure (I'm getting a double free error). I need some time to debug to see if I can get to the root cause. Output should be a running example. |
@mjeronimo Thanks! I will wait for your next comment then |
@mjeronimo Kind reminder~. Also, I would like to ask if your team can reconsider blooming in foxy the latest version of this repository which is with the visualization_frame.hpp and visualization_manager.hpp files. It takes quite a lot of time to compile the entire rviz every build. I believe the Moveit working group will also need it for their setup assistant. If you release it in the next distro, we have to wait for not only rviz, but also other dependencies, and considering G distro is not an LTS version, I am worried many distributors might even skip the non-LTS version. |
@JaehyunShim Here's the code I've been working on: https://github.com/mjeronimo/rviz_embed_test. I haven't been able to get it working yet and could use some help debugging what's going on. Regarding releasing the latest code for Foxy: we should be able to do that. @jacobperron any issues with this? |
Hey @JaehyunShim @mjeronimo , |
@MartiBolet Awesome! I will test it and let you know if it works now. It will be even more helpful if you send a pull request to https://github.com/ros-visualization/visualization_tutorials/tree/ros2/librviz_tutorial from your repo, then other users in the community can also see and use your code. |
OK, so I read your code and it seems what you did is
but my question here is about how to make a frame after initializing and using a manager & renderpanel. |
Hey @JaehyunShim , |
@MartiBolet Yeah, I will wait for help from @mjeronimo a bit more. Thanks very much though! |
@MartiBolet Thanks for letting us know about your work! I'll have a look at the repo you've provided. |
I'm assuming we're talking about code on the |
@jacobperron We are not talking about backporting but git pulling from the ros2 branch to the foxy branch and releasing it so users can use the newly added features in the foxy distro as well. Of course, API compatibility should be considered in this case as well though. |
@MartiBolet @JaehyunShim I did some more digging and found that the code was crashing in Ogre here:
It was crashing because the XQueryTree call failed with a BadWindow return value. The code doesn't check for an error code from XQueryTree and then attempts to free 'children', which is an uninitialized local variable that holds a random value. However, this was just a clue and didn't provide the root cause for the mWindow value resulting in a BadWindow error. I had another look at the VisualizationFrame code in rviz that the myviz code is emulating. In the initialize() method there are several calls to app->processEvents: https://github.com/ros2/rviz/blob/ros2/rviz_common/src/rviz_common/visualization_frame.cpp#L246-#L375 I included some of those calls and the code now works. I believe the reason is that processing the message allows the window(s) to be properly initialized. Once initialized in this way, there is no BadWindow error. I've updated the code here: https://github.com/mjeronimo/rviz_embed_test. I've borrowed some from @MartiBolet's code (thanks again for the help). Hopefully this is a good enough starting point for what you need to do. I've tried it with Rolling, but haven't tried with Foxy yet. Perhaps you could give it a try. |
@mjeronimo Thanks a lot. One more thing, the code is actually from https://github.com/ros-visualization/visualization_tutorials/tree/ros2/librviz_tutorial. If you send a pull request to this repository, it will be reviewed & maintained & updated by the community. I will test the code, see how different your code is from the one from ROS1 and add another comment later on. |
Thank you @mjeronimo, |
That's because he didn't add ViewController. Actually, I was thinking, using a pre-made frame is not a bad idea for such reasons. Users can take that easy option if he only adds the function with a RenderPanel type return to the VisualizationFrame class as you did. (Update)
|
Hi @mjeronimo I would like to ask how it is going with the conversation you had with @jacobperron about the release of the latest rviz_common source code for Foxy? 😃 Thank you for your help in advance! |
@JaehyunShim We can backport relevant PRs to Foxy, but at the moment, we have a lot going on with the upcoming ROS 2 Galactic release. It'll take a bit of time to get to this. Thanks for your patience. |
Hi, It's been more than a month since your response. I would like to ask how it is going with the release work. As you can see in this issue thread, I don't think I am the only person who is waiting for it. Thanks |
@JaehyunShim Thanks for the reminder. I've submitted a backport PR here: #709. I've successfully tested this change on Foxy with my rviz_embed_test. |
@JaehyunShim Change integrated into Foxy branch and bloom released: ros/rosdistro#29963. |
@mjeronimo Thank you very much. I will test it when it is available and let you know if it works without issues. |
@JaehyunShim You're welcome. Closing this item. |
Hi, I tested rviz_common and you seem to have not added the "rviz_common/visualization_frame.hpp" file which is mentioned in our comments above. I also checked the foxy branch and it is not on the list. Could I get help with it? Thanks, |
FYI, resource_retriever in the foxy branch will also be updated as retriever.hpp is used in the code in rviz_common. Please let me know if there is anything I can help. Regards, |
@JaehyunShim I'm currently on vacation through July 21st. Feel free to submit PRs for any missing files and I'll review when I get a chance. |
@mjeronimo Hi thank you very much for your reply. PR is just the code in the ros2 branch. Could you merge it to the foxy branch as it has not hit EOL yet? |
@JaehyunShim Feel free to open a PR backporting the changes to the |
Thank you very much for your support.
It can wait if there is other work in priority but I am asking if the Foxy version can also get continuous support as the support for Foxy is until May 2023 (https://docs.ros.org/en/foxy/Releases.html) and it is currently the only existing LTS version. Thanks, |
The thing is, we do not really "sync" between the
We do support Foxy, but we rely on the community to put the work into the parts that they are interested in. In this case, you are specifically interested in the Foxy backport of this, so we are asking for your support in creating a PR that backports the functionality from the |
Thank you very much for your explanation! That explanation is very helpful and clear. If that is the case, I would like to ask the following questions.
|
Hi @clalancette OK! I tested 2) and it perfectly worked without any issues. You mentioned
but could I ask about it in more detail? Other than potential CI crashes, is there anything else that has to be considered? (ex, do you have sort of a policy that only certain features can be provided in old distros you can encourage users to use newer distros?) Thanks, |
No, we can backport features to older distributions if it makes sense, but...
We guarantee API and ABI stability within a ROS distribution. That is, once we do the release, we make sure not break either the programming API, and we make sure not to break the binary ABI (which is the layout of the code and data in memory). So sometimes when we do backports, we have to make certain changes to the code to make sure it keeps the API and the ABI. That's why we have to evaluate each code change that gets backported individually. |
Hi,
There has been a change in the input arguments for the rviz_common::VisualizationManager function (rviz::VisualizationManager in ROS1) and now the following three have to be passed over to the function when called.
ros_integration::RosNodeAbstractionIface::WeakPtr rclcpp::Clock::SharedPtr WindowManagerInterface*
so I did as follows.
but it fails when
The relevant tutorial for that function hasn't been written for ROS2 yet. Any advice about what to pass over to the function when using it?
Thanks in advance,
Jaehyun
The text was updated successfully, but these errors were encountered: