59 QWidget* parent,
const boost::program_options::variables_map& args)
61 , node_abstraction_(node)
62 , node_(node_abstraction_.lock()->get_raw_node())
63 , widget_loader_(
"moveit_setup_framework",
"moveit_setup::SetupStepWidget")
66 config_data_ = std::make_shared<DataWarehouse>(node_);
69 if (args.count(
"debug"))
70 config_data_->debug =
true;
73 auto icon_path =
getSharePath(
"moveit_ros_visualization") /
"icons/classes/MotionPlanning.png";
74 setWindowIcon(QIcon(icon_path.c_str()));
77 QHBoxLayout* layout =
new QHBoxLayout();
78 layout->setAlignment(Qt::AlignTop);
81 main_content_ =
new QStackedWidget();
85 std::vector<std::string> setup_steps;
88 setup_steps.push_back(
"moveit_setup::core::StartScreenWidget");
89 setup_steps.push_back(
"moveit_setup::srdf_setup::DefaultCollisionsWidget");
90 setup_steps.push_back(
"moveit_setup::srdf_setup::VirtualJointsWidget");
91 setup_steps.push_back(
"moveit_setup::srdf_setup::PlanningGroupsWidget");
92 setup_steps.push_back(
"moveit_setup::srdf_setup::RobotPosesWidget");
93 setup_steps.push_back(
"moveit_setup::srdf_setup::EndEffectorsWidget");
94 setup_steps.push_back(
"moveit_setup::srdf_setup::PassiveJointsWidget");
95 setup_steps.push_back(
"moveit_setup::controllers::UrdfModificationsWidget");
96 setup_steps.push_back(
"moveit_setup::controllers::ROS2ControllersWidget");
97 setup_steps.push_back(
"moveit_setup::controllers::MoveItControllersWidget");
99 setup_steps.push_back(
"moveit_setup::app::PerceptionWidget");
100 setup_steps.push_back(
"moveit_setup::app::LaunchesWidget");
101 setup_steps.push_back(
"moveit_setup::core::AuthorInformationWidget");
102 setup_steps.push_back(
"moveit_setup::core::ConfigurationFilesWidget");
103 node_->declare_parameter(
"setup_steps", setup_steps);
104 setup_steps = node_->get_parameter(
"setup_steps").as_string_array();
107 rviz_panel_ =
new RVizPanel(
this, node_abstraction_, config_data_);
108 rviz_panel_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
111 for (
const std::string& step_class : setup_steps)
113 auto widget = widget_loader_.createSharedInstance(step_class);
114 widget->initialize(node_,
this, rviz_panel_, config_data_);
116 connect(widget.get(), SIGNAL(dataUpdated()),
this, SLOT(onDataUpdate()));
117 connect(widget.get(), SIGNAL(advanceRequest()),
this, SLOT(onAdvanceRequest()));
118 connect(widget.get(), SIGNAL(setModalMode(
bool)),
this, SLOT(onModalModeUpdate(
bool)));
119 const std::string name = widget->getSetupStep().getName();
120 steps_.push_back(widget);
122 main_content_->addWidget(widget.get());
124 nav_name_list_ << name.c_str();
128 if (args.count(
"urdf_path"))
130 config_data_->preloadWithURDFPath(args[
"urdf_path"].as<std::filesystem::path>());
132 if (args.count(
"config_pkg"))
134 config_data_->preloadWithFullConfig(args[
"config_pkg"].as<std::string>());
139 navs_view_->
setNavs(nav_name_list_);
147 splitter_ =
new QSplitter(Qt::Horizontal,
this);
148 splitter_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
149 splitter_->addWidget(navs_view_);
150 splitter_->addWidget(main_content_);
151 splitter_->addWidget(rviz_panel_);
152 splitter_->setHandleWidth(6);
154 layout->addWidget(splitter_);
157 connect(navs_view_, SIGNAL(clicked(
const QModelIndex&)),
this, SLOT(navigationClicked(
const QModelIndex&)));
163 setWindowTitle(
"MoveIt Setup Assistant");
166 QApplication::processEvents();