Skip to content

Commit 141335c

Browse files
committed
follow mros2 update v0.5.1-3 to check the operation
1 parent 92adf2d commit 141335c

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
idf_component_register(SRCS "app.cpp"
1+
# Please set filename of mros2 application in main/
2+
set(APP_SRCS "app.cpp")
3+
4+
idf_component_register(SRCS ${APP_SRCS}
25
INCLUDE_DIRS "."
3-
PRIV_REQUIRES "mros2-esp32" "wifi")
6+
PRIV_REQUIRES "mros2-esp32")

workspace/pub_twist/main/app.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* mros2 example
2-
* Copyright (c) 2021 smorita_emb
2+
* Copyright (c) 2023 mROS-base
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,19 +15,27 @@
1515
*/
1616

1717
#include "mros2.h"
18+
#include "mros2-platform.h"
1819
#include "geometry_msgs/msg/vector3.hpp"
1920
#include "geometry_msgs/msg/twist.hpp"
2021

21-
#include "cmsis_os.h"
22-
#include "wifi.h"
2322

2423
extern "C" void app_main(void)
2524
{
26-
init_wifi();
27-
osKernelStart();
28-
2925
printf("mbed mros2 start!\r\n");
3026
printf("app name: pub_twist\r\n");
27+
28+
/* connect to the network */
29+
if (mros2_platform_network_connect())
30+
{
31+
MROS2_INFO("successfully connect and setup network\r\n");
32+
}
33+
else
34+
{
35+
MROS2_ERROR("failed to connect and setup network! aborting,,,\r\n");
36+
return;
37+
}
38+
3139
mros2::init(0, NULL);
3240
MROS2_DEBUG("mROS 2 initialization is completed\r\n");
3341

0 commit comments

Comments
 (0)