0
$\begingroup$

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:

https://gist.github.com/LeonardoJulianOcampo/e209896e6e9df80b475d7f535b31effa

after that, I go to neopixel_ws root and execute:

catkin_make

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

  Messages:
    MapMetaData,OccupancyGrid,GridCells,GetMapActionResult,GetMapActionGoal,GetMapFeedback,GetMapActionFeedback,Path,GetMapAction,GetMapGoal,Odometry,GetMapResult,

  Services:
    LoadMap,GetMap,SetMap,GetPlan,

Exporting neopixel

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

  Services:
    NodeletLoad,NodeletList,NodeletUnload,

Exporting pcl_msgs

  Messages:
    Vertices,PolygonMesh,ModelCoefficients,PointIndices,

...

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.

$\endgroup$

1 Answer 1

0
$\begingroup$
  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.

$\endgroup$
3
  • $\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.