Revision 1fb06240

View differences:

README.txt
2 2
applications. It was developed as part of the software habitat for the
3 3
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
4 4

  
5
Copyright (C) 2018..2019  Thomas Schöpping et al.
5
Copyright (C) 2018..2020  Thomas Schöpping et al.
6 6
(a complete list of all authors is given below)
7 7

  
8 8
This program is free software: you can redistribute it and/or modify
......
25 25
Authors:
26 26
 - Thomas Schöpping          <tschoepp[at]cit-ec.uni-bielefeld.de>
27 27
 - Marc Rothmann             <mrothmann[at]techfak.uni-bielefeld.de>
28
 - Svenja Kenneweg	     <skenneweg[at]techfak.uni-bielefeld.de>
28 29

  
29 30
References:
30 31
 [1] S. Herbrechtsmeier, T. Korthals, T. Schopping and U. Rückert, "AMiRo: A
inc/urt_confcheck.h
3 3
applications. It was developed as part of the software habitat for the
4 4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5 5

  
6
Copyright (C) 2018..2019  Thomas Schöpping et al.
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7 7

  
8 8
This program is free software: you can redistribute it and/or modify
9 9
it under the terms of the GNU General Public License as published by
inc/urt_core.h
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
#ifndef URTWARE_CORE_H
23
#define URTWARE_CORE_H
24

  
25
/******************************************************************************/
26
/* CONSTANTS                                                                  */
27
/******************************************************************************/
28

  
29
/******************************************************************************/
30
/* SETTINGS                                                                   */
31
/******************************************************************************/
32

  
33
/******************************************************************************/
34
/* CHECKS                                                                     */
35
/******************************************************************************/
36

  
37
/******************************************************************************/
38
/* DATA STRUCTURES AND TYPES                                                  */
39
/******************************************************************************/
40

  
41
/******************************************************************************/
42
/* MACROS                                                                     */
43
/******************************************************************************/
44

  
45
/******************************************************************************/
46
/* EXTERN DECLARATIONS                                                        */
47
/******************************************************************************/
48

  
49
/******************************************************************************/
50
/* INLINE FUNCTIONS                                                           */
51
/******************************************************************************/
52

  
53
#endif /* URTWARE_CORE_H */
inc/urt_message.h
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
#ifndef URTWARE_MESSAGE_H
23
#define URTWARE_MESSAGE_H
24

  
25
/******************************************************************************/
26
/* CONSTANTS                                                                  */
27
/******************************************************************************/
28

  
29
/******************************************************************************/
30
/* SETTINGS                                                                   */
31
/******************************************************************************/
32

  
33
/******************************************************************************/
34
/* CHECKS                                                                     */
35
/******************************************************************************/
36

  
37
/******************************************************************************/
38
/* DATA STRUCTURES AND TYPES                                                  */
39
/******************************************************************************/
40

  
41
/******************************************************************************/
42
/* MACROS                                                                     */
43
/******************************************************************************/
44

  
45
/******************************************************************************/
46
/* EXTERN DECLARATIONS                                                        */
47
/******************************************************************************/
48

  
49
/******************************************************************************/
50
/* INLINE FUNCTIONS                                                           */
51
/******************************************************************************/
52

  
53
#endif /* URTWARE_MESSAGE_H */
inc/urt_node.h
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
#ifndef URTWARE_NODE_H
23
#define URTWARE_NODE_H
24

  
25
/******************************************************************************/
26
/* CONSTANTS                                                                  */
27
/******************************************************************************/
28

  
29
/******************************************************************************/
30
/* SETTINGS                                                                   */
31
/******************************************************************************/
32

  
33
/******************************************************************************/
34
/* CHECKS                                                                     */
35
/******************************************************************************/
36

  
37
/******************************************************************************/
38
/* DATA STRUCTURES AND TYPES                                                  */
39
/******************************************************************************/
40

  
41
/******************************************************************************/
42
/* MACROS                                                                     */
43
/******************************************************************************/
44

  
45
/******************************************************************************/
46
/* EXTERN DECLARATIONS                                                        */
47
/******************************************************************************/
48

  
49
/******************************************************************************/
50
/* INLINE FUNCTIONS                                                           */
51
/******************************************************************************/
52

  
53
#endif /* URTWARE_NODE_H */
inc/urt_publisher.h
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
#ifndef URTWARE_PUBLISHER_H
23
#define URTWARE_PUBLISHER_H
24

  
25
/******************************************************************************/
26
/* CONSTANTS                                                                  */
27
/******************************************************************************/
28

  
29
/******************************************************************************/
30
/* SETTINGS                                                                   */
31
/******************************************************************************/
32

  
33
/******************************************************************************/
34
/* CHECKS                                                                     */
35
/******************************************************************************/
36

  
37
/******************************************************************************/
38
/* DATA STRUCTURES AND TYPES                                                  */
39
/******************************************************************************/
40

  
41
/******************************************************************************/
42
/* MACROS                                                                     */
43
/******************************************************************************/
44

  
45
/******************************************************************************/
46
/* EXTERN DECLARATIONS                                                        */
47
/******************************************************************************/
48

  
49
/******************************************************************************/
50
/* INLINE FUNCTIONS                                                           */
51
/******************************************************************************/
52

  
53
#endif /* URTWARE_PUBLISHER_H */
inc/urt_service.h
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
#ifndef URTWARE_SERVICE_H
23
#define URTWARE_SERVICE_H
24

  
25
/******************************************************************************/
26
/* CONSTANTS                                                                  */
27
/******************************************************************************/
28

  
29
/******************************************************************************/
30
/* SETTINGS                                                                   */
31
/******************************************************************************/
32

  
33
/******************************************************************************/
34
/* CHECKS                                                                     */
35
/******************************************************************************/
36

  
37
/******************************************************************************/
38
/* DATA STRUCTURES AND TYPES                                                  */
39
/******************************************************************************/
40

  
41
/******************************************************************************/
42
/* MACROS                                                                     */
43
/******************************************************************************/
44

  
45
/******************************************************************************/
46
/* EXTERN DECLARATIONS                                                        */
47
/******************************************************************************/
48

  
49
/******************************************************************************/
50
/* INLINE FUNCTIONS                                                           */
51
/******************************************************************************/
52

  
53
#endif /* URTWARE_SERVICE_H */
inc/urt_subscriber.h
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
#ifndef URTWARE_SUBSCRIBER_H
23
#define URTWARE_SUBSCRIBER_H
24

  
25
#include <urt_types.h>
26

  
27
/******************************************************************************/
28
/* CONSTANTS                                                                  */
29
/******************************************************************************/
30

  
31
/******************************************************************************/
32
/* SETTINGS                                                                   */
33
/******************************************************************************/
34

  
35
/******************************************************************************/
36
/* CHECKS                                                                     */
37
/******************************************************************************/
38

  
39
/******************************************************************************/
40
/* DATA STRUCTURES AND TYPES                                                  */
41
/******************************************************************************/
42

  
43
/**
44
 * @brief  Base subscriber
45
 * @details The base subscriber is included in each specialized subscriber
46
 */
