Skip to content

Custom message leads to "the application ros2 has stopped unexpectedly" #717

@MiguelMartinez-HAW

Description

@MiguelMartinez-HAW

Ros2 crashes after ModuleNotFoundError

  • Hardware description: RaspberryPi Pico
  • RTOS: FreeRTOS
  • Installation type: micro_ros_raspberrypi_pico_sdk
  • Version or commit hash: foxy

Steps to reproduce the issue

I need some custom interfaces so I followed this tutorial.
I put my new interface in ~/micro_ros_ws/src/micro_ros_raspberrypi_pico_sdk/microros_static_library/library_generation/extra_packages
The problem is when I'm supposed to execute this line: ros2 run micro_ros_setup build_firmware.sh
Since we're not using micro_ros_setup with the Pico, I tried to build the library with:

docker pull microros/micro_ros_static_library_builder:foxy
docker run -it --rm -v $(pwd):/project microros/micro_ros_static_library_builder:foxy

Then I used cmake .. and make in ~/micro_ros_ws/src/micro_ros_raspberrypi_pico_sdk/build and in the custom message folder.

Expected behavior

I have a program with a subscriber to twist messages, another subscriber to Int32, one publisher of Int16MultiArray and one publisher of my custom message.
I would expect that ros2 topic echo /my_topic would show what the publisher of my custom message is publishing.

Actual behavior

After some CMakeLists tweaking, the program compiles well and without errors. I am able to start the microROS agent and I use topic echo and topic pub to interact successfully with the 2 subscribers and the publisher. However, when I echo the topic where the publisher with the custom message is publishing, it shows the error:
ModuleNotFoundError: No module named 'custom_message'
And then a window pops up with the message "the application ros2 has stopped unexpectedly". The other publisher and subscribers still work, nonetheless.

Additional information

It's apparent that the module is not detected. The question then is: how do I add a custom message for the Raspberry Pi Pico? What did I miss?
I've been looking everywhere for instructions but they all seem to use the micro_ros_setup. I may have forgotten to mention a couple of things I may have tried while searching through blogs but so far nothing has worked. Has anybody used custom interfaces with microros and the pico?

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