Esempio n. 1
0
    KinematicsBarSetupDialog() {

        setWindowTitle(_("Kinematics Operation Setup"));
        
        QVBoxLayout* vbox = new QVBoxLayout();
        setLayout(vbox);
        
        QHBoxLayout* hbox = new QHBoxLayout();
        hbox->addWidget(new QLabel(_("Snap thresholds:")));
        hbox->addSpacing(10);
        
        hbox->addWidget(new QLabel(_("distance")));
        snapDistanceSpin.setAlignment(Qt::AlignCenter);
        snapDistanceSpin.setDecimals(3);
        snapDistanceSpin.setRange(0.0, 0.999);
        snapDistanceSpin.setSingleStep(0.001);
        snapDistanceSpin.setValue(0.025);
        hbox->addWidget(&snapDistanceSpin);
        hbox->addWidget(new QLabel(_("[m]")));

        hbox->addSpacing(5);
        hbox->addWidget(new QLabel(_("angle")));
        snapAngleSpin.setAlignment(Qt::AlignCenter);
        snapAngleSpin.setRange(0, 90);
        snapAngleSpin.setValue(30);
        hbox->addWidget(&snapAngleSpin);
        hbox->addWidget(new QLabel(_("[deg]")));
        vbox->addLayout(hbox);

        hbox = new QHBoxLayout();
        hbox->addWidget(new QLabel(_("Penetration block depth")));
        penetrationBlockDepthSpin.setAlignment(Qt::AlignCenter);
        penetrationBlockDepthSpin.setDecimals(4);
        penetrationBlockDepthSpin.setRange(0.0, 0.0099);
        penetrationBlockDepthSpin.setSingleStep(0.0001);
        penetrationBlockDepthSpin.setValue(0.0005);
        hbox->addWidget(&penetrationBlockDepthSpin);
        hbox->addWidget(new QLabel(_("[m]")));
        vbox->addLayout(hbox);

        hbox = new QHBoxLayout();
        lazyCollisionDetectionModeCheck.setText(_("Lazy collision detection mode"));
        lazyCollisionDetectionModeCheck.setChecked(true);
        hbox->addWidget(&lazyCollisionDetectionModeCheck);
        vbox->addLayout(hbox);

        hbox = new QHBoxLayout();
        okButton.setText(_("OK"));
        okButton.setDefault(true);
        hbox->addWidget(&okButton);
        vbox->addLayout(hbox);
    }
        BodyMotionGenerationSetupDialog() : QDialog(MainWindow::instance()){

            setWindowTitle(_("Body Motion Generation Setup"));

            vbox = new QVBoxLayout();

            QHBoxLayout* hbox = newRow(vbox);
            hbox->addWidget(new QLabel(_("Time scale")));
            timeScaleRatioSpin.setDecimals(2);
            timeScaleRatioSpin.setRange(0.01, 9.99);
            timeScaleRatioSpin.setSingleStep(0.01);
            timeScaleRatioSpin.setValue(1.0);
            hbox->addWidget(&timeScaleRatioSpin);
            
            hbox->addSpacing(8);
            hbox->addWidget(new QLabel(_("Pre-initial")));
            preInitialDurationSpin.setDecimals(1);
            preInitialDurationSpin.setRange(0.0, 9.9);
            preInitialDurationSpin.setSingleStep(0.1);
            preInitialDurationSpin.setValue(1.0);
            hbox->addWidget(&preInitialDurationSpin);
            hbox->addWidget(new QLabel(_("[s]")));
            
            hbox->addSpacing(8);
            hbox->addWidget(new QLabel(_("Post-final")));
            postFinalDurationSpin.setDecimals(1);
            postFinalDurationSpin.setRange(0.0, 9.9);
            postFinalDurationSpin.setSingleStep(0.1);
            postFinalDurationSpin.setValue(1.0);
            hbox->addWidget(&postFinalDurationSpin);
            hbox->addWidget(new QLabel(_("[s]")));
            hbox->addStretch();

            hbox = newRow(vbox);
            onlyTimeBarRangeCheck.setText(_("Time bar's range only"));
            onlyTimeBarRangeCheck.setChecked(false);
            hbox->addWidget(&onlyTimeBarRangeCheck);
            
            se3Check.setText(_("Put all link positions"));
            se3Check.setChecked(false);
            hbox->addWidget(&se3Check);
            hbox->addStretch();
            
            hbox = newRow(vbox);
            newBodyItemCheck.setText(_("Make a new body item"));
            newBodyItemCheck.setChecked(true);
            hbox->addWidget(&newBodyItemCheck);
            hbox->addStretch();

            addSeparator(vbox, &stealthyStepCheck);
            stealthyStepCheck.setText(_("Stealthy Step Mode"));
            stealthyStepCheck.setToolTip(_("This mode makes foot lifting / landing smoother to increase the stability"));
            stealthyStepCheck.setChecked(true);

            hbox = newRow(vbox);
            hbox->addWidget(new QLabel(_("Height ratio thresh")));
            stealthyHeightRatioThreshSpin.setAlignment(Qt::AlignCenter);
            stealthyHeightRatioThreshSpin.setDecimals(2);
            stealthyHeightRatioThreshSpin.setRange(1.00, 9.99);
            stealthyHeightRatioThreshSpin.setSingleStep(0.01);
            stealthyHeightRatioThreshSpin.setValue(2.0);
            hbox->addWidget(&stealthyHeightRatioThreshSpin);
            hbox->addStretch();

            hbox = newRow(vbox);
            hbox->addWidget(new QLabel(_("Flat Lifting Height")));
            flatLiftingHeightSpin.setAlignment(Qt::AlignCenter);
            flatLiftingHeightSpin.setDecimals(3);
            flatLiftingHeightSpin.setRange(0.0, 0.0999);
            flatLiftingHeightSpin.setSingleStep(0.001);
            flatLiftingHeightSpin.setValue(0.005);
            hbox->addWidget(&flatLiftingHeightSpin);
            hbox->addWidget(new QLabel(_("[m]")));

            hbox->addSpacing(8);
            hbox->addWidget(new QLabel(_("Flat Landing Height")));
            flatLandingHeightSpin.setAlignment(Qt::AlignCenter);
            flatLandingHeightSpin.setDecimals(3);
            flatLandingHeightSpin.setRange(0.0, 0.0999);
            flatLandingHeightSpin.setSingleStep(0.001);
            flatLandingHeightSpin.setValue(0.005);
            hbox->addWidget(&flatLandingHeightSpin);
            hbox->addWidget(new QLabel(_("[m]")));
            hbox->addStretch();

            hbox = newRow(vbox);
            hbox->addWidget(new QLabel(_("Impact reduction height")));
            impactReductionHeightSpin.setAlignment(Qt::AlignCenter);
            impactReductionHeightSpin.setDecimals(3);
            impactReductionHeightSpin.setRange(0.0, 0.099);
            impactReductionHeightSpin.setSingleStep(0.001);
            impactReductionHeightSpin.setValue(0.005);
            hbox->addWidget(&impactReductionHeightSpin);
            hbox->addWidget(new QLabel(_("[m]")));
            
            hbox->addSpacing(8);
            hbox->addWidget(new QLabel(_("Impact reduction time")));
            impactReductionTimeSpin.setAlignment(Qt::AlignCenter);
            impactReductionTimeSpin.setDecimals(3);
            impactReductionTimeSpin.setRange(0.001, 0.999);
            impactReductionTimeSpin.setSingleStep(0.001);
            impactReductionTimeSpin.setValue(0.04);
            hbox->addWidget(&impactReductionTimeSpin);
            hbox->addWidget(new QLabel(_("[s]")));
            hbox->addStretch();
                             
            addSeparator(vbox, &autoZmpCheck);
            autoZmpCheck.setText(_("Auto ZMP Mode"));
            autoZmpCheck.setToolTip(_("Automatically insert ZMP and foot key poses for stable motion"));
            autoZmpCheck.setChecked(true);

            hbox = newRow(vbox);
            hbox->addWidget(new QLabel(_("Min. transtion time")));
            minZmpTransitionTimeSpin.setDecimals(2);
            minZmpTransitionTimeSpin.setRange(0.01, 0.99);
            minZmpTransitionTimeSpin.setSingleStep(0.01);
            minZmpTransitionTimeSpin.setValue(0.1);
            hbox->addWidget(&minZmpTransitionTimeSpin);
            hbox->addWidget(new QLabel(_("[s]")));

            hbox->addSpacing(8);
            hbox->addWidget(new QLabel(_("Centering time thresh")));
            zmpCenteringTimeThreshSpin.setDecimals(3);
            zmpCenteringTimeThreshSpin.setRange(0.001, 0.999);
            zmpCenteringTimeThreshSpin.setSingleStep(0.001);
            zmpCenteringTimeThreshSpin.setValue(0.03);
            hbox->addWidget(&zmpCenteringTimeThreshSpin);
            hbox->addWidget(new QLabel(_("[s]")));
            hbox->addStretch();

            hbox = newRow(vbox);
            hbox->addWidget(new QLabel(_("Time margin before lifting")));
            zmpTimeMarginBeforeLiftingSpin.setDecimals(3);
            zmpTimeMarginBeforeLiftingSpin.setRange(0.0, 0.999);
            zmpTimeMarginBeforeLiftingSpin.setSingleStep(0.001);
            zmpTimeMarginBeforeLiftingSpin.setValue(0.0);
            hbox->addWidget(&zmpTimeMarginBeforeLiftingSpin);
            hbox->addWidget(new QLabel(_("[s]")));
            hbox->addStretch();
            
            addSeparator(vbox);
            hbox = newRow(vbox);

            lipSyncMixCheck.setText(_("Mix lip-sync motion"));
            lipSyncMixCheck.setChecked(false);
            hbox->addWidget(&lipSyncMixCheck);
            hbox->addStretch();

            QVBoxLayout* topVBox = new QVBoxLayout();
            topVBox->addLayout(vbox);

            addSeparator(topVBox);

            QPushButton* okButton = new QPushButton(_("&Ok"));
            okButton->setDefault(true);
            QDialogButtonBox* buttonBox = new QDialogButtonBox(this);
            buttonBox->addButton(okButton, QDialogButtonBox::AcceptRole);
            connect(buttonBox,SIGNAL(accepted()), this, SLOT(accept()));
            topVBox->addWidget(buttonBox);

            setLayout(topVBox);
        }