I am trying to create a custom message for ROS noetic and implement it in a rosserial_arduino node. To do that, I first created my workspace:

mkdir neopixel_ws

then, I cloned the rosserial_arduino into src directory, and I created (in src folder) other folder named neopixel which contains the msg folder with my custom message. My custom message contains the following lines:

uint8 red
uint8 green
uint8 blue

uint8 pixel_number

bool enable

then, I modified the CMakeLists.txt and package.xml as follows:


after that, I go to neopixel_ws root and execute:


when finished, I ran catkin_make and source devel/setup.bash.

Finally, I try generate the header files for rosserial_arduino of my custom message. To do so, I ran:

rosrun rosserial_client make_libraries /home/leo/Arduino/libraries/ neopixel_msgs

The output of this command indicates the following:


Exporting nav_msgs



Exporting neopixel

    Unable to build message: neopixel/neopixel_msg
neopixel_msg,Exporting nodelet


Exporting pcl_msgs



In the Arduino/libraries folder, the ros_lib folder is created with the default headers, but not with my custom message.

How can I resolve this? Is there any part of the process that I might be doing incorrectly? Any suggestions are greatly appreciated. Thanks.


1 Answer 1

  1. Before you do the make_libraries command, you need to source the setup.bash that was created inside your catkin workspace:

    cd neopixel_ws
    source devel/setup.bash
  2. Also, your CMakeLists.txt file is missing stuff: it's missing message_generation in find_packages, and missing message_runtime in catkin_package, and the generate_messages section is commented out.

  • $\begingroup$ Yes, I have done it, it gives the same result $\endgroup$
    – loromalo
    Oct 12, 2023 at 16:13
  • $\begingroup$ I updated my answer. $\endgroup$
    – Mike973
    Oct 12, 2023 at 23:12
  • $\begingroup$ I made the modifications you mentioned, and initially, with the command 'rosrun rosserial_client make_libraries path_to_libraries neopixel_msgs', I was getting the same output. Then I tried using the command 'rosrun rosserial_arduino make_libraries.py path_to_libraries', which gives me the same message. However, this time, unlike the previous command, the process correctly generates the header for the desired message. It's strange, but at least it's working now. Thanks. $\endgroup$
    – loromalo
    Oct 14, 2023 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.