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

Any good example or suggestions to transport image to ROS in Android-JNI ?

asked 2017-04-13 06:26:11 -0500

Zorcs gravatar image

I know there's only have a C++ usage for transport image-messages to ROS in official API, and I want to do this in Android. So maybe the android_camera_driver is a good way to achieve this, however, for my target it's too complicated. I just need to transport the image from SD card or any other sources to ROS, never need a camera should open and take a photo or an OpenCV package to import. Only decoding the local image into byte-buffer and transform it to seneor_msgs.CompressedImage messages, and transport it. Therefore, I think the JNI should be a possible way to solve my problem. I'm new to jni and ros, I need some good suggestions to help me built a possible framework based on this structure. Or just tell me my idea is hard to make true, or it's a bad idea! Thanks in advance! Any good suggestions would welcome!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-04-26 22:26:35 -0500

Zorcs gravatar image

Well, since I had checked the API-for-image-sensor_msgs-transport-in-ROS-based-on-C++/Python, I have to acknowledged that there's no way to make this come true besides deal the source image with OpenCV (which called OpenCVImages in ROS) . So anyway, before you try to do this, you have to import your OpenCV-tool in your project (for me, just need OpenCV-for-Android). And, just as the API suggested, we need the cv_bridge as a node to transform the OpenCVImages into ROS-image-messages. Fortunately, I found this android_cv_bridge can be the best solution to solve my problem. In addition, it's really an available way to try this in JNI-way, cause it' not complicated in original-C++/Python-coding. So, guys if you're new to this, you really should take a glimpse of these good suggestions.

(PS: Still hoping for good suggestions in JNI-way.)

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-04-13 06:26:11 -0500

Seen: 192 times

Last updated: Apr 26 '17