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

Add custom message recipe #956

Draft
wants to merge 1 commit into
base: humble
Choose a base branch
from
Draft
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
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,54 @@ Note that folders added to `microros_static_library/library_generation/extra_pac

Here is a Raspberry Pi Pico C/C++ SDK documentation:
https://datasheets.raspberrypi.org/pico/raspberry-pi-pico-c-sdk.pdf

## Create custom message
Note: this is a twofold procedure, the custom message need to be installed separately on the Pico, and the host. The installation procedure on the Pico uses a Docker container, to mimic a "virtual" ROS2 workspace. The installation procedure on the host PC follows the "standard" procedure found in the documentation.

### On the Pico
First create custom message `.msg` files under the `microros_static_library/library_generation/extra_packages` folder. Roughly follow steps 2-4 here:

https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Custom-ROS2-Interfaces.html#create-custom-definitions

1. Make custom message
2. Add appropriate CMakeLists.txt
3. Add lines to package.xml

Open a Terminal in your host PC, `cd` into your project root. Run

```
docker run -it -v $(pwd):/project --net=host microros/micro_ros_static_library_builder:<Your ROS distro>
```

Example for ROS2 Humble:

```
docker run -it -v $(pwd):/project --net=host microros/micro_ros_static_library_builder:humble
```

The Docker container will host a ROS2 workspace, in order to install the custom message. Your project folder is a local Docker volume, persisting the necessary changes.

Expect a lot of `rsync` errors, but there should be no build errors. Any build errors indicate something not right in steps 1-3 above ^.

### On the host computer
The custom message needs to be installed on the host computer, for ROS2 to use it.

Follow these steps, adjust to your message:

https://micro.ros.org/docs/tutorials/advanced/create_new_type/

#### Known issues
The process will re-add some files already existing under the `microros/static_library/` and `libmicroros` folders.

Existing CMakelists.txt in subfolders will be deleted, and need to be restored.

#### TODO
- Improve `library_generation.sh` script.
- Add custom services to README
- Add examples
- Improve this section
- Explain GIT changes better

## Purpose of the Project

This software is not ready for production use. It has neither been developed nor
Expand Down