Skip to content

Add custom ros message to micro_ros_espidf_component help #310

@adam-at-epsilon

Description

@adam-at-epsilon

Hi, my project uses micro_ros_espidf_component which works fine with standard int32 messages, but we would like to use a custom message. To be fair I am not an expert in either cmake build system or esp-idf framework.

Our project looks like this:

- ourProject/
             - CMakeLists.txt
             - sdkconfig
             - components/
                           -  micro_ros_espidf_component // copy of repo, revision jazzy
             - main/       
                           - CMakeLists.txt
                           - main.c
                           - idf_component.yml // micro_ros_espidf_component listed as repo dependency
             - build/

As far as my troubleshooting goes, my attempts to add a components/msgs subdirectory have failed and I have since realised that the custom message(s) need to be part of the micro_ros_espidf_component itself so they are compiled into libmicroros.a.

  • My approach is to copy micro_ros_espidf_component into a new components directory. Then main/idf_component.yml lists this as a local directory dependency rather than previously a repo dependency
  • the msgs components are not part of micro_ros_espidf_component instead micro_ros_espidf_component/libmicroros.mk does git clone https://github.com/micro-ROS/micro_ros_msgs.
    • THE BIG QUESTION What do I need to do here to add a custom message directory which is then picked up and compiled into libmicroros.a?
    • Ideally I would like to add a MyCustomMessage in a myrepo/components/msgs/MyCustomMessage.msg file along the pattern of this video

Any help is appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions