Robotics StackExchange | Archived questions

[Beginner]Using a message of a custom package in rosserial

Hello, I know this questions has been asked several times, but I found no answer to my problem on the existing topics. I am trying to use rosserial to communicate with my c++ nodes. Everything was working well, but know I'm trying to use a message of my package on rosserial, and I get the following error on the arduino IDE : Arduino/ServoTest/ServoTest.ino:15:45: fatal error: marvelmindnav/positioncontrol.h: No such file or directory #include

I tried to include the "package/header of the message" since it is how it worked in my c++ code. I had first run : rosrun rosserialarduino makelibrary.py pathtolibraries I also tried to run rosrun rosserialclient makelibrary.py pathtolibraries yourmessagepackage. I sourced my setup.bash several times. And it seems like none of those commands generated my package folder in the roslib. I tried to copy directly the message folder in the roslib, but I have header problems then, since the program does not get the right path for the headers of the message header files.

I kind of begin in ros, so if you have any idea of what could go wrong, I'd be grateful

Asked by meira on 2018-07-02 08:00:51 UTC

Comments

If the error is in the Arduino IDE, I suggest you look for help from an Arduino forum. The header file isn't where the IDE thinks it should be. The Arduino forum will be able to help you get the fie paths set up correctly.

Asked by billy on 2018-07-02 12:39:12 UTC

Answers

Hi, I faced the same issue, I have solved the issue and want to share with you.

You have to take care of the following link.

  1. Create a package that contains your msg. like in your case marvelmind_nav. You can refer to this tutorial to create the package.
  2. Then create the custom msg that you want to make. In your case position_control.msg. You can refer to this tutorial to create custom msg.
  3. Make sure you have edited the CMakeLists.txt for custom msg.
  4. then run the following command to create the msg for Arduino compatible.

    rosrun rosserial_client make_libraries marvelmind_nav/

Note: if the above command not working remove the build directory of workspace and catkin_make again.

You can refer this answer

Asked by simbha on 2018-07-03 01:02:53 UTC

Comments

Thanks for your answer ! I had already followed those steps, I did it again to make sure I was not missing anything and it seems like my problem is fixed. I don't exactly know what was wrong, maybe I was not sourcing at the right time, but thank you very much !

Asked by meira on 2018-07-03 04:57:02 UTC

Forgot the / after the message name - made the difference! Thanks!

Asked by Amalie on 2019-05-10 06:10:30 UTC