47
typedef struct urt_basesubscriber
48
{
49
    urt_topic_t* topic;
50
    urt_osEventListener_t evtListener;
51
    urt_message_t* lastMessage;
52
    urt_osTime_t lastMessageTime;
53
    #if (URT_CFG_PUBSUB_PROFILING)
54
        uint64_t sumLatencies;
55
        uint64_t numMessagesReceived;
56
    #endif /* URT_CFG_PUBSUB_PROFILING */
57
}urt_basesubscriber_t;
58

  
59
/**
60
 * @brief  nrt subscriber
61
 */
62
typedef struct urt_nrtsubscriber
63
{
64
    urt_basesubscriber_t base;
65
    #if (URT_CFG_PUBSUB_PROFILING)
66
        urt_delay_t minLatency;
67
        urt_delay_t maxLatency;
68
    #endif /* URT_CFG_PUBSUB_PROFILING */
69
}urt_nrtsubscriber_t;
70

  
71
/**
72
 * @brief  nrt subscriber
73
 */
74
typedef struct urt_srtsubscriber
75
{
76
    urt_basesubscriber_t base;
77
    urt_srtusefulnessfunc_t* usefulnesscb;
78
    #if (URT_CFG_PUBSUB_PROFILING)
79
        urt_delay_t minLatency;
80
        urt_delay_t maxLatency;
81
    #endif /* URT_CFG_PUBSUB_PROFILING */
82
}urt_srtsubscriber_t;
83

  
84
/**
85
 * @brief  nrt subscriber
86
 */
87
typedef struct urt_frtsubscriber
88
{
89
    urt_basesubscriber_t base;
90
    #if (URT_CFG_PUBSUB_QOS_DEADLINECHECKS)
91
        urt_delay_t deadlineOffset;
92
    #endif /* URT_CFG_PUBSUB_QOS_DEADLINECHECKS */
93
    #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS)
94
        urt_delay_t maxJitter;
95
    #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS */
96
    #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING)
97
        urt_delay_t minLatency;
98
        urt_delay_t maxLatency;
99
    #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING */
100
}urt_frtsubscriber_t;
101

  
102
/**
103
 * @brief  nrt subscriber
104
 */
