[Discourse.ros.org] [rosjava] Cannot import custom messages

77 views
Skip to first unread message

sam

unread,
Apr 14, 2016, 9:45:17 AM4/14/16
to ros-si...@googlegroups.com
sam
April 14

I started programming an Android App for our robot. Therefore, I wanted to import some custom messages from our other C++ packages.

I successfully set up the Android Studio with android_cv_bridge, it even builds and runs on my phone.

However, I tried to import a custom message package, that I generated beforehand with genjava_message_artifacts. For that, I added in the build.gradle dependencies compile "org.ros.rosjava_messages:locomotion_controller_msgs:[0.0,0.2)" and in the source file import locomotion_controller_msgs.*;, but if I build the project with Android Studio, it cannot find locomotion_controller_msgs. If I remove the import statement, it doesn't complain, so I guess the compile command works fine, but it cannot import it for some reasons.

I also checked the ROS_MAVEN_PATH which is /home/sam/catkin_ws/devel/share/maven:/opt/ros/indigo/share/maven where all the rosjava artifacts actually are.

Did I miss something? How else can I add custom messages to an ROS Android Studio project?



Visit Topic or reply to this email to respond

To stop receiving notifications for this particular topic, click here. To unsubscribe from these emails, change your user preferences

jcerruti

unread,
Apr 14, 2016, 10:06:54 AM4/14/16
to ros-si...@googlegroups.com
jcerruti
April 14

Hi Sam,
I am not sure I can fully understand your set-up. What is your catkin workspace layout? Do you have the Android cv_bridge package in the same catkin workspace as the custom message package or in a separate one?
When you say you generated the messages beforehand with genjava_message_artifacts, how exactly did you do that?
The artifact resolution from Android Studio si very simple, it will look for the artifact inside the maven repositories, which you can tell easily by the directory and file names. Did you check inside /home/sam/catkin_ws/devel/share/maven to see if the custom messages are there and with the right name?
I hope this helps bring more clarity.
Best,
Julian

sam

unread,
Apr 14, 2016, 11:33:06 AM4/14/16
to ros-si...@googlegroups.com
sam
April 14

So the reason was, that I build my catkin_ws with catkin build rather than catkin_make, obviously this has a bad effect on genjava_message_artifacts for some mysterious reasons. Is this issue known? Is there a solution for that or do I have to live with that?


Visit Topic or reply to this email to respond


In Reply To

sam
April 14
Hi Julian My setup looks like this: ~/catkin_ws/src : with all the C++ and msgs packages than I have the android_cv_bridge package inside the git directory, I don't think it needs to be in the workspace, because I build with Android Studio, what works without custom messages. I generated the r…

Nikolaus Demmel

unread,
Apr 14, 2016, 2:06:20 PM4/14/16
to ros-si...@googlegroups.com
NikolausDemmel
April 14

All things that work with catkin_make but not in catkin build should be raised at the catkin_tools issue tracker: https://github.com/catkin/catkin_tools/issues

sam

unread,
Apr 15, 2016, 1:36:45 AM4/15/16
to ros-si...@googlegroups.com

Visit Topic or reply to this email to respond


In Reply To

NikolausDemmel
April 14
All things that work with catkin_make but not in catkin build should be raised at the catkin_tools issue tracker: https://github.com/catkin/catkin_tools/issues

Visit Topic or reply to this email to respond

Reply all
Reply to author
Forward
0 new messages