YARP
Yet Another Robot Platform
Loading...
Searching...
No Matches
main.cpp
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
#include "
mainwindow.h
"
7
#include <QApplication>
8
#include <
yarp/logger/YarpLogger.h
>
9
#include <
yarp/os/Os.h
>
10
#include <
yarp/os/Time.h
>
11
#include <cstdio>
12
#include <csignal>
13
14
static
void
sighandler
(
int
signal)
15
{
16
fprintf(stdout,
"This module cannot be closed with CTRL-C. Use <quit> menu to exit\n"
);
17
}
18
19
int
main
(
int
argc,
char
*argv[])
20
{
21
yarp::os::Network
yarp
(
yarp::os::YARP_CLOCK_SYSTEM
);
22
if
(!
yarp
.checkNetwork())
23
{
24
fprintf(stderr,
"ERROR: check YARP network.\n"
);
25
return
-1;
26
}
27
28
yarp::os::ResourceFinder
&rf =
yarp::os::ResourceFinder::getResourceFinderSingleton
();
29
rf.
setDefaultConfigFile
(
"yarprunLogger.ini"
);
//overridden by --from parameter
30
rf.
setDefaultContext
(
"yarprunLogger"
);
//overridden by --context parameter
31
rf.
configure
(argc,argv);
32
33
QApplication a(argc, argv);
// Eats the "--name" argument, therefore initialized after the ResourceFinder
34
35
bool
cannot_close = rf.
check
(
"no_stop"
);
36
if
(cannot_close)
37
{
38
std::signal(SIGINT,
sighandler
);
39
std::signal(SIGTERM,
sighandler
);
40
}
41
42
MainWindow
w;
43
w.show();
44
45
return
a.exec();
46
}
Os.h
Time.h
YarpLogger.h
MainWindow
MainWindow class.
Definition
display.h:22
yarp::os::Network
Utilities for manipulating the YARP network, including initialization and shutdown.
Definition
Network.h:706
yarp::os::ResourceFinder
Helper class for finding config files and other external resources.
Definition
ResourceFinder.h:29
yarp::os::ResourceFinder::check
bool check(const std::string &key) const override
Check if there exists a property of the given name.
Definition
ResourceFinder.cpp:903
yarp::os::ResourceFinder::setDefaultContext
bool setDefaultContext(const std::string &contextName)
Sets the context for the current ResourceFinder object.
Definition
ResourceFinder.h:60
yarp::os::ResourceFinder::configure
bool configure(int argc, char *argv[], bool skipFirstArgument=true)
Sets up the ResourceFinder.
Definition
ResourceFinder.cpp:786
yarp::os::ResourceFinder::getResourceFinderSingleton
static ResourceFinder & getResourceFinderSingleton()
Access a ResourceFinder singleton whose lifetime will match that of the YARP library.
Definition
ResourceFinder.cpp:959
yarp::os::ResourceFinder::setDefaultConfigFile
bool setDefaultConfigFile(const std::string &fname)
Provide a default value for the configuration file (can be overridden from command line with the –fro...
Definition
ResourceFinder.h:103
main
int main(int argc, char *argv[])
Definition
main.cpp:385
sighandler
static void sighandler(int signal)
Definition
main.cpp:14
yarp::os::YARP_CLOCK_SYSTEM
@ YARP_CLOCK_SYSTEM
Definition
Time.h:28
yarp
The main, catch-all namespace for YARP.
Definition
dirs.h:16
mainwindow.h
YARP
3.11.100+20250603.4+gitaa77f8b5c
src
guis
yarplogger
main.cpp
Generated on Wed Jun 4 2025 02:40:10 for YARP by
1.9.8