105
typedef struct urt_hrtsubscriber
106
{
107
    urt_basesubscriber_t base;
108
    urt_hrtsubscriber_t* next;
109
    #if (URT_CFG_PUBSUB_QOS_DEADLINECHECKS)
110
        urt_delay_t deadlineOffset;
111
        urt_osTimer_t qosDeadlineTimer;
112
    #endif /* URT_CFG_PUBSUB_QOS_DEADLINECHECKS */
113
    #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS)
114
        urt_delay_t maxJitter;
115
    #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS */
116
    #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING)
117
        urt_delay_t minLatency;
118
        urt_delay_t maxLatency;
119
    #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING */
120
    #if (URT_CFG_PUBSUB_QOS_RATECHECKS)
121
        urt_delay_t expectedRate;
122
    #endif /* URT_CFG_PUBSUB_QOS_RATECHECKS */
123
}urt_hrtsubscriber_t;
124

  
125
/******************************************************************************/
126
/* MACROS                                                                     */
127
/******************************************************************************/
128

  
129
/******************************************************************************/
130
/* EXTERN DECLARATIONS                                                        */
131
/******************************************************************************/
132

  
133
#if defined(__cplusplus)
134
extern "C" {
135
#endif /* defined(__cplusplus) */
136

  
137
    void urtNrtSubscriberInit();
138
    urt_status_t urtNrtSubscriberSubscribe();
139
    urt_status_t urtNrtSubscriberFetchNextMessage();
140
    urt_status_t urtNrtSubscriberFetchLatestMessage();
141
    urt_status_t urtNrtSubscriberUnsubscribe();
142

  
143
    void urtSrtSubscriberInit();
144
    urt_status_t urtSrtSubscriberSubscribe();
145
    urt_status_t urtSrtSubscriberFetchNextMessage();
146
    urt_status_t urtSrtSubscriberFetchLatestMessage();
147
    urt_status_t urtSrtSubscriberCalculateUsefulness();
148
    urt_status_t urtSrtSubscriberUnsubscribe();
149

  
150
    void urtFrtSubscriberInit();
151
    urt_status_t urtFrtSubscriberSubscribe();
152
    urt_status_t urtFrtSubscriberFetchNextMessage();
153
    urt_status_t urtFrtSubscriberFetchLatestMessage();
154
    bool urtFrtSubscriberCalculateValidity();
155
    urt_status_t urtFrtSubscriberUnsubscribe();
156

  
157
    void urtHrtSubscriberInit();
158
    urt_status_t urtHrtSubscriberSubscribe();
159
    urt_status_t urtHrtSubscriberFetchNextMessage();
160
    urt_status_t urtHrtSubscriberFetchLatestMessage();
161
    urt_status_t urtHrtSubscriberUnsubscribe();
162

  
163
    float urt_srtusefulnessfunc_t();
164
#if defined(__cplusplus)
165
}
166
#endif /* defined(__cplusplus) */
167

  
168
/******************************************************************************/
169
/* INLINE FUNCTIONS                                                           */
170
/******************************************************************************/
171

  
172
#endif /* URTWARE_SUBSCRIBER_H */
inc/urt_topic.h
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
#ifndef URTWARE_TOPIC_H
23
#define URTWARE_TOPIC_H
24

  
25
/******************************************************************************/
26
/* CONSTANTS                                                                  */
27
/******************************************************************************/
28

  
29
/******************************************************************************/
30
/* SETTINGS                                                                   */
31
/******************************************************************************/
32

  
33
/******************************************************************************/
34
/* CHECKS                                                                     */
35
/******************************************************************************/
36

  
37
/******************************************************************************/
38
/* DATA STRUCTURES AND TYPES                                                  */
39
/******************************************************************************/
40

  
41
/******************************************************************************/
42
/* MACROS                                                                     */
43
/******************************************************************************/
44

  
45
/******************************************************************************/
46
/* EXTERN DECLARATIONS                                                        */
47
/******************************************************************************/
48

  
49
/******************************************************************************/
50
/* INLINE FUNCTIONS                                                           */
51
/******************************************************************************/
52

  
53
#endif /* URTWARE_TOPIC_H */
setup.sh
1
################################################################################
2
# AMiRo-Apps is a collection of applications for the Autonomous Mini Robot     #
3
# (AMiRo) platform.                                                            #
4
# Copyright (C) 2018..2019  Thomas Schöpping et al.                            #
5
#                                                                              #
6
# This program is free software: you can redistribute it and/or modify         #
7
# it under the terms of the GNU General Public License as published by         #
8
# the Free Software Foundation, either version 3 of the License, or            #
9
# (at your option) any later version.                                          #
10
#                                                                              #
11
# This program is distributed in the hope that it will be useful,              #
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
14
# GNU General Public License for more details.                                 #
15
#                                                                              #
16
# You should have received a copy of the GNU General Public License            #
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.        #
18
#                                                                              #
19
# This research/work was supported by the Cluster of Excellence Cognitive      #
20
# Interaction Technology 'CITEC' (EXC 277) at Bielefeld University, which is   #
21
# funded by the German Research Foundation (DFG).                              #
22
################################################################################
23

  
24
#!/bin/bash
25

  
26
# load library
27
source "$(dirname ${BASH_SOURCE[0]})/tools/bash/setuplib.sh"
28

  
29
### print welcome text #########################################################
30
# Prints a welcome message to standard out.
31
#
32
# usage:      printWelcomeText
33
# arguments:  n/a
34
# return:     n/a
35
#
36
function printWelcomeText {
37
  printf "######################################################################\n"
38
  printf "#                                                                    #\n"
39
  printf "#                  Welcome to the AMiRo-Apps setup!                  #\n"
40
  printf "#                                                                    #\n"
41
  printf "######################################################################\n"
42
  printf "#                                                                    #\n"
43
  printf "# Copyright (c) 2018..2019  Thomas Schöpping                         #\n"
44
  printf "#                                                                    #\n"
45
  printf "# This is free software; see the source for copying conditions.      #\n"
46
  printf "# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR  #\n"
47
  printf "# A PARTICULAR PURPOSE. The development of this software was         #\n"
48
  printf "# supported by the Excellence Cluster EXC 227 Cognitive Interaction  #\n"
49
  printf "# Technology. The Excellence Cluster EXC 227 is a grant of the       #\n"
50
  printf "# Deutsche Forschungsgemeinschaft (DFG) in the context of the German #\n"
51
  printf "# Excellence Initiative.                                             #\n"
52
  printf "#                                                                    #\n"
53
  printf "######################################################################\n"
54
}
55

  
56
### print help #################################################################
57
# Prints a help text to standard out.
58
#
59
# usage:      printHelp
60
# arguments:  n/a
61
# return:     n/a
62
#
63
function printHelp {
64
  printInfo "printing help text\n"
65
  printf "usage:    $(basename ${BASH_SOURCE[0]}) [-h|--help] [-i|--init] [-k|--kernel] [-b|--bootloader] [-p|--periphery-LLD] [-m|--middleware] [-c|--compiler] [--IDE] [-q|--quit] [--log=<file>]\n"
66
  printf "\n"
67
  printf "options:  -h, --help\n"
68
  printf "              Print this help text.\n"
69
  printf "          --IDE\n"
70
  printf "              Enter IDE setup.\n"
71
  printf "          -q, --quit\n"
72
  printf "              Quit the script.\n"
73
}
74

  
75
### enter IDE setup ############################################################
76
# Enter IDE setup.
77
#
78
# usage:      ideSetup
79
# arguments:  n/a
80
# return:     n/a
81
#
82
function ideSetup {
83
  printInfo "entering IDE setup\n"
84
  $(dirname $(realpath ${BASH_SOURCE[0]}))/tools/ide/idesetup.sh
85
}
86

  
87
### main function of this script ###############################################
88
# Provides functions for project initialization, configuration of IDE and
89
# compiler setup, as well as entry points to the several Git submodules.
90
#
91
# usage:      see function printHelp
92
# arguments:  see function printHelp
93
# return:     0
94
#                 No error or warning occurred.
95
#
96
function main {
97
  # print welcome/info text if not suppressed
98
  if [[ $@ != *"--noinfo"* ]]; then
99
    printWelcomeText
100
  else
101
    printf "######################################################################\n"
102
  fi
103
  printf "\n"
104

  
105
  # if --help or -h was specified, print the help text and exit
106
  if [[ $@ == *"--help"* || $@ == *"-h"* ]]; then
107
    printHelp
108
    printf "\n"
109
    quitScript
110
  fi
111

  
112
  # parse arguments
113
  local otherargs=()
114
  while [ $# -gt 0 ]; do
115
    if ( parseIsOption $1 ); then
116
      case "$1" in
117
        -h|--help) # already handled; ignore
118
          shift 1;;
119
        --IDE)
