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

Subscriber in sample_app of android_ndk not working

asked 2016-09-07 04:52:01 -0500

koeberlue gravatar image

Hello everybody,

I'm currently trying to port a c++ Desktop Applicatioon to Android. I have been able to build the andoird_ndk sample app following this tutorial: http://wiki.ros.org/android_ndk/Tutor...

But when I start the app and publish a message from my workstation as described in the tutorial, the callback is never called, as i have verified with logcat.

To check the general connection, i have modified the test.cpp file to publish a single message before entering the while-loop and i am able to receive this message on my workstation.

Does anyone have an idea, what could cause this issue?

(Since I'm new to ROS, tell me if you need further information)

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2016-09-15 09:45:18 -0500

koeberlue gravatar image

After some debugging i found out that my network was not set up properly. I had to set the ROS_IP environment variable to my local ip.

For further information read http://wiki.ros.org/ROS/NetworkSetup

edit flag offensive delete link more

Comments

hi everyone,i have the same problem,when i run roswtf,it says:

Found 1 error(s).

ERROR The following nodes should be connected but aren't:
 * /rosjava/talker->/android_ndk_native_cpp (/chatter)
 * /rostopic_7280_1486193220744->/android_ndk_native_cpp (/chatter)
xy1zzz gravatar image xy1zzz  ( 2017-02-04 01:32:27 -0500 )edit
0

answered 2017-02-04 13:02:11 -0500

xy1zzz gravatar image

updated 2017-02-04 13:03:16 -0500

I have the same problem that cannot ping each other by name and solve this problem by doing this:

1.In ros master PC shell setup ROS_IP before you run roscore service 10.0.0.14 is your local ip.

u64@u64-rosmaster:~$ export ROS_IP=10.0.0.14

u64@u64-rosmaster:~$ roscore

2.edit ros master PC /etc/hosts add your phone ip and name like

10.0.0.15 phone

good luck!

edit flag offensive delete link more

Question Tools

Stats

Asked: 2016-09-07 04:52:01 -0500

Seen: 181 times

Last updated: Feb 04 '17