micro-ROS / micro-ROS/micro_ros_espidf_component

Add custom ros message to micro_ros_espidf_component help

Open
#310 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
419
Forks
124
Avg merge
21h 35m
Merged PRs (30d)
3

Description

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](https://www.youtube.com/watch?v=E_xBPI8SQig)

Any help is appreciated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with libmicroros.mk and the component and main CMakeLists.txt files mentioned in the issue; trace how micro_ros_msgs is cloned and how message packages enter libmicroros.a. Reproduce the local component setup with a custom .msg directory, then document the supported project layout and verify that the generated message is included in the ESP-IDF build.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake
Domain
build-system, documentation, embedded-iot
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.