00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include <QLabel>
00039 #include <QTimer>
00040 #include <QVBoxLayout>
00041 #include <QHBoxLayout>
00042 #include <QMessageBox>
00043 #include <QString>
00044 #include <QApplication>
00045 #include <QFont>
00046 #include <QFileDialog>
00047
00048 #include <ros/ros.h>
00049 #include <ros/package.h>
00050
00051 #include "header_widget.h"
00052 #include "start_screen_widget.h"
00053
00054 #include <fstream>
00055 #include <streambuf>
00056
00057 #include <boost/algorithm/string.hpp>
00058 #include <boost/filesystem.hpp>
00059 #include <boost/algorithm/string.hpp>
00060
00061 namespace moveit_setup_assistant
00062 {
00063
00064
00065 namespace fs = boost::filesystem;
00066
00067
00068
00069
00070 StartScreenWidget::StartScreenWidget( QWidget* parent, moveit_setup_assistant::MoveItConfigDataPtr config_data )
00071 : SetupScreenWidget( parent ), config_data_( config_data )
00072 {
00073
00074
00075
00076 QVBoxLayout *layout = new QVBoxLayout( this );
00077
00078
00079 QHBoxLayout *hlayout = new QHBoxLayout( );
00080
00081 QVBoxLayout *left_layout = new QVBoxLayout( );
00082
00083 QVBoxLayout *right_layout = new QVBoxLayout( );
00084
00085
00086
00087 right_image_ = new QImage();
00088 right_image_label_ = new QLabel( this );
00089 std::string image_path = "./resources/MoveIt_Setup_Asst_xSm.png";
00090 if(chdir(config_data_->setup_assistant_path_.c_str()) != 0)
00091 {
00092 ROS_ERROR("FAILED TO CHANGE PACKAGE TO moveit_setup_assistant");
00093 }
00094
00095 if (right_image_->load( image_path.c_str() ))
00096 {
00097 right_image_label_->setPixmap(QPixmap::fromImage( *right_image_));
00098 right_image_label_->setMinimumHeight(384);
00099
00100 }
00101 else
00102 {
00103 ROS_ERROR_STREAM("FAILED TO LOAD " << image_path );
00104 }
00105
00106 logo_image_ = new QImage();
00107 logo_image_label_ = new QLabel( this );
00108 image_path = "./resources/moveit_logo.png";
00109
00110 if (logo_image_->load( image_path.c_str() ))
00111 {
00112 logo_image_label_->setPixmap(QPixmap::fromImage( *logo_image_));
00113 logo_image_label_->setMinimumWidth(96);
00114 }
00115 else
00116 {
00117 ROS_ERROR_STREAM("FAILED TO LOAD " << image_path );
00118 }
00119
00120
00121
00122 HeaderWidget *header = new HeaderWidget( "MoveIt Setup Assistant",
00123 "Welcome to the MoveIt Setup Assistant! These tools will assist you in creating a MoveIt configuration package that is required to run MoveIt. This includes generating a Semantic Robot Description Format (SRDF) file, kinematics configuration file and OMPL planning configuration file. It also involves creating launch files for move groups, OMPL planner, planning contexts and the planning warehouse.",
00124 this);
00125 layout->addWidget( header );
00126
00127 left_layout->addWidget(logo_image_label_);
00128 left_layout->setAlignment(logo_image_label_, Qt::AlignLeft | Qt::AlignTop);
00129
00130
00131 select_mode_ = new SelectModeWidget( this );
00132 connect( select_mode_->btn_new_, SIGNAL( clicked() ), this, SLOT( showNewOptions() ) );
00133 connect( select_mode_->btn_exist_, SIGNAL( clicked() ), this, SLOT( showExistingOptions() ) );
00134 left_layout->addWidget( select_mode_ );
00135
00136
00137
00138
00139 stack_path_ = new LoadPathWidget("Load MoveIt Configuration Package Path",
00140 "Specify the package name or path of an existing MoveIt configuration package to be edited for your robot. Example package name: <i>pr2_moveit_config</i>",
00141 true, this);
00142 stack_path_->hide();
00143 left_layout->addWidget( stack_path_ );
00144
00145
00146 urdf_file_ = new LoadPathWidget("Load a URDF or COLLADA Robot Model",
00147 "Specify the location of an existing Universal Robot Description Format or COLLADA file for your robot. The robot model will be loaded to the parameter server for you.",
00148 false, true, this);
00149 urdf_file_->hide();
00150 left_layout->addWidget( urdf_file_ );
00151
00152
00153 QHBoxLayout *load_files_layout = new QHBoxLayout();
00154
00155 progress_bar_ = new QProgressBar( this );
00156 progress_bar_->setMaximum(100);
00157 progress_bar_->setMinimum(0);
00158 progress_bar_->hide();
00159 load_files_layout->addWidget( progress_bar_ );
00160
00161
00162 btn_load_ = new QPushButton("&Load Files", this);
00163 btn_load_->setMinimumWidth(180);
00164 btn_load_->setMinimumHeight(40);
00165 btn_load_->hide();
00166 load_files_layout->addWidget( btn_load_ );
00167 load_files_layout->setAlignment( btn_load_, Qt::AlignRight );
00168 connect( btn_load_, SIGNAL( clicked() ), this, SLOT( loadFilesClick() ) );
00169
00170
00171 next_label_ = new QLabel( this );
00172 QFont next_label_font( "Arial", 11, QFont::Bold );
00173 next_label_->setFont( next_label_font );
00174
00175 next_label_->setText( "Success! Use the left navigation pane to continue." );
00176
00177 next_label_->hide();
00178
00179 right_layout->addWidget(right_image_label_);
00180 right_layout->setAlignment(right_image_label_, Qt::AlignRight | Qt::AlignTop);
00181
00182
00183
00184 layout->setAlignment( Qt::AlignTop );
00185 hlayout->setAlignment( Qt::AlignTop );
00186 left_layout->setAlignment( Qt::AlignTop );
00187 right_layout->setAlignment( Qt::AlignTop );
00188
00189
00190 left_layout->setSpacing( 30 );
00191
00192
00193
00194 hlayout->addLayout( left_layout );
00195 hlayout->addLayout( right_layout );
00196 layout->addLayout( hlayout );
00197
00198
00199 QWidget *vspacer = new QWidget( this );
00200 vspacer->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
00201 layout->addWidget( vspacer );
00202
00203
00204 layout->addWidget( next_label_);
00205 layout->setAlignment( next_label_, Qt::AlignRight );
00206 layout->addLayout( load_files_layout );
00207
00208 this->setLayout(layout);
00209
00210
00211
00212
00213 if( config_data_->debug_ )
00214 {
00215
00216
00217 QTimer *update_timer = new QTimer( this );
00218 update_timer->setSingleShot( true );
00219 connect( update_timer, SIGNAL( timeout() ), btn_load_, SLOT( click() ));
00220 update_timer->start( 100 );
00221 }
00222
00223
00224 }
00225
00226
00227
00228
00229 StartScreenWidget::~StartScreenWidget()
00230 {
00231 delete right_image_;
00232 delete logo_image_;
00233 }
00234
00235
00236
00237
00238 void StartScreenWidget::showNewOptions()
00239 {
00240
00241 select_mode_->btn_exist_->setFlat( false );
00242 select_mode_->btn_new_->setFlat( true );
00243 urdf_file_->show();
00244
00245 stack_path_->hide();
00246 btn_load_->show();
00247
00248
00249 create_new_package_ = true;
00250 }
00251
00252
00253
00254
00255 void StartScreenWidget::showExistingOptions()
00256 {
00257
00258 select_mode_->btn_exist_->setFlat( true );
00259 select_mode_->btn_new_->setFlat( false );
00260 urdf_file_->hide();
00261
00262 stack_path_->show();
00263 btn_load_->show();
00264
00265
00266 create_new_package_ = false;
00267 }
00268
00269
00270
00271
00272 void StartScreenWidget::loadFilesClick()
00273 {
00274
00275 urdf_file_->setDisabled(true);
00276
00277 stack_path_->setDisabled(true);
00278 select_mode_->setDisabled(true);
00279 btn_load_->setDisabled(true);
00280 progress_bar_->show();
00281
00282 bool result;
00283
00284
00285 if( create_new_package_ )
00286 {
00287 result = loadNewFiles();
00288 }
00289 else
00290 {
00291 result = loadExistingFiles();
00292 }
00293
00294
00295 if( !result )
00296 {
00297
00298 urdf_file_->setDisabled(false);
00299
00300 stack_path_->setDisabled(false);
00301 select_mode_->setDisabled(false);
00302 btn_load_->setDisabled(false);
00303 progress_bar_->hide();
00304 }
00305 else
00306 {
00307
00308 right_image_label_->hide();
00309 }
00310
00311 }
00312
00313
00314
00315
00316 bool StartScreenWidget::loadExistingFiles()
00317 {
00318
00319 progress_bar_->setValue( 10 );
00320 QApplication::processEvents();
00321
00322
00323 if( !createFullPackagePath() )
00324 return false;
00325
00326
00327 fs::path setup_assistant_file = config_data_->config_pkg_path_;
00328 setup_assistant_file /= ".setup_assistant";
00329
00330
00331 if( ! fs::is_regular_file( setup_assistant_file ) )
00332 {
00333 QMessageBox::warning( this, "Incorrect Directory/Package",
00334 QString("The chosen package location exists but was not previously created using this MoveIt Setup Assistant. If this is a mistake, replace the missing file: ")
00335 .append( setup_assistant_file.make_preferred().native().c_str() ) );
00336 return false;
00337 }
00338
00339
00340 if( !config_data_->inputSetupAssistantYAML( setup_assistant_file.make_preferred().native().c_str() ) )
00341 {
00342 QMessageBox::warning( this, "Setup Assistant File Error",
00343 QString("Unable to correctly parse the setup assistant configuration file: " )
00344 .append( setup_assistant_file.make_preferred().native().c_str() ) );
00345 return false;
00346 }
00347
00348
00349 progress_bar_->setValue( 30 );
00350 QApplication::processEvents();
00351
00352
00353 if( !createFullURDFPath() )
00354 return false;
00355
00356
00357 if( !loadURDFFile( config_data_->urdf_path_ ) )
00358 return false;
00359
00360
00361 if( !createFullSRDFPath( config_data_->config_pkg_path_ ) )
00362 return false;
00363
00364
00365 progress_bar_->setValue( 50 );
00366 QApplication::processEvents();
00367
00368
00369 if( !loadSRDFFile( config_data_->srdf_path_ ) )
00370 return false;
00371
00372
00373 progress_bar_->setValue( 60 );
00374 QApplication::processEvents();
00375
00376
00377 config_data_->loadAllowedCollisionMatrix();
00378
00379
00380 fs::path kinematics_yaml_path = config_data_->config_pkg_path_;
00381 kinematics_yaml_path /= "config/kinematics.yaml";
00382
00383 if( !config_data_->inputKinematicsYAML( kinematics_yaml_path.make_preferred().native().c_str() ) )
00384 {
00385 QMessageBox::warning( this, "No Kinematic YAML File",
00386 QString("Failed to parse kinematics yaml file. This file is not critical but any previous kinematic solver settings have been lost. To re-populate this file edit each existing planning group and choose a solver, then save each change. \n\nFile error at location ").append( kinematics_yaml_path.make_preferred().native().c_str() ) );
00387 }
00388
00389
00390
00391
00392 Q_EMIT readyToProgress();
00393
00394
00395 progress_bar_->setValue( 70 );
00396 QApplication::processEvents();
00397
00398
00399 Q_EMIT loadRviz();
00400
00401
00402 progress_bar_->setValue( 100 );
00403 QApplication::processEvents();
00404
00405 next_label_->show();
00406
00407 ROS_INFO( "Loading Setup Assistant Complete" );
00408 return true;
00409 }
00410
00411
00412
00413
00414 bool StartScreenWidget::loadNewFiles()
00415 {
00416
00417 config_data_->urdf_path_ = urdf_file_->getPath();
00418
00419
00420 if( config_data_->urdf_path_.empty() )
00421 {
00422 QMessageBox::warning( this, "Error Loading Files", "No robot model file specefied" );
00423 return false;
00424 }
00425
00426
00427 if( ! fs::is_regular_file( config_data_->urdf_path_ ) )
00428 {
00429 QMessageBox::warning( this, "Error Loading Files",
00430 QString("Unable to locate the URDF file: " )
00431 .append( config_data_->urdf_path_.c_str() ) );
00432 return false;
00433 }
00434
00435
00436 if( !extractPackageNameFromPath() )
00437 {
00438 return false;
00439 }
00440
00441
00442 progress_bar_->setValue( 20 );
00443 QApplication::processEvents();
00444
00445
00446 if( !loadURDFFile( config_data_->urdf_path_ ) )
00447 return false;
00448
00449
00450 progress_bar_->setValue( 50 );
00451 QApplication::processEvents();
00452
00453
00454 const std::string blank_srdf =
00455 "<?xml version='1.0'?><robot name='" + config_data_->urdf_model_->getName() + "'></robot>";
00456
00457
00458 if( !setSRDFFile( blank_srdf ))
00459 {
00460 QMessageBox::warning( this, "Error Loading Files", "Failure loading blank SRDF file." );
00461 return false;
00462 }
00463
00464
00465 progress_bar_->setValue( 60 );
00466 QApplication::processEvents();
00467
00468
00469
00470
00471 Q_EMIT readyToProgress();
00472
00473
00474 progress_bar_->setValue( 70 );
00475 QApplication::processEvents();
00476
00477
00478 Q_EMIT loadRviz();
00479
00480
00481 progress_bar_->setValue( 100 );
00482 QApplication::processEvents();
00483
00484 next_label_->show();
00485
00486 ROS_INFO( "Loading Setup Assistant Complete" );
00487 return true;
00488 }
00489
00490
00491
00492
00493 bool StartScreenWidget::loadURDFFile( const std::string& urdf_file_path )
00494 {
00495
00496 std::ifstream urdf_stream( urdf_file_path.c_str() );
00497 if( !urdf_stream.good() )
00498 {
00499 QMessageBox::warning( this, "Error Loading Files", QString( "URDF/COLLADA file not found: " ).append( urdf_file_path.c_str() ) );
00500 return false;
00501 }
00502 std::string urdf_string;
00503 bool xacro = false;
00504
00505 if (urdf_file_path.find(".xacro") != std::string::npos)
00506 {
00507 std::string cmd("rosrun xacro xacro.py ");
00508 cmd += urdf_file_path;
00509 ROS_INFO( "Running '%s'...", cmd.c_str() );
00510
00511 FILE* pipe = popen(cmd.c_str(), "r");
00512 if (!pipe)
00513 {
00514 QMessageBox::warning( this, "Error Loading Files", QString( "XACRO file or parser not found: " ).append( urdf_file_path.c_str() ) );
00515 return false;
00516 }
00517 char buffer[128] = {0};
00518 while (!feof(pipe))
00519 {
00520 if (fgets(buffer, sizeof(buffer), pipe) != NULL)
00521 urdf_string += buffer;
00522 }
00523 pclose(pipe);
00524
00525 if (urdf_string.empty())
00526 {
00527 QMessageBox::warning( this, "Error Loading Files", QString( "Unable to parse XACRO file: " ).append( urdf_file_path.c_str() ) );
00528 return false;
00529 }
00530 xacro = true;
00531 }
00532 else
00533 {
00534
00535 urdf_stream.seekg(0, std::ios::end);
00536 urdf_string.reserve(urdf_stream.tellg());
00537 urdf_stream.seekg(0, std::ios::beg);
00538 urdf_string.assign( (std::istreambuf_iterator<char>(urdf_stream)), std::istreambuf_iterator<char>() );
00539 urdf_stream.close();
00540 }
00541
00542 if( !config_data_->urdf_model_->initString( urdf_string ) )
00543 {
00544 QMessageBox::warning( this, "Error Loading Files",
00545 "URDF/COLLADA file is not a valid robot model." );
00546 return false;
00547 }
00548 config_data_->urdf_from_xacro_ = xacro;
00549
00550 ROS_INFO_STREAM( "Loaded " << config_data_->urdf_model_->getName() << " robot model." );
00551
00552
00553 ros::NodeHandle nh;
00554 int steps = 0;
00555 while (!nh.ok() && steps < 4)
00556 {
00557 ROS_WARN("Waiting for node handle");
00558 sleep(1);
00559 steps++;
00560 ros::spinOnce();
00561 }
00562
00563 ROS_INFO("Setting Param Server with Robot Description");
00564
00565 nh.setParam("/robot_description", urdf_string);
00566
00567 return true;
00568 }
00569
00570
00571
00572
00573 bool StartScreenWidget::loadSRDFFile( const std::string& srdf_file_path )
00574 {
00575
00576 std::ifstream srdf_stream( srdf_file_path.c_str() );
00577 if( !srdf_stream.good() )
00578 {
00579 QMessageBox::warning( this, "Error Loading Files", QString( "SRDF file not found: " ).append( config_data_->srdf_path_.c_str() ) );
00580 return false;
00581 }
00582
00583
00584 std::string srdf_string;
00585 srdf_stream.seekg(0, std::ios::end);
00586 srdf_string.reserve(srdf_stream.tellg());
00587 srdf_stream.seekg(0, std::ios::beg);
00588 srdf_string.assign( (std::istreambuf_iterator<char>(srdf_stream)), std::istreambuf_iterator<char>() );
00589 srdf_stream.close();
00590
00591
00592 return setSRDFFile( srdf_string );
00593 }
00594
00595
00596
00597
00598 bool StartScreenWidget::setSRDFFile( const std::string& srdf_string )
00599 {
00600
00601 if( !config_data_->srdf_->initString( *config_data_->urdf_model_, srdf_string ) )
00602 {
00603 QMessageBox::warning( this, "Error Loading Files",
00604 "SRDF file not a valid semantic robot description model." );
00605 return false;
00606 }
00607 ROS_INFO_STREAM( "Robot semantic model successfully loaded." );
00608
00609
00610 ros::NodeHandle nh;
00611 int steps = 0;
00612 while (!nh.ok() && steps < 4)
00613 {
00614 ROS_WARN("Waiting for node handle");
00615 sleep(1);
00616 steps++;
00617 ros::spinOnce();
00618 }
00619
00620 ROS_INFO("Setting Param Server with Robot Semantic Description");
00621 nh.setParam("/robot_description_semantic", srdf_string);
00622
00623 return true;
00624 }
00625
00626
00627
00628
00629
00630
00631
00632 bool StartScreenWidget::extractPackageNameFromPath()
00633 {
00634
00635 fs::path urdf_path = config_data_->urdf_path_;
00636 fs::path urdf_directory = urdf_path;
00637 urdf_directory.remove_filename();
00638
00639 fs::path sub_path;
00640 fs::path relative_path;
00641 std::string package_name;
00642
00643
00644 fs::path package_path;
00645
00646 std::vector<std::string> path_parts;
00647
00648
00649 for (fs::path::iterator it = urdf_directory.begin(); it != urdf_directory.end(); ++it)
00650 path_parts.push_back( it->native() );
00651
00652 bool packageFound = false;
00653
00654
00655 for( int segment_length = path_parts.size(); segment_length > 0; --segment_length )
00656 {
00657
00658 sub_path.clear();
00659
00660
00661 for( int segment_count = 0; segment_count < segment_length; ++segment_count )
00662 {
00663 sub_path /= path_parts[ segment_count ];
00664
00665
00666 if( segment_count == segment_length - 1)
00667 {
00668 package_name = path_parts[ segment_count ];
00669 }
00670 }
00671
00672
00673 package_path = sub_path;
00674 package_path /= "package.xml";
00675 ROS_DEBUG_STREAM("Checking for " << package_path.make_preferred().native());
00676
00677
00678 if( fs::is_regular_file( package_path ) || fs::is_regular_file( sub_path / "manifest.xml" ))
00679 {
00680
00681 for( size_t relative_count = segment_length; relative_count < path_parts.size(); ++relative_count )
00682 relative_path /= path_parts[ relative_count ];
00683
00684
00685 relative_path /= urdf_path.filename();
00686
00687
00688 segment_length = 0;
00689 packageFound = true;
00690 break;
00691 }
00692
00693 }
00694
00695
00696 if( !packageFound )
00697 {
00698
00699 config_data_->urdf_pkg_name_ = "";
00700 config_data_->urdf_pkg_relative_path_ = config_data_->urdf_path_;
00701 }
00702 else
00703 {
00704
00705 const std::string robot_desc_pkg_path = ros::package::getPath( config_data_->urdf_pkg_name_ ) + "/";
00706
00707 if( robot_desc_pkg_path.empty() )
00708 {
00709 QMessageBox::warning( this, "Package Not Found In ROS Workspace", QString("ROS was unable to find the package name '")
00710 .append( config_data_->urdf_pkg_name_.c_str() )
00711 .append("' within the ROS workspace. This may cause issues later.") );
00712 }
00713
00714
00715 config_data_->urdf_pkg_name_ = package_name;
00716 config_data_->urdf_pkg_relative_path_ = relative_path.make_preferred().native();
00717 }
00718
00719 ROS_DEBUG_STREAM( "URDF Package Name: " << config_data_->urdf_pkg_name_ );
00720 ROS_DEBUG_STREAM( "URDF Package Path: " << config_data_->urdf_pkg_relative_path_ );
00721
00722 return true;
00723 }
00724
00725
00726
00727
00728 bool StartScreenWidget::createFullURDFPath()
00729 {
00730 fs::path urdf_path;
00731
00732
00733 if( config_data_->urdf_pkg_name_.empty() || config_data_->urdf_pkg_name_ == "\"\"" )
00734 {
00735 urdf_path = config_data_->urdf_pkg_relative_path_;
00736 ROS_WARN("The URDF path is absolute to the filesystem and not relative to a ROS package/stack");
00737 }
00738 else
00739 {
00740
00741
00742 fs::path robot_desc_pkg_path = ros::package::getPath( config_data_->urdf_pkg_name_ );
00743
00744 if( robot_desc_pkg_path.empty() )
00745 {
00746 QMessageBox::warning( this, "Error Loading Files", QString("ROS was unable to find the package name '")
00747 .append( config_data_->urdf_pkg_name_.c_str() )
00748 .append("'. Verify this package is inside your ROS workspace and is a proper ROS package.") );
00749 return false;
00750 }
00751
00752
00753 urdf_path = robot_desc_pkg_path;
00754 urdf_path /= config_data_->urdf_pkg_relative_path_;
00755 }
00756
00757
00758
00759 if( ! fs::is_regular_file( urdf_path ) )
00760 {
00761 QMessageBox::warning( this, "Error Loading Files",
00762 QString( "Unable to locate the URDF file in package. File: " )
00763 .append( urdf_path.make_preferred().native().c_str() ) );
00764 return false;
00765 }
00766
00767
00768 config_data_->urdf_path_ = urdf_path.make_preferred().native();
00769
00770 return true;
00771 }
00772
00773
00774
00775
00776 bool StartScreenWidget::createFullSRDFPath( const std::string& package_path )
00777 {
00778
00779 fs::path srdf_path = package_path;
00780 srdf_path /= config_data_->srdf_pkg_relative_path_;
00781 config_data_->srdf_path_ = srdf_path.make_preferred().native();
00782
00783
00784 if( ! fs::is_regular_file( config_data_->srdf_path_ ) )
00785 {
00786 QMessageBox::warning( this, "Error Loading Files",
00787 QString("Unable to locate the SRDF file: " )
00788 .append( config_data_->srdf_path_.c_str() ) );
00789 return false;
00790 }
00791
00792 return true;
00793 }
00794
00795
00796
00797
00798 bool StartScreenWidget::createFullPackagePath()
00799 {
00800
00801 std::string package_path_input = stack_path_->getPath();
00802 std::string full_package_path;
00803
00804
00805 boost::trim( package_path_input );
00806
00807
00808 if( package_path_input.empty() )
00809 {
00810 QMessageBox::warning( this, "Error Loading Files", "Please specify a configuration package path to load." );
00811 return false;
00812 }
00813
00814
00815
00816
00817 if( !fs::is_directory( package_path_input ) )
00818 {
00819
00820 full_package_path = ros::package::getPath( package_path_input );
00821
00822
00823 if( !fs::is_directory( full_package_path ) )
00824 {
00825
00826 QMessageBox::critical( this, "Error Loading Files", "The specified path is not a directory or is not accessable" );
00827 return false;
00828 }
00829 }
00830 else
00831 {
00832
00833 full_package_path = package_path_input;
00834 }
00835
00836 config_data_->config_pkg_path_ = full_package_path;
00837
00838 return true;
00839 }
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851 SelectModeWidget::SelectModeWidget( QWidget* parent )
00852 : QFrame(parent)
00853 {
00854
00855 setFrameShape(QFrame::StyledPanel);
00856 setFrameShadow(QFrame::Raised);
00857 setLineWidth(1);
00858 setMidLineWidth(0);
00859
00860
00861 QVBoxLayout *layout = new QVBoxLayout(this);
00862
00863
00864 QHBoxLayout *hlayout = new QHBoxLayout();
00865
00866
00867 QLabel * widget_title = new QLabel(this);
00868 widget_title->setText( "Choose mode:" );
00869 QFont widget_title_font( "Arial", 12, QFont::Bold );
00870 widget_title->setFont(widget_title_font);
00871 layout->addWidget( widget_title);
00872 layout->setAlignment( widget_title, Qt::AlignTop);
00873
00874
00875 QLabel * widget_instructions = new QLabel(this);
00876 widget_instructions->setText( "All settings for MoveIt are stored in a Moveit configuration package. Here you have the option to create a new configuration package, or load an existing one. Note: any changes to a MoveIt configuration package outside this setup assistant will likely be overwritten by this tool." );
00877 widget_instructions->setWordWrap(true);
00878
00879 widget_instructions->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
00880 layout->addWidget( widget_instructions);
00881 layout->setAlignment( widget_instructions, Qt::AlignTop);
00882
00883
00884 btn_new_ = new QPushButton(this);
00885 btn_new_->setText("Create &New MoveIt\nConfiguration Package");
00886 hlayout->addWidget( btn_new_ );
00887
00888
00889 btn_exist_ = new QPushButton(this);
00890 btn_exist_->setText("&Edit Existing MoveIt\nConfiguration Package");
00891 hlayout->addWidget( btn_exist_ );
00892
00893
00894 layout->addLayout(hlayout);
00895 setLayout(layout);
00896 }
00897
00898
00899 }