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

Revision history [back]

After you have correctly made your .msg files in your package, you will need to rebuild at least rosjava with ./gradle as shown in the documentation.

This will automatically include your custom message in the javalibrary, rosjava_messages-0.0.0-SNAPSHOT.jar, which will need to be included into your Java project.

Be careful as if you include a java library file directly in your /libs folder of your project it will conflict with other copies of that file, such as can be the case if the gingerbread_mr2 library is also referenced. If you are developing in java to use android core, then I suggest that you should also rebuild android_core as per the documentation, and just reference the gingerbread_mr2 project as a library in the project_properties->android_settings tab (if using eclipse)

click to hide/show revision 2
what to do after adding

After you have correctly made your .msg files in your package, you will need to rebuild at least rosjava with ./gradle as shown in the documentation.

This will automatically include your custom message in the javalibrary, rosjava_messages-0.0.0-SNAPSHOT.jar, which will need to be included into your Java project.

Be careful as if you include a java library file directly in your /libs folder of your project it will conflict with other copies of that file, such as can be the case if the gingerbread_mr2 library is also referenced. If you are developing in java to use android core, then I suggest that you should also rebuild android_core as per the documentation, and just reference the gingerbread_mr2 project as a library in the project_properties->android_settings tab (if using eclipse)

You can them import them into your code like any other message. Just use:

import my_msg_pkg/msg

replacing "my_msg_pkg" with the package your message is defined in and "msg" as your message type.

After you have correctly made your .msg files in your package, you will need to rebuild at least rosjava with ./gradle as shown in the documentation.

This will automatically include your custom message in the javalibrary, rosjava_messages-0.0.0-SNAPSHOT.jar, which will need to be included into your Java project.

Be careful as if you include a java library file directly in your /libs folder of your project it will conflict with other copies of that file, such as can be the case if the gingerbread_mr2 library is also referenced. If you are developing in java to use android core, then I suggest that you should also rebuild android_core as per the documentation, and just reference the gingerbread_mr2 project as a library in the project_properties->android_settings tab (if using eclipse)

You can them import them into your code like any other message. Just use:

import my_msg_pkg/msgmy_msg_pkg.msg

replacing "my_msg_pkg" with the package your message is defined in and "msg" as your message type.