YARP
Yet Another Robot Platform
Loading...
Searching...
No Matches
display.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3
* SPDX-License-Identifier: LGPL-2.1-or-later
4
*/
5
6
#ifndef DISPLAY_H
7
#define DISPLAY_H
8
9
#include <QMainWindow>
10
#include <QTimer>
11
12
#include <
yarp/os/Os.h
>
13
#include <
yarp/os/Network.h
>
14
#include <
yarp/os/ResourceFinder.h
>
15
#include <
yarp/os/Stamp.h
>
16
#include <
yarp/dev/IBattery.h
>
17
#include <
yarp/dev/PolyDriver.h
>
18
#include <
yarp/dev/Drivers.h
>
19
#include <
yarp/dev/MobileBaseVelocity.h
>
20
21
#include "ui_display.h"
22
#include "
joywidget.h
"
23
24
class
MainWindow
:
public
QMainWindow
25
{
26
Q_OBJECT
27
28
public
:
29
explicit
MainWindow
(
const
yarp::os::ResourceFinder
& rf, QWidget *parent = 0,
double
refresh_period=0.01);
30
~MainWindow
();
31
32
private
slots:
33
void
updateMain();
34
void
handleButton_Wp();
35
void
handleButton_Wr();
36
void
handleButton_Sp();
37
void
handleButton_Sr();
38
void
handleButton_Ap();
39
void
handleButton_Ar();
40
void
handleButton_Dp();
41
void
handleButton_Dr();
42
void
handleButton_Qp();
43
void
handleButton_Qr();
44
void
handleButton_Ep();
45
void
handleButton_Er();
46
47
void
handleButton_I();
48
void
handleButton_K();
49
void
handleButton_O();
50
void
handleButton_L();
51
protected
:
52
void
keyReleaseEvent
(QKeyEvent* e)
override
;
53
void
keyPressEvent
(QKeyEvent* e)
override
;
54
55
public
:
56
yarp::os::Network
yarp
;
57
58
public
:
59
//parametes
60
double
max_vel_lin
= 1;
//ms/s
61
double
max_vel_theta
= 10;
//deg/s
62
double
cur_vel_lin_x
= 0;
//ms/s
63
double
cur_vel_lin_y
= 0;
//ms/s
64
double
cur_vel_theta
= 0;
//deg/s
65
double
lin_vel_step
= 0.05;
//ms/s
66
double
ang_vel_step
= 5;
//deg/s
67
std::string
portname
=
"/yarpmobilebasegui:o"
;
68
69
#define s_max_lin_vel "max linear velocity: %3.3f m/s"
70
#define s_max_ang_vel "max angular velocity: %3.1f deg/s"
71
#define s_cur_lin_vel_x "cur x linear velocity: %3.3f m/s"
72
#define s_cur_lin_vel_y "cur y linear velocity: %3.3f m/s"
73
#define s_cur_ang_vel "cur angular velocity: %3.1f deg/s"
74
75
private
:
76
Ui_MainWindow *ui;
77
QTimer* mainTimer;
78
Joywidget
* joy;
79
char
buff[100];
80
yarp::os::Stamp
m_stamp;
81
82
public
:
83
yarp::os::Port
outputport
;
84
bool
pressed_left
=
false
;
85
bool
pressed_up
=
false
;
86
bool
pressed_down
=
false
;
87
bool
pressed_right
=
false
;
88
bool
pressed_turn_left
=
false
;
89
bool
pressed_turn_right
=
false
;
90
yarp::dev::MobileBaseVelocity
output_data
;
91
};
92
93
#endif
Drivers.h
IBattery.h
MobileBaseVelocity.h
Network.h
Os.h
PolyDriver.h
ResourceFinder.h
Stamp.h
Joywidget
Definition
joywidget.h:24
MainWindow
MainWindow class.
Definition
display.h:22
MainWindow::pressed_turn_left
bool pressed_turn_left
Definition
display.h:88
MainWindow::portname
std::string portname
Definition
display.h:67
MainWindow::outputport
yarp::os::Port outputport
Definition
display.h:83
MainWindow::max_vel_theta
double max_vel_theta
Definition
display.h:61
MainWindow::keyPressEvent
void keyPressEvent(QKeyEvent *e) override
Definition
display.cpp:55
MainWindow::output_data
yarp::dev::MobileBaseVelocity output_data
Definition
display.h:90
MainWindow::max_vel_lin
double max_vel_lin
Definition
display.h:60
MainWindow::ang_vel_step
double ang_vel_step
Definition
display.h:66
MainWindow::pressed_up
bool pressed_up
Definition
display.h:85
MainWindow::pressed_left
bool pressed_left
Definition
display.h:84
MainWindow::cur_vel_theta
double cur_vel_theta
Definition
display.h:64
MainWindow::cur_vel_lin_x
double cur_vel_lin_x
Definition
display.h:62
MainWindow::cur_vel_lin_y
double cur_vel_lin_y
Definition
display.h:63
MainWindow::pressed_turn_right
bool pressed_turn_right
Definition
display.h:89
MainWindow::lin_vel_step
double lin_vel_step
Definition
display.h:65
MainWindow::~MainWindow
~MainWindow()
MainWindow::pressed_down
bool pressed_down
Definition
display.h:86
MainWindow::yarp
yarp::os::Network yarp
Definition
display.h:34
MainWindow::pressed_right
bool pressed_right
Definition
display.h:87
MainWindow::keyReleaseEvent
void keyReleaseEvent(QKeyEvent *e) override
Definition
display.cpp:42
yarp::dev::MobileBaseVelocity
Definition
MobileBaseVelocity.h:23
yarp::os::Network
Utilities for manipulating the YARP network, including initialization and shutdown.
Definition
Network.h:706
yarp::os::Port
A mini-server for network communication.
Definition
Port.h:46
yarp::os::ResourceFinder
Helper class for finding config files and other external resources.
Definition
ResourceFinder.h:29
yarp::os::Stamp
An abstraction for a time stamp and/or sequence number.
Definition
Stamp.h:21
joywidget.h
YARP
3.11.100+20250603.4+gitaa77f8b5c
src
guis
yarpmobilebasegui
display.h
Generated on Wed Jun 4 2025 02:40:08 for YARP by
1.9.8