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

david's profile - activity

2015-08-07 08:35:04 -0500 received badge  Good Question (source)
2012-11-27 01:16:39 -0500 received badge  Famous Question (source)
2012-10-03 05:46:23 -0500 received badge  Famous Question (source)
2012-10-03 05:46:23 -0500 received badge  Notable Question (source)
2012-07-28 09:35:41 -0500 received badge  Popular Question (source)
2012-05-29 04:42:23 -0500 received badge  Notable Question (source)
2012-01-21 22:29:54 -0500 received badge  Nice Question (source)
2011-11-20 10:02:56 -0500 received badge  Popular Question (source)
2011-09-02 10:58:08 -0500 marked best answer How to check if the Pubsub tutorial is running correctly?

no activity in > 1 month, closing

2011-07-18 08:52:17 -0500 marked best answer Android phone connecting to roscore on pc and thus how android phone can act as device for command input

1) Set the ROS_MASTER_URI environment variable to where the roscore is running. 2) You could send commands as String messages and execute the code on the client side.

2011-07-06 03:25:57 -0500 commented answer How to check if the Pubsub tutorial is running correctly?
In fact, I am trying to communicate between the android phone and the host pc. Running the roscore on the pc is not a problem; i'm trying to get android to come and communicate with the roscore on the pc. The concept is quite clear-- to make the android connect to the roscore on the pc, but couldn't implement it with the codes details
2011-07-06 01:01:35 -0500 received badge  Editor (source)
2011-07-06 01:00:16 -0500 asked a question How to check if the Pubsub tutorial is running correctly?

Hi I'm trying to learn the following pubsub tutorial code fragment but apparently, is still not connecting to roscore running on pc yet. The program installs successfully but there is no sign of a successful roscore connection.

/*******************************************************************/

/*
 * Copyright (C) 2011 Google Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package org.ros.tutorials.pubsub;

import org.ros.NodeConfiguration;
import org.ros.NodeRunner;
import org.ros.RosCore;
import org.ros.internal.node.address.InetAddressFactory;
import org.ros.rosjava.android.MessageCallable;
import org.ros.rosjava.android.views.RosTextView;

import android.app.Activity;
import android.os.Bundle;
/**
 * @author damonkohler@google.com (Damon Kohler)
 */

public class MainActivity extends Activity {

  private final NodeRunner nodeRunner;
  private RosCore rosCore;
  private RosTextView<org.ros.message.std_msgs.String> rosTextView;
  private Talker talker;

  public MainActivity() {
    super();
    nodeRunner = NodeRunner.createDefault();
  }

  @SuppressWarnings("unchecked")
  @Override

  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    rosTextView = (RosTextView<org.ros.message.std_msgs.String>) findViewById(R.id.text);
    rosTextView.setTopicName("/chatter");
    rosTextView.setMessageClass(org.ros.message.std_msgs.String.class);
    rosTextView.setMessageToStringCallable(new MessageCallable<String, org.ros.message.std_msgs.String>() {
          @Override
          public String call(org.ros.message.std_msgs.String message) {
            return message.data;
          }
        });
  }


  @Override
  protected void onPause() {
    super.onPause();
    talker.shutdown();
    rosTextView.shutdown();
    rosCore.shutdown();
  }

  @Override
  protected void onResume() {
    super.onResume();
    try {
      rosCore = RosCore.createPublic(11311);
      NodeConfiguration nodeConfiguration = NodeConfiguration.createDefault();
      nodeConfiguration.setHost(InetAddressFactory.createNonLoopback().getHostAddress());
      nodeRunner.run(rosCore, nodeConfiguration);
      rosCore.awaitStart();
      nodeConfiguration.setMasterUri(rosCore.getUri());
      talker = new Talker();
      nodeRunner.run(talker, nodeConfiguration);
      nodeRunner.run(rosTextView, nodeConfiguration);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }

}
/***********************End of Code*****************************/
2011-06-28 13:55:14 -0500 received badge  Supporter
2011-06-28 13:54:47 -0500 commented answer Android phone connecting to roscore on pc and thus how android phone can act as device for command input
Hi Dornhege! Thanks for the answer, I am actually looking for some sample code to accomplish them, if available.
2011-06-28 07:53:27 -0500 received badge  Student (source)
2011-06-28 06:43:21 -0500 asked a question Android phone connecting to roscore on pc and thus how android phone can act as device for command input

Hi,

I already have a pubsubtutorial application up and running.

However, how can I modify it or how shall I change the given tutorial code so that the application does not set up its own RosCore, but instead connects to a RosCore already running on a PC (let's say with http://host:11311 ).

In addition, what I am intending to do is that the android phone can have a command line tool so that the user can simply give commands as if the user were typing the commands into the terminal on the pc. So, is there a way so that it is the android phone that connects to the phone in command line mode?

Thanks! Really Appreciate it! :D

David

2011-06-27 20:46:41 -0500 answered a question rosjava(pure) pubsub tutorial

Hi Hughie,

Can you provide a working set of elementary project files for communication between Android and ROS? I am definitely asking for too much, but I would appreciate a lot of your help, because I am just another student just recently started learning the ROS and the Android. Thanks! My address is david3.1413@gmail.com

David