120
           ideSetup; printf "\n"; shift 1;;
121
        -q|--quit)
122
          quitScript; shift 1;;
123
        *)
124
          printError "invalid option: $1\n"; shift 1;;
125
      esac
126
    else
127
      otherargs+=("$1")
128
      shift 1
129
    fi
130
  done
131

  
132
  # interactive menu
133
  while ( true ); do
134
    # main menu info prompt and selection
135
    printInfo "AMiRo-Apps main menu\n"
136
    printf "Please select one of the following actions:\n"
137
    printf "  [E] - enter IDE project setup\n"
138
    printf "  [Q] - quit this setup\n"
139
    local userinput=""
140
    readUserInput "IiOoMmCcEeQq" userinput
141
    printf "\n"
142

  
143
    # evaluate user selection
144
    case "$userinput" in
145
      E|e)
146
        ideSetup; printf "\n";;
147
      Q|q)
148
        quitScript;;
149
      *) # sanity check (exit with error)
150
        printError "unexpected argument: $userinput\n";;
151
    esac
152
  done
153

  
154
  exit 0
155
}
156

  
157
################################################################################
158
# SCRIPT ENTRY POINT                                                           #
159
################################################################################
160

  
161
main "$@"
src/subscriber/nrtsubscriber.c
1
#include "subscriber.h"
2

  
3
void urtNrtSubscriberInit (urt_nrtsubscriber_t* subscriber) {}
4

  
5
urt_status_t urtNrtSubscriberSubscribe (urt_nrtsubscriber_t* subscriber, urt_topic_t* topic, urt_message_t* messages) {
6
  return 0;
7
}
8

  
9
urt_status_t urtNrtSubscriberFetchNextMessage (urt_nrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency) {
10
  return 0;
11
}
12

  
13
urt_status_t urtNrtSubscriberFetchLatestMessage (urt_nrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency) {
14
  return 0;
15
}
16

  
17
urt_status_t urtNrtSubscriberUnsubscribe (urt_nrtsubscriber_t* subscriber) {
18
  return 0;
19
}
20

  
21
int main () {
22
 return 0;
23
}
src/subscriber/subscriber.h
1
#ifndef SUBSCRIBER_H_
2
#define SUBSCRIBER_H_
3
#define URT_CFG_PUBSUB_PROFILING 0
4

  
5
// Base subscriber which is included in each specialised subscriber
6
struct urt_basesubscriber_t {
7
  urt_topic_t *topic;
8
  urt_osEventListener_t evtListener;
9
  urt_message_t *lastMessage;
10
  urt_osTime_t lastMessageTime;
11
  #if (URT_CFG_PUBSUB_PROFILING)
12
    uint64_t sumLatencies;
13
    uint64_t numMessagesReceived;
14
  #endif /* URT_CFG_PUBSUB_PROFILING */
15
};
16

  
17
struct urt_nrtsubscriber_t {
18
  struct urt_basesubscriber_t base;
19
  #if (URT_CFG_PUBSUB_PROFILING)
20
    urt_delay_t minLatency;
21
    urt_delay_t maxLatency;
22
  #endif /* URT_CFG_PUBSUB_PROFILING */
23
};
24

  
25
#endif /* SUBSCRIBER_H_ */
src/todo.txt
1
todo
src/urt_core.c
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
/******************************************************************************/
23
/* LOCAL DEFINITIONS                                                          */
24
/******************************************************************************/
25

  
26
/******************************************************************************/
27
/* EXPORTED VARIABLES                                                         */
28
/******************************************************************************/
29

  
30
/******************************************************************************/
31
/* LOCAL TYPES                                                                */
32
/******************************************************************************/
33

  
34
/******************************************************************************/
35
/* LOCAL VARIABLES                                                            */
36
/******************************************************************************/
37

  
38
/******************************************************************************/
39
/* LOCAL FUNCTIONS                                                            */
40
/******************************************************************************/
41

  
42
/******************************************************************************/
43
/* EXPORTED FUNCTIONS                                                         */
44
/******************************************************************************/
src/urt_message.c
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
/******************************************************************************/
23
/* LOCAL DEFINITIONS                                                          */
24
/******************************************************************************/
25

  
26
/******************************************************************************/
27
/* EXPORTED VARIABLES                                                         */
28
/******************************************************************************/
29

  
30
/******************************************************************************/
31
/* LOCAL TYPES                                                                */
32
/******************************************************************************/
33

  
34
/******************************************************************************/
35
/* LOCAL VARIABLES                                                            */
36
/******************************************************************************/
37

  
38
/******************************************************************************/
39
/* LOCAL FUNCTIONS                                                            */
40
/******************************************************************************/
41

  
42
/******************************************************************************/
43
/* EXPORTED FUNCTIONS                                                         */
44
/******************************************************************************/
src/urt_node.c
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
/******************************************************************************/
23
/* LOCAL DEFINITIONS                                                          */
24
/******************************************************************************/
25

  
26
/******************************************************************************/
27
/* EXPORTED VARIABLES                                                         */
28
/******************************************************************************/
29

  
30
/******************************************************************************/
31
/* LOCAL TYPES                                                                */
32
/******************************************************************************/
33

  
34
/******************************************************************************/
35
/* LOCAL VARIABLES                                                            */
36
/******************************************************************************/
37

  
38
/******************************************************************************/
39
/* LOCAL FUNCTIONS                                                            */
40
/******************************************************************************/
41

  
42
/******************************************************************************/
43
/* EXPORTED FUNCTIONS                                                         */
44
/******************************************************************************/
src/urt_publisher.c
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
/******************************************************************************/
23
/* LOCAL DEFINITIONS                                                          */
24
/******************************************************************************/
25

  
26
/******************************************************************************/
27
/* EXPORTED VARIABLES                                                         */
28
/******************************************************************************/
29

  
30
/******************************************************************************/
31
/* LOCAL TYPES                                                                */
32
/******************************************************************************/
33

  
34
/******************************************************************************/
35
/* LOCAL VARIABLES                                                            */
36
/******************************************************************************/
37

  
38
/******************************************************************************/
39
/* LOCAL FUNCTIONS                                                            */
40
/******************************************************************************/
41

  
42
/******************************************************************************/
43
/* EXPORTED FUNCTIONS                                                         */
44
/******************************************************************************/
src/urt_service.c
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
/******************************************************************************/
23
/* LOCAL DEFINITIONS                                                          */
24
/******************************************************************************/
25

  
26
/******************************************************************************/
27
/* EXPORTED VARIABLES                                                         */
28
/******************************************************************************/
29

  
30
/******************************************************************************/
31
/* LOCAL TYPES                                                                */
32
/******************************************************************************/
33

  
34
/******************************************************************************/
35
/* LOCAL VARIABLES                                                            */
36
/******************************************************************************/
37

  
38
/******************************************************************************/
39
/* LOCAL FUNCTIONS                                                            */
40
/******************************************************************************/
41

  
42
/******************************************************************************/
43
/* EXPORTED FUNCTIONS                                                         */
44
/******************************************************************************/
src/urt_subscriber.c
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
/******************************************************************************/
23
/* LOCAL DEFINITIONS                                                          */
24
/******************************************************************************/
25

  
26
/******************************************************************************/
27
/* EXPORTED VARIABLES                                                         */
28
/******************************************************************************/
29

  
30
/******************************************************************************/
31
/* LOCAL TYPES                                                                */
32
/******************************************************************************/
33

  
34
/******************************************************************************/
35
/* LOCAL VARIABLES                                                            */
36
/******************************************************************************/
37

  
38
/******************************************************************************/
39
/* LOCAL FUNCTIONS                                                            */
40
/******************************************************************************/
41

  
42
/******************************************************************************/
43
/* EXPORTED FUNCTIONS                                                         */
44
/******************************************************************************/
45
#include "subscriber.h"
46

  
47
void urtNrtSubscriberInit (urt_nrtsubscriber_t* subscriber) {}
48

  
49
urt_status_t urtNrtSubscriberSubscribe (urt_nrtsubscriber_t* subscriber, urt_topic_t* topic, urt_message_t* messages) {
50
  return 1;
51
}
52

  
53
urt_status_t urtNrtSubscriberFetchNextMessage (urt_nrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency) {
54
  return 0;
55
}
56

  
57
urt_status_t urtNrtSubscriberFetchLatestMessage (urt_nrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency) {
58
  return 0;
59
}
60

  
61
urt_status_t urtNrtSubscriberUnsubscribe (urt_nrtsubscriber_t* subscriber) {
62
  return 0;
63
}
64

  
65
int main () {
66
 return 0;
67
}
src/urt_topic.c
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
/******************************************************************************/
23
/* LOCAL DEFINITIONS                                                          */
24
/******************************************************************************/
25

  
26
/******************************************************************************/
27
/* EXPORTED VARIABLES                                                         */
28
/******************************************************************************/
29

  
30
/******************************************************************************/
31
/* LOCAL TYPES                                                                */
32
/******************************************************************************/
33

  
34
/******************************************************************************/
35
/* LOCAL VARIABLES                                                            */
36
/******************************************************************************/
37

  
38
/******************************************************************************/
39
/* LOCAL FUNCTIONS                                                            */
40
/******************************************************************************/
41

  
42
/******************************************************************************/
43
/* EXPORTED FUNCTIONS                                                         */
44
/******************************************************************************/
tools/bash/setuplib.sh
1
################################################################################
2
# AMiRo-uRtWare is a collection of applications for the Autonomous Mini Robot     #
3
# (AMiRo) platform.                                                            #
4
# Copyright (C) 2016..2020  Thomas Schöpping et al.                            #
5
#                                                                              #
6
# This program is free software: you can redistribute it and/or modify         #
7
# it under the terms of the GNU General Public License as published by         #
8
# the Free Software Foundation, either version 3 of the License, or            #
9
# (at your option) any later version.                                          #
10
#                                                                              #
11
# This program is distributed in the hope that it will be useful,              #
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
14
# GNU General Public License for more details.                                 #
15
#                                                                              #
16
# You should have received a copy of the GNU General Public License            #
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.        #
18
#                                                                              #
19
# This research/work was supported by the Cluster of Excellence Cognitive      #
20
# Interaction Technology 'CITEC' (EXC 277) at Bielefeld University, which is   #
21
# funded by the German Research Foundation (DFG).                              #
22
################################################################################
23

  
24
### print an error message #####################################################
25
# Prints a error <message> to standard output.
26
#If variable 'LOG_FILE' is specified, the message is also appended to the given file.
27
#
28
# usage:      printError <message>
29
# arguments:  <message>
30
#                 Message string to print.
31
# return:     n/a
32
#
33
function printError {
34
  local string="ERROR:   $1"
35
  # if a log file is specified
36
  if [ -n "$LOG_FILE" ]; then
37
    printf "[$(date '+%Y-%m-%d %H:%M:%S')] $string" >> $LOG_FILE
38
  fi
39
  printf "$(tput setaf 1)>>> $string$(tput sgr 0)" 1>&2
40
}
41

  
42
### print a warning message ####################################################
43
# Prints a warning <message> to standard output.
44
#If variable 'LOG_FILE' is specified, the message is also appended to the given file.
45
#
46
# usage:      printMessage <message>
47
# arguments:  <message>
48
#                 Message string to print.
49
# return:     n/a
50
#
51
function printWarning {
52
  local string="WARNING: $1"
53
  # if a log file is specified
54
  if [ -n "$LOG_FILE" ]; then
55
    printf "[$(date '+%Y-%m-%d %H:%M:%S')] $string" >> $LOG_FILE
56
  fi
57
  printf "$(tput setaf 3)>>> $string$(tput sgr 0)"
58
}
59

  
60
### print an information message ###############################################
61
# Prints an information <message> to standard output.
62
#If variable 'LOG_FILE' is specified, the message is also appended to the given file.
63
#
64
# usage:      printInfo <message>
65
# arguments:  <message>
66
#                 Message string to print.
67
# return:     n/a
68
#
69
function printInfo {
70
  local string="INFO:    $1"
71
  # if a log file is specified
72
  if [ -n "$LOG_FILE" ]; then
73
    printf "[$(date '+%Y-%m-%d %H:%M:%S')] $string" >> $LOG_FILE
74
  fi
75
  printf "$(tput setaf 2)>>> $string$(tput sgr 0)"
76
}
77

  
78
### print a message to file ####################################################
79
# Appends a <message> to a log file, specified by the variable 'LOG_FILE'.
80
#
81
# usage       printLog <message>
82
# arguments:  <message>
83
#                 Message string to print.
84
# return:     n/a
85
#
86
function printLog {
87
  local string="LOG:     $1"
88
  # if a log file is specified
89
  if [ -n "$LOG_FILE" ]; then
90
    printf "[$(date '+%Y-%m-%d %H:%M:%S')] $string" >> $LOG_FILE
91
  fi
92
}
93

  
94
### exit the script normally ###################################################
95
# Prints a delimiter and exits the script normally (returns 0).
96
#
97
# usage:      quitScript
98
# arguments:  n/a
99
# return:     0
100
#                 No error or warning occurred.
101
#
102
function quitScript {
103
  if [ ! -z ${BASH_SOURCE[1]} ]; then
104
    printInfo "exiting $(realpath --relative-to="${PWD}" "${BASH_SOURCE[1]}")\n"
105
    printf "\n"
106
  fi
107
  printf "######################################################################\n"
108
  exit 0
109
}
110

  
111
### read a user input ##########################################################
112
# Reads a single character user input from a set up <options> and stores it in
113
# a given <return> variable.
114
#
115
# usage:      readUserInput <options> <return>
116
# arguments:  <options>
117
#                 String definiing the set of valid characters.
118
#                 If the string is empty, the user can input any character.
119
#             <return>
120
#                 Variable to store the selected character to.
121
# return:     n/a
122
#
123
function readUserInput {
124
  local input=""
125
  # read user input
126
  while [ -z $input ] || ( [ -n "$1" ] && [[ ! $input =~ ^[$1]$ ]] ); do
127
    read -p "your selection: " -n 1 -e input
128
    if [ -z $input ] || ( [ -n "$1" ] && [[ ! $input =~ ^[$1]$ ]] ); then
129
      printWarning "[$input] is no valid action\n"
130
    fi
131
  done
132
  printLog "[$input] has been selected\n"
133
  eval $2="$input"
134
}
135

  
136
### check whether argument is an option ########################################
137
# Checks a <string> whether it is an option.
138
# Options are defined to either start with '--' followed by any string, or
139
# to start with a single '-' followed by a single character, or
140
# to start with a single '-' followed by a single character, a '=' and any string.
141
# Examples: '--option', '--option=arg', '-o', '-o=arg', '--'
142
#
143
# usage:      parseIsOption <string>
144
# arguments:  <string>
145
#                 A string to check whether it is an option.
146
# return:     0
147
#                 <string> is an option.
148
#             -1
149
#                 <string> is not an option.
150
#
151
function parseIsOption {
152
  if [[ "$1" =~ ^-(.$|.=.*) ]] || [[ "$1" =~ ^--.* ]]; then
153
    return 0
154
  else
155
    return -1
156
  fi
157
}
158

  
159
### set the log file ###########################################################
160
# Sets a specified <infile> as log file and checks whether it already exists.
161
# If so, the log may either be appended to the file, its content can be cleared,
162
# or no log is generated at all.
163
# The resulting path is stored in <outvar>.
164
#
165
# usage:      setLogFile [--option=<option>] [--quiet] <infile> <outvar>
166
# arguments:  --option=<option>
167
#                 Select what to do if <file> already exists.
168
#                 Possible values are 'a', 'c', 'r' and 'n'.
169
#                 - a: append (starts with a separator)
170
#                 - c: continue (does not insert a seperator)
171
#                 - r: delete and restart
172
#                 - n: no log
173
#                 If no option is secified but <file> exists, an interactive selection is provided.
174
#             --quiet
175
#                 Suppress all messages.
176
#             <infile>
177
#                 Path of the wanted log file.
178
#             <outvar>
179
#                 Variable to store the path of the log file to.
180
# return:     0
181
#                 No error or warning occurred.
182
#             -1
183
#                 Error: invalid input
184
#
185
function setLogFile {
186
  local filepath=""
187
  local option=""
188
  local quiet=false
189

  
190
  # parse arguments
191
  local otherargs=()
192
  while [ $# -gt 0 ]; do
193
    if ( parseIsOption $1 ); then
194
      case "$1" in
195
        -o=*|--option=*)
196
          option=${1#*=}; shift 1;;
197
        -o*|--option*)
198
          option="$2"; shift 2;;
199
        -q|--quiet)
