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

Does Noether support Windows 10? #252

Open
Dawn-and-Night opened this issue Jul 30, 2024 · 7 comments
Open

Does Noether support Windows 10? #252

Dawn-and-Night opened this issue Jul 30, 2024 · 7 comments

Comments

@Dawn-and-Night
Copy link

I want to configure Noether in the ROS 2 Humble environment on Windows 10. Is this possible?

@marip8
Copy link
Member

marip8 commented Jul 30, 2024

Yes, I'm sure it's possible, but I don't know of anyone who has tried this yet. I'm not a Windows developer myself, so I don't know where the issues might arise. I'm happy to add a CI job for Windows 2019/2022 and accept PRs to help make this repo compatible with Windows though.

@Dawn-and-Night
Copy link
Author

Dawn-and-Night commented Jul 31, 2024

Thank you for your response @marip8 .
I am trying to use Noether in a ROS2-Humble environment on Windows 10. My VTK version is 9.1, and my PCL version is 1.12.1. When launching noether_gui_app.exe for path planning, it crashes when using the following tools. If convenient, please assist me. The two images below show the options that cause the crash and the error messages.
error
error_tools
error1

@Dawn-and-Night
Copy link
Author

By rewriting the widget files of these tools that would crash, and modifying the directly using-invoked parts according to the relevant files of the tools that work, everything is now functioning properly. It's quite strange why this issue occurs, as everything works fine on Ubuntu.

@marip8
Copy link
Member

marip8 commented Aug 1, 2024

Interesting errors. I'm not sure I've seen anything like that before. What version of Qt did you compile this with? It looks like some component of Qt might be calling a private method that is different in your version (or the Windows version) vs the Ubuntu version. I have only ever compiled this repo with Qt 5.

By rewriting the widget files of these tools that would crash, and modifying the directly using-invoked parts according to the relevant files of the tools that work, everything is now functioning properly.

Glad to hear you were able to come up with a fix. What did you end up having to change? Was it a change to a .ui file or some actual code changes?

@Dawn-and-Night
Copy link
Author

I compiled this using Qt5.15.3 and solved it by making minor modifications to some of the planner's widget files. Taking SnakeOrganicalModifier as an example, referring to other components of the Tool Path Planner that can run normally, I modified its _widget. h and _widget. cpp files, as shown in the figure.
1
2

@marip8
Copy link
Member

marip8 commented Aug 2, 2024

Summarizing in diff format for clarity:

#pragma once

#include <noether_gui/widgets.h>
#include <noether_tpp/core/tool_path_modifier.h>

namespace noether
{
struct SnakeOrganizationModifierWidget : public ToolPathModifierWidget
{
+ Q_OBJECT
public:
-  using ToolPathModifierWidget::ToolPathModifierWidget;
+  SnakeOrganizationModifierWidget(QWidget* parent = nullptr);

  ToolPathModifier::ConstPtr create() const override;
};

}  // namespace noether
#include <noether_gui/widgets/tool_path_modifiers/snake_organization_modifier_widget.h>
+ #include <noether_gui/utils.h>
#include <noether_tpp/tool_path_modifiers/snake_organization_modifier.h>
+ #include <QFormLayout>
+ #include <QLabel>
+ #include <QDoubleSpinBox>

namespace noether
{
+ SnakeOrganizationModifier::SnakeOrganizationModifier(QWidget* parent)
+ : QWidget(parent)
+ {
+   auto layout = new QFormLayout(this);
+ }

ToolPathModifier::ConstPtr SnakeOrganizationModifierWidget::create() const
{
  return std::make_unique<SnakeOrganizationModifier>();
}

}  // namespace noether

Some thoughts:

  • Adding the Q_OBJECT macro alone doesn't do anything because we are not currently invoking the Qt MOC on any widget files in this repo in the CMakeLists
  • Including noether_gui/utils.h, QLabel, and QDoubleSpinBox seems unnecessary as nothing from those files is used by this particular widget
  • I didn't think it was necessary to set a layout in a QWidget that doesn't have any child elements

It would be interesting to find the set of minimal changes that fixes the issue you encountered. It doesn't feel like any of these changes should have fixed it, but I guess it's hard to tell

@Dawn-and-Night
Copy link
Author

Dawn-and-Night commented Aug 2, 2024

Yes, it's really strange, the fact that the original program works well under Ubuntu means that the code is not problematic.

Those headers were added because they were in the example that was copied, and should have no effect here.

In this can effect should be only 2:
SnakeOrganizationModifierWidget (QWidget * parent = nullptr);

SnakeOrganizationModifier::SnakeOrganizationModifier(QWidget* parent)
: QWidget(parent)
{
auto layout = new QFormLayout(this);
}
It's amazing how this modification works.

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

No branches or pull requests

2 participants