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

piet.delaney@gmail.com's profile - activity

2019-03-16 21:01:45 -0500 received badge  Nice Answer (source)
2019-03-16 21:01:42 -0500 received badge  Nice Question (source)
2016-11-10 16:03:17 -0500 received badge  Famous Question (source)
2016-07-27 18:13:58 -0500 received badge  Famous Question (source)
2016-04-07 08:48:22 -0500 received badge  Popular Question (source)
2016-04-07 08:48:22 -0500 received badge  Notable Question (source)
2016-03-14 21:08:21 -0500 received badge  Famous Question (source)
2016-03-14 21:08:21 -0500 received badge  Notable Question (source)
2016-02-26 01:04:31 -0500 received badge  Teacher (source)
2016-02-26 01:04:31 -0500 received badge  Self-Learner (source)
2016-02-26 00:53:43 -0500 received badge  Student (source)
2016-02-26 00:44:44 -0500 received badge  Notable Question (source)
2016-02-13 00:35:00 -0500 asked a question How to create a new item for a rosjava service list

I'm using the git repositories pulled with wstool as described at:

               http://wiki.ros.org/rosjava/Tutorials/indigo/Source%20Installation

I added a new msg, rosjava/src/rosjava_test_msgs/msg/PhoneContact.msg

string last_name
string first_name  
string phone_number

I also added a new srv, SendContactsSmsMsg.srv

PhoneContact      contact0     
PhoneContact      contact1     
PhoneContact      contact2     
PhoneContact      contact3     
PhoneContact      contact4     
PhoneContact[]    contact_list
string            message   
---   
bool              status

I added a new test client called SendContactsSmsMsgClient.java to:

   ~/rosjava/src/rosjava_core/rosjava_tutorial_services/src/main/java/org/ros/rosjava_tutorial_services

I've Cut-N-Pasted a copy below and would like to discuss it.

I'd like to remove the contact1...contac4 above. I added them because I'm having difficulty creating a PhoneContact to add to the contact_list above.

The genjava git repo seems to be generating only interface files which can't create an instance. For example:

Line 116 below rosjava_test_msgs.PhoneContact contact = new PhoneContact();

doesn't work because the public definition is only an interface. I tried implementing my on Phone Contact (Lines 41...79) below but I'm getting problems with the Raw Message class not being public.

Seems there should be a simple solution to this problem. My HACK is to get instances from the request message, modify them, and add them to the list (See lines 123...140).

I'm just sending a list of phone contacts with a message and sending the msg via SMS messaging interfaces available in Android. This test program just send the RPC and decodes the RPC. I'd image that creating a RPC with a list/array has been done a long time ago and it's trivial to add a instance of my phone_contact msg.

What's the trick?

     1  /*
     2   * Copyright (C) 2011 Google Inc.
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License"); you may not
     5   * use this file except in compliance with the License. You may obtain a copy of
     6   * the License at
     7   *
     8   * http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
    13   * License for the specific language governing permissions and limitations under
    14   * the License.
    15   */
    16  
    17  package org.ros.rosjava_tutorial_services;
    18  
    19  import org.ros.exception.RemoteException;
    20  import org.ros.exception.RosRuntimeException;
    21  import org.ros.exception.ServiceNotFoundException;
    22  import org.ros.namespace.GraphName;
    23  import org.ros.node.AbstractNodeMain;
    24  import org.ros.node.ConnectedNode;
    25  import org.ros.node.NodeMain;
    26  import org.ros.node.service.ServiceClient;
    27  import org.ros.node.service.ServiceResponseListener;
    28  
    29  import org.jboss.netty.buffer.ChannelBuffer;
    30  import org.ros.exception.RosMessageRuntimeException;
    31  import org.ros.internal.message.context.MessageContext;
    32  import org.ros.internal.message.field.Field;
    33  import org.ros.internal.message.field.MessageFieldType;
    34  import org.ros.internal.message.field.MessageFields;
    35  import org.ros ...
(more)
2016-01-30 10:21:51 -0500 received badge  Popular Question (source)
2016-01-29 01:28:31 -0500 asked a question How can I create a service on ROS java? Details?

I looked over the question: How can I create a service on rosjava?

but it seemed to be a bit dated and I wasn't able to add a new service.