200
          quiet=true; shift 1;;
201
        *)
202
          printError "invalid option: $1\n"; shift 1;;
203
      esac
204
    else
205
      otherargs+=("$1")
206
      shift 1
207
    fi
208
  done
209
  filepath=$(realpath ${otherargs[0]})
210

  
211
  # if file already exists
212
  if [ -e $filepath ]; then
213
    # if no option was specified, ask what to do
214
    if [ -z "$option" ]; then
215
      printWarning "log file $filepath already esists\n"
216
      local userinput=""
217
      printf "Select what to do:\n"
218
      printf "  [A] - append log\n"
219
      printf "  [R] - restart log (delete existing file)\n"
220
      printf "  [N] - no log\n"
221
      readUserInput "AaRrNn" userinput
222
      option=${userinput,,}
223
    fi
224
    # evaluate option
225
    case "$option" in
226
      a|c)
227
        if [ $quiet = false ]; then
228
          printInfo "appending log to $filepath\n"
229
        fi
230
        if [ $option != c ]; then
231
          printf "\n" >> $filepath
232
          printf "######################################################################\n" >> $filepath
233
          printf "\n" >> $filepath
234
        fi
235
        ;;
236
      r)
237
        echo -n "" > $filepath
238
        if [ $quiet = false ]; then
