Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

support for esp32 #12

Merged
merged 5 commits into from
Jul 28, 2020
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
8 changes: 7 additions & 1 deletion apps/int32_publisher/app.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <unistd.h>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed for usleep function


#include <rcl/rcl.h>
#include <rcl/error_handling.h>
Expand All @@ -7,6 +8,11 @@
#include <rclc/rclc.h>
#include <rclc/executor.h>

#ifdef ESP_PLATFORM
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#endif
Comment on lines +11 to +14
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for esp32 these includes are needed for vTaskDelete


#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){printf("Failed status on line %d: %d. Aborting.\n",__LINE__,(int)temp_rc);vTaskDelete(NULL);}}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){printf("Failed status on line %d: %d. Continuing.\n",__LINE__,(int)temp_rc);}}

Expand Down Expand Up @@ -70,4 +76,4 @@ void appMain(void * arg)
RCCHECK(rcl_node_fini(&node))

vTaskDelete(NULL);
}
}
2 changes: 1 addition & 1 deletion apps/ping_pong/app-colcon.meta
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
]
}
}
}
}
5 changes: 5 additions & 0 deletions apps/ping_pong/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
#include <unistd.h>
#include <time.h>

#ifdef ESP_PLATFORM
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#endif

#define STRING_BUFFER_LEN 50

#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){printf("Failed status on line %d: %d. Aborting.\n",__LINE__,(int)temp_rc); vTaskDelete(NULL);}}
Expand Down
4 changes: 4 additions & 0 deletions microros_esp32_extensions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build/
sdkconfig
sdkconfig.old
esp32_toolchain.cmake
12 changes: 12 additions & 0 deletions microros_esp32_extensions/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 3.5)

if(NOT DEFINED IDF_PATH)
message(FATAL_ERROR "The CMake varible IDF_PATH was not set!")
endif()

if(NOT DEFINED UROS_APP)
message(FATAL_ERROR "The CMake varible UROS_APP was not set!")
endif()

include(${IDF_PATH}/tools/cmake/project.cmake)
project(${UROS_APP})
3 changes: 3 additions & 0 deletions microros_esp32_extensions/components/libatomic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
file(GLOB SRCS ${CMAKE_CURRENT_LIST_DIR}/*.c*)
idf_component_register(SRCS ${SRCS}
INCLUDE_DIRS ".")
Loading