Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

move config.h from mros2/embeddedRTPS/include/rtps/ #4

Merged
merged 4 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ execute_process(COMMAND git submodule update --init --recursive
add_library(mros2 INTERFACE)
add_subdirectory(mros2)

set(RTPS_CONFIG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include")

target_include_directories(
mros2-mbed
PRIVATE ${RTPS_CONFIG_INCLUDE_DIR}
)

mbed_set_post_build(${APP_TARGET})

option(VERBOSE_BUILD "Have a verbose build process")
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Please also check [mros2 repository](https://github.com/mROS-base/mros2) for mor
For now, these boards below are confirmed to run the example on them.
- [STM32 NUCLEO-F429ZI](https://www.st.com/en/evaluation-tools/nucleo-f429zi.html)
- [STM32 NUCLEO-F767ZI](https://www.st.com/en/evaluation-tools/nucleo-f767zi.html)

- [Seeed Arch Max V1.1](https://wiki.seeedstudio.com/Arch_Max_v1.1/)
- Kernel: [Mbed OS 6](https://github.com/ARMmbed/mbed-os)
- Host environment
- [ROS 2 Foxy Fitzroy](https://docs.ros.org/en/foxy/index.html) on Ubuntu 20.04 LTS
Expand All @@ -25,22 +25,29 @@ Please also check [mros2 repository](https://github.com/mROS-base/mros2) for mor
- PC having an Ethernet port whose IP address is 192.168.11.x(x is not 2) and a docker environment.
- Mbed board having an Ethernet port(listed above).
2. Build Mbed executable binary using Mbed CLI2.
(Please replace F429ZI with F767ZI if you use F767ZI)
```
git clone https://github.com/mROS-base/mros2-mbed
cd mros2-mbed
#(Please replace the [TARGET] with the ones as below.)
# +-------------------+---------------+
# | Your target board | [TARGET] |
# +-------------------+---------------+
# | NUCLEO-F429ZI | NUCLEO_F429ZI |
# | NUCLEO-F767ZI | NUCLEO_F767ZI |
# | Arch Max v1.1 | ARCH_MAX |
# +-------------------+---------------+
docker run --rm -it --mount=type=bind,source="$(pwd)",destination=/var/mbed -w /var/mbed \
ghcr.io/armmbed/mbed-os-env \
/bin/bash -c "mbed-tools deploy && mbed-tools compile -m NUCLEO_F429ZI -t GCC_ARM"
/bin/bash -c "mbed-tools deploy && mbed-tools compile -m [TARGET] -t GCC_ARM"
```
After that, you will find an executable binary is created in the path below.
```
cmake_build/NUCLEO_F429ZI/develop/GCC_ARM/mros2-mbed.bin
cmake_build/[TARGET]/develop/GCC_ARM/mros2-mbed.bin
```
3. Connect the PC and Mbed Board with USB and LAN cables.
4. Open Serial Console of the Mbed board. (115200bps)
5. Copy the executable binary above to the Mbed Board.
(you may find it in the Nautilus file manager as NODE_F429ZI or F767ZI).
(you may find it in the Nautilus file manager as NODE_F429ZI, F767ZI or DAPLINK.)
```
mbed mros2 start!
[MROS2LIB] mros2_init task start
Expand Down
83 changes: 83 additions & 0 deletions include/rtps/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
The MIT License
Copyright (c) 2019 Lehrstuhl Informatik 11 - RWTH Aachen University
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE

This file is part of embeddedRTPS.

Author: i11 - Embedded Software, RWTH Aachen University
*/

#ifndef RTPS_CONFIG_H
#define RTPS_CONFIG_H

#include "rtps/common/types.h"

namespace rtps {

#define IS_LITTLE_ENDIAN 1


namespace Config {
const VendorId_t VENDOR_ID = {13, 37};
const std::array<uint8_t, 4> IP_ADDRESS = {192,168,11,2}; // Needs to be set in Src/lwip.c too.
const GuidPrefix_t BASE_GUID_PREFIX{1,2,3,4,5,6,7,8,9,10,12};

const uint8_t DOMAIN_ID = 0; // 230 possible with UDP
const uint8_t NUM_STATELESS_WRITERS = 2;
const uint8_t NUM_STATELESS_READERS = 2;
const uint8_t NUM_STATEFUL_READERS = 8;
const uint8_t NUM_STATEFUL_WRITERS = 8;
const uint8_t MAX_NUM_PARTICIPANTS = 1;
const uint8_t NUM_WRITERS_PER_PARTICIPANT = 16;
const uint8_t NUM_READERS_PER_PARTICIPANT = 16;
const uint8_t NUM_WRITER_PROXIES_PER_READER = 3;
const uint8_t NUM_READER_PROXIES_PER_WRITER = 3;

const uint8_t HISTORY_SIZE = 10;

const uint8_t MAX_TYPENAME_LENGTH = 40;
const uint8_t MAX_TOPICNAME_LENGTH = 40;

const int HEARTBEAT_STACKSIZE = 4096; // byte
const int THREAD_POOL_WRITER_STACKSIZE = 4096; // byte
const int THREAD_POOL_READER_STACKSIZE = 4096; // byte
const uint16_t SPDP_WRITER_STACKSIZE = 4096; // byte

const uint16_t SF_WRITER_HB_PERIOD_MS = 4000;
const uint16_t SPDP_RESEND_PERIOD_MS = 10000;
const uint8_t SPDP_WRITER_PRIO = 24;
const uint8_t SPDP_MAX_NUMBER_FOUND_PARTICIPANTS = 5;
const uint8_t SPDP_MAX_NUM_LOCATORS = 5;
const Duration_t SPDP_LEASE_DURATION = {100, 0};

const int MAX_NUM_UDP_CONNECTIONS = 10;

const int THREAD_POOL_NUM_WRITERS = 1;
const int THREAD_POOL_NUM_READERS = 1;
const int THREAD_POOL_WRITER_PRIO = 24;
const int THREAD_POOL_READER_PRIO = 24;
const int THREAD_POOL_WORKLOAD_QUEUE_LENGTH = 20;

constexpr int OVERALL_HEAP_SIZE = THREAD_POOL_NUM_WRITERS * THREAD_POOL_WRITER_STACKSIZE +
THREAD_POOL_NUM_READERS * THREAD_POOL_READER_STACKSIZE +
MAX_NUM_PARTICIPANTS * SPDP_WRITER_STACKSIZE +
NUM_STATEFUL_WRITERS * HEARTBEAT_STACKSIZE;
}
}

#endif //RTPS_CONFIG_H
2 changes: 1 addition & 1 deletion mros2.lib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/mROS-base/mros2#v0.2.3
https://github.com/mROS-base/mros2#v0.2.3.1