I'm able to implement the AddTwoInts service but having difficulty on creating a new Service 'SendSmsMessage'.

I added a SendSmsMessage.srv to my local ~/rosjava_test_msgs git repo. I did a:

cmake .

but don't see any files to use else where.

I added SendSmsMessage.srv to my local ~/rosjava_bootstrap git repo:

 ~/rosjava_bootstrap/message_generation/src/test/resources/test_msgs/srv/
    AddTwoInts.srv               EmptyReqSrv.srv     EmptySrv.srv    
    MultipleAddTwoInts.srv    StringString.srv         ConstantsMultiplex.srv 
    EmptyRespSrv.srv          ListReturn.srv           SendSmsMessage.srv     <<<----
    TransitiveSrv.srv

and ran gradle which updated /opt/ros/indigo/share/maven/

I expected it to update: /opt/ros/indigo/share/rosjava_test_msgs/srv

but it still only has AddTwoInts.srv. Why is that?

I don't see any code for SendSms in /opt/ros/indigo but there are logs of files for AddTwoInts:

$ find . -name "SendSms*" -print

$ find . -name "AddTwo*" -print
./include/rosjava_test_msgs/AddTwoInts.h
./include/rosjava_test_msgs/AddTwoIntsResponse.h
./include/rosjava_test_msgs/AddTwoIntsRequest.h
./include/rospy_tutorials/AddTwoInts.h
./include/rospy_tutorials/AddTwoIntsResponse.h
./include/rospy_tutorials/AddTwoIntsRequest.h
./share/rosjava_test_msgs/srv/AddTwoInts.srv
./share/common-lisp/ros/rosjava_test_msgs/srv/AddTwoInts.lisp
./share/common-lisp/ros/rospy_tutorials/srv/AddTwoInts.lisp
/share/rospy_tutorials/srv/AddTwoInts.srv

in rosjava_core/rosjava/build.gradle whe have:

rosjava_core/rosjava/build.gradle:
      compile 'org.ros.rosjava_messages:rosjava_test_msgs:[0.2,0.3)'

I assume that get a jar file from:

/opt/ros/indigo/share/maven/org/ros/rosjava_messages/rosjava_test_msgs/0.2.1/rosjava_test_msgs-0.2.1.jar!/

but that jar file still only has AddTwoInts.class and not my new SendSmsMessage class:

AddTwoInts.class               AddTwoIntsResponse.class 
CompositeB.class              TestArrays.class                      TestPrimitives.class
AddTwoIntsRequest.class       CompositeA.class         
Composite.class                TestHeader.class                     TestString.class

There is are two .idea files referring to rosjava_test_msgs-0.2.1.jar:

 .idea/workspace.xml
   <option value="/opt/ros/indigo/share/maven/org/ros/rosjava_messages/rosjava_test_msgs/0.2.1/rosjava_test_msgs-0.2.1.jar" />

and

   ./.idea/libraries/Gradle__org_ros_rosjava_messages_rosjava_test_msgs_0_2_1.xml
     jar:///opt/ros/indigo/share/maven/org/ros/rosjava_messages/rosjava_test_msgs/0.2.1/rosjava_test_msgs-0.2.1.jar!/

So I suppose the most important problem is ~/rosjava_bootstrap not generating a java file for SendSmsMessage.srv. I do see a message_generation/src/test/java/org/ros/internal/message/Md5GeneratorTest.java mentioning testAddTwoInts but I doubt a bit this is the problem.

