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.h Source File

config.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 
00035     namespace Config {
00036         const VendorId_t VENDOR_ID = {13, 37};
00037         const std::array<uint8_t, 4> IP_ADDRESS = {192,168,11,2};  // Needs to be set in Src/lwip.c too.
00038         const GuidPrefix_t BASE_GUID_PREFIX{1,2,3,4,5,6,7,8,9,10,12};
00039 
00040         const uint8_t DOMAIN_ID = 0; // 230 possible with UDP
00041         const uint8_t NUM_STATELESS_WRITERS = 2;
00042         const uint8_t NUM_STATELESS_READERS = 2;
00043         const uint8_t NUM_STATEFUL_READERS = 8;
00044         const uint8_t NUM_STATEFUL_WRITERS = 8;
00045         const uint8_t MAX_NUM_PARTICIPANTS = 1;
00046         const uint8_t NUM_WRITERS_PER_PARTICIPANT = 16;
00047         const uint8_t NUM_READERS_PER_PARTICIPANT = 16;
00048         const uint8_t NUM_WRITER_PROXIES_PER_READER = 3;
00049         const uint8_t NUM_READER_PROXIES_PER_WRITER = 3;
00050 
00051         const uint8_t HISTORY_SIZE = 10;
00052 
00053         const uint8_t MAX_TYPENAME_LENGTH = 40;
00054         const uint8_t MAX_TOPICNAME_LENGTH = 40;
00055 
00056         const int HEARTBEAT_STACKSIZE = 4096; // byte
00057         const int THREAD_POOL_WRITER_STACKSIZE = 4096; // byte
00058         const int THREAD_POOL_READER_STACKSIZE = 4096; // byte
00059         const uint16_t SPDP_WRITER_STACKSIZE = 4096; // byte
00060 
00061         const uint16_t SF_WRITER_HB_PERIOD_MS = 4000;
00062         const uint16_t SPDP_RESEND_PERIOD_MS = 10000;
00063         const uint8_t SPDP_WRITER_PRIO = 24;
00064         const uint8_t SPDP_MAX_NUMBER_FOUND_PARTICIPANTS = 5;
00065         const uint8_t SPDP_MAX_NUM_LOCATORS = 5;
00066         const Duration_t SPDP_LEASE_DURATION = {100, 0};
00067 
00068         const int MAX_NUM_UDP_CONNECTIONS = 10;
00069 
00070         const int THREAD_POOL_NUM_WRITERS = 1;
00071         const int THREAD_POOL_NUM_READERS = 1;
00072         const int THREAD_POOL_WRITER_PRIO = 24;
00073         const int THREAD_POOL_READER_PRIO = 24;
00074         const int THREAD_POOL_WORKLOAD_QUEUE_LENGTH = 20;
00075 
00076         constexpr int OVERALL_HEAP_SIZE =   THREAD_POOL_NUM_WRITERS * THREAD_POOL_WRITER_STACKSIZE +
00077                                             THREAD_POOL_NUM_READERS * THREAD_POOL_READER_STACKSIZE +
00078                                             MAX_NUM_PARTICIPANTS * SPDP_WRITER_STACKSIZE +
00079                                             NUM_STATEFUL_WRITERS * HEARTBEAT_STACKSIZE;
00080     }
00081 }
00082 
00083 #endif //RTPS_CONFIG_H