yekigoc / rosjava

Automatically exported from code.google.com/p/rosjava
0 stars 0 forks source link

"rosnode info" ERROR: remote called failed #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a ROSJAVA node on an android device
2. Connect to a remote master (I had this running on Ubuntu 10.04 with 
Diamondback)
3. run "rosnode info <node name>" from ROS Master side

What is the expected output? What do you see instead?
List of publications, Subscriptions, and Services followed by an attempt to 
contact node and return a PID.

Instead a list of publications, subscriptions, and services is shown followed 
by:
"ERROR: remote call failed: Cannot retrieve PID on this platform."

What version of the product are you using? On what operating system?
ROSJAVA version: cb4300c0e727 Android: 2.2.1

Please provide any additional information below.
It seems that this error is associated with the node slave api, which is 
causing my application to crash when attempting to subscribe to topics.

Original issue reported on code.google.com by jpeabod...@gmail.com on 16 Jun 2011 at 12:11

GoogleCodeExporter commented 9 years ago
Looks like this was intentional, and does not affect usability. What does ROS 
use the pid for anyway?

However, on Android android.os.Process.myPid() should return the PID. Could 
this be used somehow? Maybe an Android-specific rosjava.jar? Not sure how you 
would set this up...

Original comment by ersso...@gmail.com on 16 Jun 2011 at 5:28

GoogleCodeExporter commented 9 years ago
I agree with the comment above. My issue stemmed from Issue 11 that follows. 

Original comment by jpeabod...@gmail.com on 16 Jun 2011 at 11:49

GoogleCodeExporter commented 9 years ago
I tested a solution that uses:

return 
(Integer)Class.forName("android.os.Process").getMethod("myPid").invoke(null);

to dynamically, at runtime, try to obtain the PID using Android-specific 
methods should the MF.getName() method fails, which it does on Android.

Attached is the diff. It has been tested and verified to work and return the 
correct PID. Feel free to incorporate it! :)

Original comment by ersso...@gmail.com on 16 Jun 2011 at 11:13

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 7780c4147d04.

Original comment by damonkoh...@google.com on 18 Jun 2011 at 4:04