Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cleanDisplay();
- // qDebug() << joystick->getAxis(0)<< joystick->getAxis(1)<< joystick->getAxis(2)<< joystick->getAxis(3)<< joystick->getAxis(4)<< joystick->getAxis(5);
- if(joystick->getButton(5))
- {
- publish_vel(velpub, 0.15, 0);
- }
- if( (joystick->getAxis(5)<-1) && ( joystick->getAxis(5) != -1) )
- {
- ui->lbFront->setText("↑");
- publish_vel(velpub, 0.15, 0);
- }
- if( ( joystick->getAxis(5)>0 ) && ( joystick->getAxis(5) != -1) )
- {
- ui->lbBack->setText("↓");
- publish_vel(velpub, 0.15, 0);
- }
- /*
- //para cima
- if( ( joystick->getAxis(1) < -1) || (joystick->getAxis(5) < -1) )
- {
- ui->lbFront->setText("↑");
- publish_vel(velpub, 0.15, 0);
- }
- //para baixo
- if( ( joystick->getAxis(1) > 0) || (joystick->getAxis(5) > 0) )
- {
- ui->lbBack->setText("↓");
- publish_vel(velpub, -0.15, 0);
- }
- //para lado direito
- if((joystick->getAxis(0)>0) || (joystick->getAxis(4)>0))
- {
- ui->lbRigth->setText("→");
- publish_vel(velpub, 0, -1.2);
- }
- //para lado esquerdo
- if((joystick->getAxis(0) < -1) || (joystick->getAxis(4) < -1 ))
- {
- ui->lbLeft->setText("←");
- publish_vel(velpub, 0, 1.2);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement