micro_ros_espidf_component icon indicating copy to clipboard operation
micro_ros_espidf_component copied to clipboard

Custom interface in micro ros

Open Hariveerabadran opened this issue 3 months ago • 1 comments

how to create the custom interface in espidf_component. i tried to add header file in cmakelist but its not working.

cmakelist.txt

cmake_minimum_required(VERSION 3.5)

set(EXTRA_COMPONENT_DIRS "$ENV{HOME}/esp/micro_ros_espidf_component-humble") include_directories("$ENV{HOME}/ros2_ws/install/custom_interface/include") include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(cmd_vel)

i tried to add in main/cmakelist.txt. But that will not work as well

Hariveerabadran avatar Sep 25 '25 09:09 Hariveerabadran

hi @Hariveerabadran you can use

Directory structure recommended is

project/ ├── main/ │ ├── CMakeLists.txt │ └── main.c ├── components/ │ └── custom_interface/ │ ├── include/ │ │ └── custom_interface.h │ ├── src/ │ │ └── custom_interface.c │ └── CMakeLists.txt └── CMakeLists.txt

and in components/custom_interface/CMakeLists.txt change for add file *.c

idf_component_register( SRCS "src/custom_interface.c" INCLUDE_DIRS "include" )

Waelhechmi avatar Sep 30 '25 09:09 Waelhechmi