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

amigo's profile - activity

2014-05-18 18:46:56 -0500 received badge  Good Answer (source)
2014-05-18 18:46:56 -0500 received badge  Enlightened (source)
2014-01-28 17:25:14 -0500 marked best answer Modifying MainActivity.java does not result in new apk?

I'm working on android_tutorial_pubsub. When I modify MainActivity.java, it does not seem to build a new MainActivity-debug.apk. I added log messages to MainActivity.java; Then I did the standard build command (../gradlew debug), uninstalled the old app and then installed the apk file. But the log messages weren't appearing in logcat. Then I noticed that the time stamp on the apk file wasn't changing. When I did a clean and rebuild (debug), my messages appeared in logcat. If I don't do a clean, building doesn't seem to update the apk file. Any ideas what's going on?

Thanks!

2014-01-28 17:25:08 -0500 marked best answer Building rosjava.android stuff

I'm new to rosjava. I've been reading a lot from answers.ros.org and various links, but I'm having difficulty building the stuff in rosjava.android.

How do you build the stuff in rosjava.android with gradle?

I'm particularly interested in testing out android_tutorial_pubsub, so I'm trying to build android_gingerbread first to get a jar file, but I'm not sure what gradle command to use.

I know that the following website is for rosjava_core, but I tried the commands anyway: http://docs.rosjava.googlecode.com/hg/rosjava_core/html/building.html

./gradlew tasks

shows

clean debug deployLibs

'debug' doesn't work and 'deployLibs' only copies the libs from rosjava into a libs subdirectory.

Any help would be appreciated. Thanks!

2012-11-20 04:37:43 -0500 received badge  Notable Question (source)
2012-11-20 04:37:43 -0500 received badge  Popular Question (source)
2012-11-20 04:37:43 -0500 received badge  Famous Question (source)
2012-10-26 03:26:55 -0500 received badge  Taxonomist
2012-09-30 20:17:59 -0500 received badge  Popular Question (source)
2012-09-30 20:17:59 -0500 received badge  Famous Question (source)
2012-09-30 20:17:59 -0500 received badge  Notable Question (source)
2012-09-20 21:10:26 -0500 received badge  Notable Question (source)
2012-09-20 21:10:26 -0500 received badge  Famous Question (source)
2012-09-20 21:10:26 -0500 received badge  Popular Question (source)
2012-08-21 08:44:46 -0500 received badge  Famous Question (source)
2012-08-21 08:44:46 -0500 received badge  Notable Question (source)
2012-08-17 21:02:38 -0500 received badge  Famous Question (source)
2012-07-31 16:02:30 -0500 received badge  Popular Question (source)
2012-07-11 12:57:38 -0500 received badge  Notable Question (source)
2012-04-20 07:39:58 -0500 received badge  Popular Question (source)
2012-04-06 06:44:47 -0500 answered a question modifying android_tutorial_pubsub. able to connect master on pc but roswtf and rxgraph suggests error

Did you mean to comment out the line in your code:

nodeConfiguration.setMasterUri(URI.create("http://192.168.13.7:11311"));

Did you try the patch here

http://answers.ros.org/question/12771/running-android_tutorial_pubsub?answer=18845#post-id-18845

It uses setMasterUri(getMasterUri()). That worked for me.

Or maybe you have a network problem. What is your setup?

2012-04-06 06:41:37 -0500 commented question modifying android_tutorial_pubsub. able to connect master on pc but roswtf and rxgraph suggests error

Did you mean to comment out the line // nodeConfiguration.setMasterUri(URI.create("http://192.168.13.7:11311"));?

2012-04-06 05:50:32 -0500 commented answer Writing an image listener on android device; need debugging tips (why running out of memory?)

I actually got the same code to work using the same bag file a few days ago before I got the latest rosjava_core and android_core. I just downgraded rosjava_core and android_core and verified again that it does work on the older versions. So I don't think it's the image size.

2012-04-05 16:18:37 -0500 asked a question Writing an image listener on android device; need debugging tips (why running out of memory?)

I'm trying to write an app that can receive sensor_msgs/Image messages on an android device. I've modelled the code after android_tutorial_pubsub:

import org.ros.address.InetAddressFactory;
import org.ros.android.BitmapFromImage;
import org.ros.android.RosActivity;
import org.ros.android.views.RosImageView;
import org.ros.node.NodeConfiguration;
import org.ros.node.NodeMainExecutor;

import android.os.Bundle;

public class MainActivity extends RosActivity {
        private RosImageView<sensor_msgs.image> rosImageView;

        public MainActivity() {
                super("Android App", "Android App");
        }

        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);
                rosImageView = (RosImageView<sensor_msgs.image>)findViewById(R.id.imageView1);
                rosImageView.setTopicName("/camera/rgb/image_color");
                rosImageView.setMessageType("sensor_msgs/Image");
                rosImageView.setMessageToBitmapCallable(new BitmapFromImage());
        }

        @Override
        protected void init(NodeMainExecutor nodeMainExecutor) {
                NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostName());
                nodeConfiguration.setMasterUri(getMasterUri());
                nodeMainExecutor.execute(rosImageView, nodeConfiguration.setNodeName("myapp/image_listener"));
        }

        @Override
        protected void onDestroy() {
                super.onDestroy();
        }
}

I am able to connect to the ROS master just fine:

~$ rosnode list
/myapp/image_listener
/rosout

It is properly subscribed:

~$ rostopic info /camera/rgb/image_color 
Type: sensor_msgs/Image

Publishers: None

Subscribers: 
 * /myapp/image_listener (http://192.168.0.116:50285)

When I use rosbag play on a bag file, it shows the publisher:

~$ rostopic info /camera/rgb/image_color 
Type: sensor_msgs/Image

Publishers: 
 * /play_1333677784320867515 (http://192.168.0.119:44669/)

Subscribers: 
 * /myapp/image_listener (http://192.168.0.116:50285)

But that's the end of good behavior. The image does not appear in the image view. Here is my res/layout/main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <org.ros.android.views.RosImageView
        android:id="@+id/imageView1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_launcher" />

</LinearLayout>

Before I start rosbag play, I am able to exit the app and re-enter no problem. Once the publishing starts, the app is pretty much frozen.

roswtf doesn't tell me anything interesting (I ran rosbag a second time, so the play node number is different).

~/ros_workspace/android_core/android_image_listener$ roswtf
Loaded plugin tf.tfwtf
No package or stack in context
================================================================================
Static checks summary:

No errors or warnings
================================================================================
Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules

Online checks summary:

Found 2 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING Node [/myapp/image_listener] is not connected to anything
WARNING The following nodes are unexpectedly connected:
 * /play_1333678178991195080->/rosout (/rosout)
 * unknown (http://192.168.0.116:50933/)->/rosout (/rosout)

logcat gives me a bunch of (nonstop):

D/dalvikvm( 3678): GC_CONCURRENT freed 2048K, 25% free 34961K/46599K, paused 2ms+4ms
D/dalvikvm( 3678): GC_CONCURRENT freed 2048K, 25% free 34961K/46599K, paused 2ms+4ms
D/dalvikvm( 3678): GC_CONCURRENT freed 2048K, 25% free 34961K/46599K, paused 2ms+4ms
D/dalvikvm( 3678): GC_CONCURRENT freed 2048K, 25% free 34961K/46599K, paused 2ms+4ms

and I can get in logcat (after running rosbag a few times):

E/dalvikvm-heap( 3678): Out of memory on ...
(more)
2012-04-05 13:36:55 -0500 answered a question Dex errors when compiling android_tutorial_pubsub

I updated my Android SDK Tools to r17 and that seems to have fixed things....

2012-04-04 13:23:48 -0500 asked a question Dex errors when compiling android_tutorial_pubsub

I was able to compile android_tutorial_pubsub before, but something has changed recently and I get these weird dex exceptions from a fresh build:

   [dx] UNEXPECTED TOP-LEVEL EXCEPTION:
   [dx] java.lang.IllegalArgumentException: already added: Lorg/apache/xmlrpc/metadata/XmlRpcSystemImpl$1$1;
   [dx]     at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
   [dx]     at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
   [dx]     at com.android.dx.command.dexer.Main.processClass(Main.java:486)
   [dx]     at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
   [dx]     at com.android.dx.command.dexer.Main.access$400(Main.java:67)
   [dx]     at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
   [dx]     at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
   [dx]     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
   [dx]     at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
   [dx]     at com.android.dx.command.dexer.Main.processOne(Main.java:418)
   [dx]     at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
   [dx]     at com.android.dx.command.dexer.Main.run(Main.java:206)
   [dx]     at com.android.dx.command.dexer.Main.main(Main.java:174)
   [dx]     at com.android.dx.command.Main.main(Main.java:95)

I'm not sure what they mean. There's about 16 of them. Any ideas?

I've done ./gradlew install on rosjava_core and I set the targets for android_gingerbread and android_tutorial_pubsub before running ../gradlew debug in the android_tutorial_pubsub directory.

2012-04-04 07:29:50 -0500 commented question Modifying MainActivity.java does not result in new apk?

As jbohren mentioned, I was building with gradlew at the command-line.

2012-04-02 19:24:33 -0500 edited question Connecting android_tutorial_pubsub from Android device to PC

I can't seem to connect to the PC from an Android device running android_tutorial_pubsub.

I changed it so that android_tutorial_pubsub is not running it's own ROS master as per: http://answers.ros.org/question/30726/does-android_tutorial_pubsub-connect-to-other-ros

I use ifconfig to get the IP on the Ubuntu VM (running on a Mac), but when I ping that address from adb shell, it says that it's unreachable.

Also, adb logcat tells me:

E/Registrar(21222): Exception caught while communicating with master.
I/DefaultPublisher(21222): Publisher registration failed: Publisher<publisherdefinition<publisheridentifier<nodeslaveidentifier< android_gingerbread="" ros_text_view,="" <a="" href="http://192.168.0.116:42837">http://192.168.0.116:42837>, TopicIdentifier</rosout>>, TopicDefinition<topicidentifier< rosout="">, MessageDefinition<rosgraph_msgs log,="" acffd30cd6b6de30f120938c17c593fb="">>>>

Am I missing a step somewhere or using the wrong URI?

Edit: I've seen posts about setting ROS_IP and I tried that too (set in .bashrc).

Edit: The problem was with VMWare Fusion. It was a networking setting. In VMWare, select the wrench icon for the VM, then choose "Network Adaptor" and then "Connect Directly to the Physical Network (Bridged)". Now I can ping and the publisher on the android device can send to the ros master on the VM. Yay!

Thanks!

2012-04-02 11:37:45 -0500 received badge  Nice Answer (source)
2012-04-02 11:11:12 -0500 received badge  Teacher (source)