Skip to content

Commit f0f9ccc

Browse files
authored
Merge pull request #1 from mROS-base/change_mros2_to_submodule
Change mros2 to submodule
2 parents cf7d5ef + 6d77ad8 commit f0f9ccc

File tree

205 files changed

+427
-17750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+427
-17750
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
build/
2-
sdkconfig
2+
sdkconfig
3+
*.old
4+
*.lock

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "mros2"]
2+
path = mros2
3+
url = https://github.com/mROS-base/mros2.git

CMakeLists.txt

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,44 @@
1-
# For more information about build system see
2-
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html
3-
# The following five lines of boilerplate have to be in your project's
4-
# CMakeLists in this exact order for cmake to work correctly
5-
cmake_minimum_required(VERSION 3.16)
6-
add_compile_options(-w)
7-
include($ENV{IDF_PATH}/tools/cmake/project.cmake "include")
8-
project(mros2-esp32)
1+
set(SRCS "mros2/src/mros2.cpp"
2+
"mros2/embeddedRTPS/src/communication/UdpDriver.cpp"
3+
"mros2/embeddedRTPS/src/messages/MessageTypes.cpp"
4+
"mros2/embeddedRTPS/src/messages/MessageReceiver.cpp"
5+
"mros2/embeddedRTPS/src/discovery/TopicData.cpp"
6+
"mros2/embeddedRTPS/src/discovery/ParticipantProxyData.cpp"
7+
"mros2/embeddedRTPS/src/discovery/SEDPAgent.cpp"
8+
"mros2/embeddedRTPS/src/discovery/SPDPAgent.cpp"
9+
"mros2/embeddedRTPS/src/storages/PBufWrapper.cpp"
10+
"mros2/embeddedRTPS/src/ThreadPool.cpp"
11+
"mros2/embeddedRTPS/src/entities/Participant.cpp"
12+
"mros2/embeddedRTPS/src/entities/Domain.cpp"
13+
"mros2/embeddedRTPS/src/entities/StatelessReader.cpp"
14+
"mros2/embeddedRTPS/thirdparty/Micro-CDR/src/c/common.c"
15+
"mros2/embeddedRTPS/thirdparty/Micro-CDR/src/c/types/basic.c"
16+
"mros2/embeddedRTPS/thirdparty/Micro-CDR/src/c/types/string.c"
17+
"mros2/embeddedRTPS/thirdparty/Micro-CDR/src/c/types/sequence.c"
18+
"mros2/embeddedRTPS/thirdparty/Micro-CDR/src/c/types/array.c"
19+
"mros2/embeddedRTPS/thirdparty/lwip/default_netif.c"
20+
"cmsis-esp32/lwip.c"
21+
"cmsis-esp32/cmsis-esp.c"
22+
)
23+
24+
set(INCS "mros2/include"
25+
"mros2/include/mros2"
26+
"mros2/mros2_msgs"
27+
"mros2/embeddedRTPS/include"
28+
"mros2/embeddedRTPS/thirdparty/lwip"
29+
"mros2/embeddedRTPS/thirdparty/Micro-CDR/include"
30+
"cmsis-esp32/include"
31+
"include"
32+
"custom_msgs"
33+
${CMAKE_SOURCE_DIR}/main
34+
)
35+
36+
idf_component_register(
37+
SRCS ${SRCS}
38+
INCLUDE_DIRS ${INCS})
39+
40+
add_custom_command(
41+
OUTPUT templates.hpp
42+
COMMAND python3 ${COMPONENT_PATH}/mros2/mros2_header_generator/templates_generator.py ${CMAKE_SOURCE_DIR}/main)
43+
add_custom_target(Template SOURCES templates.hpp)
44+
add_dependencies(${COMPONENT_LIB} Template)

Readme.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,28 @@ Please also check [mros2 repository](https://github.com/mROS-base/mros2) for mor
1212
- M5Stack Core2
1313
- M5Stack CoreS3
1414

15-
# Getting Started
15+
# Quickstart by this repository itself
1616

1717
## install esp-idf
1818
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/index.html
1919

20-
## clone and settings
2120

21+
After install esp-idf, you need to install jinja2 library in esp-idf environment.
22+
23+
## git clone and settings
2224
```
23-
git clone https://github.com/mROS-base/mros2-esp32.git
25+
git clone --recursive https://github.com/mROS-base/mros2-esp32.git
2426
cd mros2-esp32
2527
```
26-
Change WiFi SSID/Pass
27-
- /main/include/wifi.h
28+
### Change WiFi SSID/Pass
29+
Change ESP_WIFI_SSID and ESP_WIFI_PASS in ```/workspace/common/wifi/wifi.h```.
30+
31+
### Change IP address
32+
Change IP address in ```/include/rtps/config.h```.
2833

29-
Change IP address
30-
- /components/include/rtps/config.h
34+
When using DHCP, it is also necessary to specify the IP address.
35+
Flash the app and check the IP address from startup log.
36+
After that chenge the IP address in ```config.h``` and rebuild it.
3137

3238
## Examples
3339
This repository contains some example applications in [workspace/](workspace/) to communicate with ROS 2 nodes on the host.
@@ -42,18 +48,22 @@ Currently, the following examples are available.
4248
- pub_twist
4349
- sub_pose
4450
- sub_uint16
51+
- m5stack_sample
52+
53+
M5Stack_sample project needs [M5Unified](https://github.com/m5stack/M5Unified) and [M5GFX](https://github.com/m5stack/M5GFX) libraries.
54+
Git clone these libraries to ```common/``` directory.
4555

46-
The following examples are under development. cannot build now.
47-
- mturtle_teleop
48-
- mturtle_teleop_joy
56+
57+
The following examples are under development. untested.
4958
- pub_image
5059
- pub_long_string_sub_crc
5160

61+
5262
## build Examples
5363
```
5464
cd workspace/[Example]/
5565
56-
/* M5Stack Basic/Core2 */
66+
/* M5Stack Basic / M5Stack Core2 */
5767
idf.py set-target esp32
5868
5969
/* ESP32S3Dev / M5Stack CoreS3 */
@@ -69,6 +79,20 @@ idf.py menuconfig
6979
/* Save and Quit menuconfig */
7080
7181
idf.py build
82+
83+
/* If an error occurs, try the following*/
84+
python -m pip install jinja2
85+
/* --- */
86+
7287
idf.py -p [PORT] flash
88+
7389
idf.py -p [PORT] monitor
90+
/* To exit monitor, press Ctrl + ] */
7491
```
92+
# Usage into your ESP-IDF project
93+
If you needs to use mros2 into your ESP-IDF project,
94+
clone this repository to ```components``` directory in your project.
95+
96+
mros2 needs network connection and setting of IP address.
97+
Please see [Wifi connection example](workspace/common/wifi).
98+
IP address setting find in upper section [Change IP address](#change-ip-address).
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)