$ git grep AddTwoInts 
message_generation/src/test/java/org/ros/internal/message/Md5GeneratorTest.java:  public void testAddTwoInts() {
message_generation/src/test/java/org/ros/internal/message/Md5GeneratorTest.java:             serviceDescriptionFactory.newFromType("test_msgs/AddTwoInts");

I'd appreciate some enlightenment on this. Seems a bit complicate and I haven't seen any documentation on this whole process of adding a service that seems to go into this stuff that I'm seeing.

2016-01-29 01:25:06 -0500 asked a question How can I create a service on rosjava? Details?

I looked over the question: How can I create a service on rosjava?

but it seemed to be a bit dated and I wasn't able to add a new service.

I'm able to implement the AddTwoInts service but having difficulty on creating a new Service 'SendSmsMessage'.

I added a SendSmsMessage.srv to my local ~/rosjava_test_msgs git repo. I did a: cmake . but don't see any files to use else where.

I added SendSmsMessage.srv to my local ~/rosjava_bootstrap git repo:

Blockquote

 ~/rosjava_bootstrap/message_generation/src/test/resources/test_msgs/srv/
    AddTwoInts.srv               EmptyReqSrv.srv     EmptySrv.srv    
    MultipleAddTwoInts.srv    StringString.srv         ConstantsMultiplex.srv 
    EmptyRespSrv.srv          ListReturn.srv           SendSmsMessage.srv     <<<----
    TransitiveSrv.srv

and ran gradle which updated /opt/ros/indigo/share/maven/

I expecte it to updat: /opt/ros/indigo/share/rosjava_test_msgs/srv

but it still only has AddTwoInts.srv. Why is that?

I don't see any code for SendSms in /opt/ros/indigo but there are logs of files for AddTwoInts:

Blockquote

$ find . -name "SendSms*" -print

$find . -name "AddTwo*" -print
./include/rosjava_test_msgs/AddTwoInts.h
./include/rosjava_test_msgs/AddTwoIntsResponse.h
./include/rosjava_test_msgs/AddTwoIntsRequest.h
./include/rospy_tutorials/AddTwoInts.h
./include/rospy_tutorials/AddTwoIntsResponse.h
./include/rospy_tutorials/AddTwoIntsRequest.h
./share/rosjava_test_msgs/srv/AddTwoInts.srv
./share/common-lisp/ros/rosjava_test_msgs/srv/AddTwoInts.lisp
./share/common-lisp/ros/rospy_tutorials/srv/AddTwoInts.lisp
/share/rospy_tutorials/srv/AddTwoInts.srv

in rosjava_core/rosjava/build.gradle whe have: rosjava_core/rosjava/build.gradle: compile 'org.ros.rosjava_messages:rosjava_test_msgs:[0.2,0.3)'

I assume that get a jar file from: /opt/ros/indigo/share/maven/org/ros/rosjava_messages/rosjava_test_msgs/0.2.1/rosjava_test_msgs-0.2.1.jar!/

but that jar file still only has AddTwoInts.class and not my new SendSmsMessage class:

Blockquote

AddTwoInts.class               AddTwoIntsResponse.class 
CompositeB.class              TestArrays.class                      TestPrimitives.class
AddTwoIntsRequest.class       CompositeA.class         
Composite.class                TestHeader.class                     TestString.class

There is are two .idea files referring to rosjava_test_msgs-0.2.1.jar:

Blockquote

 .idea/workspace.xml
   <option value="/opt/ros/indigo/share/maven/org/ros/rosjava_messages/rosjava_test_msgs/0.2.1/rosjava_test_msgs-0.2.1.jar" />

and

Blockquote

   ./.idea/libraries/Gradle__org_ros_rosjava_messages_rosjava_test_msgs_0_2_1.xml
     jar:///opt/ros/indigo/share/maven/org/ros/rosjava_messages/rosjava_test_msgs/0.2.1/rosjava_test_msgs-0.2.1.jar!/

So I suppose the most important problem is ~/rosjava_bootstrap not generating a java file for SendSmsMessage.srv. I do see a message_generation/src/test/java/org/ros/internal/message/Md5GeneratorTest.java mentioning testAddTwoInts but I doubt a bit this is the problem.

Blockquote

$ git grep AddTwoInts 
message_generation/src/test/java/org/ros/internal/message/Md5GeneratorTest.java:  public void testAddTwoInts() {
message_generation/src/test/java/org/ros/internal/message/Md5GeneratorTest.java:             serviceDescriptionFactory.newFromType("test_msgs/AddTwoInts");

I'd appreciate some enlightenment on this. Seems a bit complicate and I haven't seen any documentation on this whole process of adding a service that seems to go into this stuff that I'm seeing.

2016-01-11 17:00:42 -0500 answered a question Can't see topic with rostopic for android publisher

Perhaps you could post it to git hub for me to look at.

-piet

2016-01-08 21:04:17 -0500 received badge  Popular Question (source)
2016-01-08 04:10:43 -0500 answered a question android_core - Emulator registers topic but not sending events

FIXED IT:*strong text*

I analysed the problem with WireShark this afternoon. The problem was that the Android Emulator (QEMU) has a built in firewall, thus using masquerading. The pubsub publisher sends the local ip address running on the emulated cell phone and the emulated firewall changes the address at host side, likely with a bridge. So the ROS Core running on a Ubuntu system was taking fine with HTTP thru the firewall but when I did a:

                                   'rostopic echo \mychatter'

it was trying to send a direct TCP/IP connection directly to the host address inside the emulator. So the SYN packets were just being lost.

I installed pubsub on an Nexus Tablet, not an emulation, and it worked fine. Seems worthy of a NOTE in the Android_Core Tutorial that *This demo doesn't work on a Emulated android device the currently described setup with Android Studio *. I mentioned it in my Question/Description that this was an Android Emulation. I don't know of anything I could have done on Android Studio to get around this. If there is it surely is worth mentioning in the Wiki pages in BOLD.

Anyone know if there is anything set up in ROS to avoid this problem in the Studio setup? Seems pretty silly for ROS to be limited to only machines behind the same firewall. Did I miss something in the tutorial? I was wondering if ROS_IP is provided with ROS_MASTER_URI for non Android Studion emulations to allow ROS to operate thru firewalls. I've picked up a few books on ROS and so far haven't read anyting about special proceedures to take for firewalls.

I just looked on the web and find this:

  http://wiki.ros.org/ROS/NetworkSetup

          What about firewalls?
                 If there is a firewall, or other obstruction, between a pair of machines 
                 that you want to use with ROS, you need to create a virtual network
                 to connect them. 

                 We recommend openvpn.

This seems like a rather awkward limitation. Like hooking up some language recognition software in a clowd like Amazon AWS to control robots runing ROS.

-piet

2016-01-06 20:46:53 -0500 received badge  Editor (source)
2016-01-06 19:49:37 -0500 answered a question Can't see topic with rostopic for android publisher

Sounds like the same problem that I'm having.

http://answers.ros.org/question/223602/android_core-emulator-registers-topic-but-not-sending-events/

Had any luck since you posted your question?

-piet

2016-01-06 19:37:44 -0500 asked a question android_core - Emulator registers topic but not sending events

I've got android_core and rosjava_core as projects under Android Studio. I'm currently running a Ginerbread (API:10) emulator and debugging it.

The android_tutorial_pubsub registers it's self as a topic publisher and I can see that the topic has been registered with roscore.

'rostopic list' sees the topic but doesn't see any events with 'rostopic echo /mychatter

'$ rostopic list
    /mychatter
     /rosout
    /rosout_agg 

$ rostopic echo /mychatter

wireshark show the http message being sent to register the /mychatter topic but nothing thereafter. Browser on emulator shows the web page fine on the rosecore host. The debugger shows the app is waiting to accept something.

My guess is that the 'rostopic echo /mychatter' should be connecting to the android_tutorial_pubsub app on the emulator.

Thought while debugging id see if anyone had any suggestions. I'll double check the wireshark trace and compare it to android_tutorial_pubsub running in the rosjava_core running locally on my workstation.

I thought I'd try to increase the logging level on the ROS Java Related Nodes:

 $ rosnode list
        /android_gingerbread/ros_text_view
        /rosjava_tutorial_pubsub/talker
        /rosout

So here I tried to list the loggers on the ROS Nodes. The ROS-JAVA related nodes seem to be Broken:

$ rosconsole list /rosout
        ros
        ros.roscpp
        ros.roscpp.roscpp_internal
        ros.roscpp.superdebug

$ rosconsole list /rosjava_tutorial_pubsub/talker
        rosconsole: error: node '/rosjava_tutorial_pubsub/talker' doesn't exist ...
        or doesn't support query: ...
        Service [/rosjava_tutorial_pubsub/talker/get_loggers] is not available.

$ rosconsole list  /android_gingerbread/ros_text_view
        rosconsole: error: node '/android_gingerbread/ros_text_view' doesn't exist or ...
        doesn't support query: ...
        Service    [/android_gingerbread/ros_text_view/get_loggers] is not available.

-pete