S Morita / mbed-mros2

Dependents:   mbed-os-example-mros2 example-mbed-mros2-sub-pose example-mbed-mros2-pub-twist example-mbed-mros2-mturtle-teleop

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers config_desktop.h Source File

config_desktop.h

00001 /*
00002 The MIT License
00003 Copyright (c) 2019 Lehrstuhl Informatik 11 - RWTH Aachen University
00004 Permission is hereby granted, free of charge, to any person obtaining a copy
00005 of this software and associated documentation files (the "Software"), to deal
00006 in the Software without restriction, including without limitation the rights
00007 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00008 copies of the Software, and to permit persons to whom the Software is
00009 furnished to do so, subject to the following conditions:
00010 The above copyright notice and this permission notice shall be included in
00011 all copies or substantial portions of the Software.
00012 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00013 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00014 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00015 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00016 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00017 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00018 THE SOFTWARE
00019 
00020 This file is part of embeddedRTPS.
00021 
00022 Author: i11 - Embedded Software, RWTH Aachen University
00023 */
00024 
00025 #ifndef RTPS_CONFIG_H
00026 #define RTPS_CONFIG_H
00027 
00028 #include "rtps/common/types.h"
00029 
00030 namespace rtps {
00031 
00032 #define IS_LITTLE_ENDIAN 1
00033 
00034 namespace Config {
00035 const VendorId_t VENDOR_ID = {13, 37};
00036 const std::array<uint8_t, 4> IP_ADDRESS = {
00037     192, 168, 0, 66}; // Needs to be set in lwipcfg.h too.
00038 const GuidPrefix_t BASE_GUID_PREFIX{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9};
00039 
00040 const uint8_t DOMAIN_ID = 0; // 230 possible with UDP
00041 const uint8_t MAX_NUM_PARTICIPANTS = 2;
00042 const uint8_t NUM_STATELESS_WRITERS =
00043     MAX_NUM_PARTICIPANTS + 1; // Required + Additional
00044 const uint8_t NUM_STATELESS_READERS =
00045     MAX_NUM_PARTICIPANTS + 1; // Required + Additional
00046 const uint8_t NUM_STATEFUL_READERS =
00047     4; // 1-4 required per participant depending on what they do and to whom
00048        // they match
00049 const uint8_t NUM_STATEFUL_WRITERS =
00050     4; // 1-4 required per participant depending on what they do and to whom
00051        // they match
00052 const uint8_t NUM_WRITERS_PER_PARTICIPANT = 4;
00053 const uint8_t NUM_READERS_PER_PARTICIPANT = 4;
00054 const uint8_t NUM_WRITER_PROXIES_PER_READER = 3;
00055 const uint8_t NUM_READER_PROXIES_PER_WRITER = 3;
00056 
00057 const uint8_t HISTORY_SIZE = 10;
00058 
00059 const uint8_t MAX_TYPENAME_LENGTH = 20;
00060 const uint8_t MAX_TOPICNAME_LENGTH = 20;
00061 
00062 const int HEARTBEAT_STACKSIZE = 1200;          // byte
00063 const int THREAD_POOL_WRITER_STACKSIZE = 1100; // byte
00064 const int THREAD_POOL_READER_STACKSIZE = 1600; // byte
00065 const uint16_t SPDP_WRITER_STACKSIZE = 550;    // byte
00066 
00067 const uint16_t SF_WRITER_HB_PERIOD_MS = 4000;
00068 const uint16_t SPDP_RESEND_PERIOD_MS = 10000;
00069 const uint8_t SPDP_WRITER_PRIO = 3;
00070 const uint8_t SPDP_MAX_NUMBER_FOUND_PARTICIPANTS = 5;
00071 const uint8_t SPDP_MAX_NUM_LOCATORS = 5;
00072 const Duration_t SPDP_LEASE_DURATION = {100, 0};
00073 
00074 const int MAX_NUM_UDP_CONNECTIONS = 10;
00075 
00076 const int THREAD_POOL_NUM_WRITERS = 2;
00077 const int THREAD_POOL_NUM_READERS = 2;
00078 const int THREAD_POOL_WRITER_PRIO = 3;
00079 const int THREAD_POOL_READER_PRIO = 3;
00080 const int THREAD_POOL_WORKLOAD_QUEUE_LENGTH = 10;
00081 
00082 constexpr int OVERALL_HEAP_SIZE =
00083     THREAD_POOL_NUM_WRITERS * THREAD_POOL_WRITER_STACKSIZE +
00084     THREAD_POOL_NUM_READERS * THREAD_POOL_READER_STACKSIZE +
00085     MAX_NUM_PARTICIPANTS * SPDP_WRITER_STACKSIZE +
00086     NUM_STATEFUL_WRITERS * HEARTBEAT_STACKSIZE;
00087 } // namespace Config
00088 } // namespace rtps
00089 
00090 #endif // RTPS_CONFIG_H