239
          printInfo "content of $filepath wiped\n"
240
        fi
241
        ;;
242
      n)
243
        if [ $quiet = false ]; then
244
          printInfo "no log file will be generated\n"
245
        fi
246
        filepath=""
247
        ;;
248
      *) # sanity check (return error)
249
        printError "unexpected argument: $option\n"; return -1;;
250
    esac
251
  else
252
    if [ $quiet = false ]; then
253
      printInfo "log file set to $filepath\n"
254
    fi
255
  fi
256

  
257
  eval ${otherargs[1]}="$filepath"
258

  
259
  return 0
260
}
261

  
262
### check whether commands are available #######################################
263
# Checks whether the specified commands are available and can be executed.
264
#
265
# usage:      checkCommands [<command> <command> ...]
266
# arguments:  <command>
267
#                 Name of the command to check.
268
# return:     0
269
#                 All requested commands are available.
270
#             >0
271
#                 Number of requested commands that were not found.
272
#             -1
273
#                 No argument given.
274
#
275
function checkCommands {
276
  local status=0
277

  
278
  # return if no argument was specified
279
  if [ $# -eq 0 ]; then
280
    return -1
281
  fi
282

  
283
  # check all specified commands
284
  while [ $# -gt 0 ]; do
285
    command -v $1 &>/dev/null
286
    if [ $? -ne 0 ]; then
287
      printWarning "Command '$1' not available.\n"
288
      status=$((status + 1))
289
    fi
290
    shift 1
291
  done
292

  
293
  return $status
294
}
tools/ide/QtCreator/QtCreatorSetup.sh
1
################################################################################
2
# AMiRo-uRtWare is a collection of applications and configurations for the     #
3
# Autonomous Mini Robot (AMiRo).                                               #
4
# Copyright (C) 2018..2020  Thomas Schöpping et al.                            #
5
#                                                                              #
6
# This program is free software: you can redistribute it and/or modify         #
7
# it under the terms of the GNU General Public License as published by         #
8
# the Free Software Foundation, either version 3 of the License, or            #
9
# (at your option) any later version.                                          #
10
#                                                                              #
11
# This program is distributed in the hope that it will be useful,              #
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
14
# GNU General Public License for more details.                                 #
15
#                                                                              #
16
# You should have received a copy of the GNU General Public License            #
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff