ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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

asked 2018-07-02 08:00:51 -0600

meira gravatar image

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/Servo_Test/Servo_Test.ino:15:45: fatal error: marvelmind_nav/position_control.h: No such file or directory #include <marvelmind_nav position_control.h="">

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 rosserial_arduino make_library.py path_to_libraries I also tried to run rosrun rosserial_client make_library.py path_to_libraries your_message_package. I sourced my setup.bash several times. And it seems like none of those commands generated my package folder in the ros_lib. I tried to copy directly the message folder in the ros_lib, 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

edit retag flag offensive close merge delete

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.

billy gravatar image billy  ( 2018-07-02 12:39:12 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-07-03 01:02:53 -0600

simbha gravatar image

updated 2018-07-03 01:03:50 -0600

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 <arduino_library_folder_path> marvelmind_nav/

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

You can refer this answer

edit flag offensive delete link more

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 !

meira gravatar image meira  ( 2018-07-03 04:57:02 -0600 )edit

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

Amalie gravatar image Amalie  ( 2019-05-10 06:10:30 -0600 )edit

Question Tools

Stats

Asked: 2018-07-02 08:00:51 -0600

Seen: 790 times

Last updated: Jul 03 '18