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

safzam's profile - activity

2019-11-25 23:10:33 -0500 received badge  Famous Question (source)
2018-09-18 21:52:11 -0500 marked best answer goal status in Callback in actionserver in C++

Hi all, My client sends the goal but gets status ABORTED instead of SUCCEEDED and server gives following error:

[ WARN] [1337607518.317686823]: Your executeCallback did not set the goal to a terminal status. This is a bug in your ActionServer implementation. Fix your code! For now, the ActionServer will set this goal to aborted

My callback is

void startnode(const my_msgs::myGoalConstPtr& goal, Server* as)
{ 
  my_msgs::myResult result_;
  result_.result = 1;
  as->setSucceeded(result_);
}

Can anyone help me fix this problem?? Thanks in advance. Regards

2017-11-22 01:06:05 -0500 received badge  Nice Question (source)
2017-07-25 16:57:31 -0500 received badge  Notable Question (source)
2017-01-10 16:55:13 -0500 received badge  Good Question (source)
2016-12-01 18:46:31 -0500 received badge  Nice Question (source)
2016-05-31 23:57:17 -0500 received badge  Favorite Question (source)
2016-03-14 11:21:19 -0500 received badge  Good Question (source)
2015-11-28 16:22:38 -0500 received badge  Famous Question (source)
2015-11-16 01:36:16 -0500 marked best answer topic name inside the callback

Hi, I use callback (python) like:

def callback(self,data):
    print data
    topic = data._connection_header['topic']

this call back is called for more than one subscriber alternatively. I am interested to know which topic is currently calling the callback. I use data._connection_header['topic'] to get the name of the topic. I don't know for some topics I get their name but for some not. Like when callback is invoked for topic /scan I get error like:

[ERROR] [WallTime: 1362483495.362445] bad callback: <bound method Generator.callback of <__main__.Generator object at 0x31435d0>>
Traceback (most recent call last):
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/topics.py", line 678, in _invoke_callback
    cb(msg)
  File "/home/my_workspace/my_pkg/src/callback.py", line 21, in callback
    topic = data._connection_header['topic']
KeyError: 'topic'

Any Idea? Or is there any other solution for knowing which topic is calling the callback? thanks

2015-07-02 10:49:49 -0500 received badge  Famous Question (source)
2015-06-03 08:17:20 -0500 received badge  Famous Question (source)
2015-05-07 19:31:45 -0500 received badge  Nice Question (source)
2014-04-20 13:13:05 -0500 marked best answer Do I need to add jar path in build.gradle???

Hi, I want to use some java classes from a jar file. If I import them I get error. I also export the CLASSPATH of the jar's path but does not help. Do I need to add the jar file path somewhere like in build.gradle or do I need to put this jar file in some other directory and access it there? Any hints please. Thanks

2014-04-20 13:12:33 -0500 marked best answer GraphName() private access Error in rosjava_core

Hi, I created my own new package and took the Talker and Listener code from pubsub tutorial pkg.I build it using "gradle build" command I get error for both Talker and Listener: my_workspace/test_java_core/src/main/java/org/ros/test_java_core/Listener.java:28: GraphName(java.lang.String) has private access in org.ros.namespace.GraphName return new GraphName("test_java_core/listener"); I took listener and talker from pubsub tutorial. how to fix it? Thanks,

2014-04-20 13:12:24 -0500 marked best answer Error in building new package in rosjava_core

Hi,

I want to build a new rosjava_core package and follow the same step as given here. I used build.gradle as given in tutorial and on using both commands gradle build and gradle installApp I get error:

A problem occurred evaluating root project 'test_java_core'.
Cause: Could not find method maven() for arguments [build_qrpk3gb7vg4fn9nn26dq7oqkj$_run_closure1_closure3@11eea7f0] on root project 'test_java_core'.

Then I copied build.gradle from rosjava_tutorial_pubsub to my new package. I got error:

A problem occurred evaluating root project 'test_java_core'.
Cause: Project with path ':rosjava' could not be found in root project 'test_java_core'.

Did some one have same problem? Any hints about the solution? Thanks

2014-04-20 13:12:09 -0500 marked best answer How to run Talker/Listener from rosjava_tutorial_pubsub

Hi all, I am following the tutorial http://docs.rosjava.googlecode.com/hg/rosjava_core/html/getting_started.html#executing-nodes I have rosjava_tutorial_pubsub. Now if I run "../gradlew installApp" I get successful build but I dont see any bin directory. And if I try to run Talker by command ./build/rosjava_tutorial_pubsub/bin/rosjava_tutorial_pubsub org.ros.rosjava_tutorial_pubsub.Talker I get error that Data not found. I think this is because there is not bin directory in ./build/rosjava_tutorial_pubsub/ but I dont know why

2014-04-20 13:11:47 -0500 marked best answer Error while building rosjava_core (gradle wrapper)

Hi all, I am trying to install rosjava_core on fuerte (ubuntu 12.04) using tutorial http://docs.rosjava.googlecode.com/hg/rosjava_core/html/index.html . I have followed the "Installing rosjava_core" sections. Now I am trying "building rosjava_core" and executing first step given "./gradlew install" . It creates a zip file gradle-1.0-milestone-9-bin.zip (which I can see) but then I get error:

Unzipping /home/safdar/.gradle/wrapper/dists/gradle-1.0-milestone9-bin/7ilkmgo2rn79vvfvd51rqf17ks/gradle-1.0-milestone-9-bin.zip to /home/safdar/.gradle/wrapper/dists/gradle-1.0-milestone-9-bin/7ilkmgo2rn79vvfvd51rqf17ks
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:131)
at java.util.zip.ZipFile.<init>(ZipFile.java:148)
at org.gradle.wrapper.Install.unzip(Install.java:148)
at org.gradle.wrapper.Install.createDist(Install.java:65)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)

Any body who already has had such error? or how can I proceed further now? thanks in advance

2014-04-20 13:09:18 -0500 marked best answer rosjava for Fuerte on Ubuntu 12.04

Hi all, Is someone already using rosjava on Fuerte? How can I install these packages like rosjava_bootstrap,.etc.

Thanks in advance.

2014-04-20 13:07:06 -0500 marked best answer actionserve/client in latest rosjava

Hi all, I am still keen to know how can we make action client/server in latest rosjave version? does latest rosjava give some lib to make actionservers and clients? OR action client servers are totally removed from the rosjava??????

Thnaks in advance.

2014-04-20 13:07:06 -0500 marked best answer how to get args from node object of rosjava Node class?

Hey, While running rosjava node we receive "node" object in onStart(Node node) function. Can we extract command line args from this "node" object. I tried to get NodeConfiguration and ParameterTree but did not work. Any idea?

regards

2014-04-20 13:00:44 -0500 marked best answer Does latest actionlib_java for electric exist?

Hi all, Has any body latest actionlib_java for electric version used? It seems that actionlib_java has been removed. What is the latest actionlib to support action server/client in java? What happens to those java application which use actionlib_java?

thanks,

2014-04-20 12:56:19 -0500 marked best answer actionlib_java installation

Hi all, I have made a ros base application that uses actionlib_java. The hg contains ./, ../, actionlib_java/, apache_commons_util/, apache_xmlrpc/, CMakeLists.txt, .hg/, .hgignore, .hgtags, Makefile, misc/, pom.xml, README, rosdep.yaml, rosjava/, rosjava_bootstrap/, rosjava-dev.rosinstall, rosjava.rosinstall, rosjava_tutorial_pubsub/, stack.xml, and test_rosjava/

This works well and runs everything. Now I want to transfer my application to another computer. I can not compile the rosjava based nodes. Of course I need actionlib_java and rosjava things. I found hg on https://code.google.com/r/damonkohler-rosjava-unstable/ I install it but it does not work becasue it have rosjav_actionlib not actionlib_java. Does anyone know where hg containing stabel actionlib_java exists...Or any other solution to make my application run. It seems that I had old rosjava and actionlib_java versions 0.0.0 and they are now unstable or not avaiable???? Thanks.

2014-04-20 12:50:59 -0500 marked best answer How to plot Topics' triggetings

Hi all, I want chart/graph to to see at which time whicht topic triggered. e.g I have a topic t1 which bublishes strings "yes" and sometimes "no". Another topic t2 publishes string "why" only when t1 bublishes "no". Now I want to get a chart/graph. When and which topic triggered. I have seen the rxplot (only works for numeric values). rxconsole gives the output but in a seraial form. Is there any way you know how to get my desired plot OR how to get a text file from rxconsole so that i can play with in Matlab to get the plot. I mean I am only interested triggering of the topic but on some specific values. Any clues please? Thanks in advance

2014-04-20 12:49:41 -0500 marked best answer rosjava actionclient and roscpp actionserver

Hi all, I can send msg from rosjava based actionclient to roscpp based actionserve. I have found that only first time waitForResult() in actionclient works: finished_before_timeout = sac.waitForResult(10, TimeUnit.SECONDS);

If I code sends goals many times then server gets the msga but client does not wait after first time at the above statement. Has someone else faced the same problem. Is there any solution how to send a goal again and wait for that in rosjava client? I get follwing excepiton: java.lang.NullPointerException at plannerC.main_planner(Unknown Source) at plannerC.onStart(Unknown Source) at org.ros.internal.node.DefaultNode$1.run(DefaultNode.java:495) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636)

Thanks and regards

2014-04-20 12:49:41 -0500 marked best answer How to run java node via launch file?

Hi all, How can we include java node in launch file? I know we normally include roscpp and rospy nodes in launch files but how to include such following command in lauch file e.g: rosrun rosjava_bootstrap run.py java_package java_node __name:=j_node Best regards

2014-04-20 12:49:41 -0500 marked best answer Publishing frequency in rosjava

Hi all, In rosjava tutorial I have seen that it uses Thread.sleep(1000) in the publisher to publish the data with 1Hz frequency...Is there any function (like in roscpp ros::Rate loop_rate(1) etc)...??? Thanks and regards,

2014-04-20 12:40:42 -0500 marked best answer Sending Goal from rosjava action client to roscpp action server

Hi, While sending goal from an action roscpp client to roscpp action server, I use actionlib::SimpleActionClient<msg::abcaction> client("action_server_name",true); and then client.sendGoal(goal) sends goal to the "action_server_name". This works fine. Now I have a "action_server_name" running, I want to send the goal through a rosjava action client node. How is it done? If anyone has already done it? Action server in roscpp and action client rosjava communication and sending receiving goal, please share it with me. Thanks in advance. regards, safdar

2014-04-20 12:27:15 -0500 marked best answer org.ros.rosjava Jar Messages files Do Not update

Hi all, My message jar files at at /.ros/rosjava/lib/org.ros.rosjava.my_msgs-0.0.0.jar. I have the problem that when I change the message (add one more field) and rosmake the message. It is compiled but the jar files are not updated. I even removed the org.ros.rosjava.my_msgs-0.0.0.jar from /.ros/rosjava/lib/ even then it does not generate new jar file for my_msgs. Did anyone have the same problem, how can I fix it?? Regards

2014-04-20 12:26:14 -0500 marked best answer Java(rosjava) Listener and C++/Python Subscriber Vice Versa

Hi all,

I have the a problem that messages from Python and C++ Publisher cannot be received by Java (rosjava based) Subscriber. Following are the codes and errors. Normally Listener.java and Talker.java are fine and works but when I try to send message through 1.rostopic pub command, or via 2. C++ file or 3. Python code Publisher, then I get the error by the Java Listener (Subscriber). Please see all the files and associated generated Errors by the Java node. Please Note that all three errors are same. Do you have any solution to fix it. Thanks in advance. I use Ubuntu 10.04 ROS version Diamondback...

regards

------------Listener.java------------

import org.apache.commons.logging.Log;
import org.ros.message.MessageListener;
import org.ros.node.Node;
import org.ros.node.NodeMain;
import org.ros.node.topic.Subscriber;

import com.google.common.base.Preconditions;


public class Listener implements NodeMain {

  private Node node;

  @Override
  public void main(Node node) {
    Preconditions.checkState(this.node == null);
    this.node = node;
    try {
      final Log log = node.getLog();
      node.newSubscriber("chatter", "std_msgs/String",
          new MessageListener<org.ros.message.std_msgs.String>() {
            @Override
            public void onNewMessage(org.ros.message.std_msgs.String message) {
              log.info("I heard: \"" + message.data + "\"");
            }
          });
    } catch (Exception e) {
      if (node != null) {
        node.getLog().fatal(e);
      } else {
        e.printStackTrace();
      }
    }
  }

  @Override
  public void shutdown() {
    node.shutdown();
    node = null;
  }

}

-----------Talker.java---------------

import com.google.common.base.Preconditions;
import org.ros.node.Node;
import org.ros.node.NodeMain;
import org.ros.node.topic.Publisher;


public class Talker implements NodeMain {

  private Node node;

  @Override
  public void main(Node node) {
    Preconditions.checkState(this.node == null);
    this.node = node;
    try {
      Publisher<org.ros.message.std_msgs.String> publisher =
          node.newPublisher("chatter", "std_msgs/String");
      int seq = 0;
      while (true) {
        org.ros.message.std_msgs.String str = new org.ros.message.std_msgs.String();
        str.data = "Hello world! " + seq;
        publisher.publish(str);
        node.getLog().info("Hello, world! " + seq);
        seq++;
        Thread.sleep(1000);
      }
    } catch (Exception e) {
      if (node != null) {
        node.getLog().fatal(e);
      } else {
        e.printStackTrace();
      }
    }
  }

  @Override
  public void shutdown() {
    node.shutdown();
    node = null;
  }
}
  1. rostopic pub /chatter std_gs/String "hello"

    20.11.2011 11:00:42 org.jboss.netty.channel.DefaultChannelPipeline WARNUNG: An exception was thrown by a user handler while handling an exception event ([id: 0x3b3e0aba] EXCEPTION: java.net.SocketException: Network is unreachable) org.ros.exception.RosRuntimeException: java.net.SocketException: Network is unreachable at org.ros.internal.transport.ConnectionTrackingHandler.exceptionCaught(ConnectionTrackingHandler.java:63) at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:432) at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:158) at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103) at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60) at org.jboss.netty.channel.Channels.connect(Channels.java:541) at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:218) at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227) at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188) at org.ros.internal.node.topic.DefaultSubscriber.addPublisher(DefaultSubscriber.java:160) at org.ros.internal.node ...

(more)
2014-04-20 12:25:07 -0500 marked best answer General Subscriber's Callback in C++

Hi all, Is there any way to make one general callback in c++ that can be executed for every subscriber? I mean every callback needs type of the message but I want one callback that should be generally and dynamically executable for all subscriber. I can do this in python but need to do in c++. Has someone done this? Thanks in advance, regards, safdar

2014-04-20 12:20:55 -0500 marked best answer Pr2MotorsAnalyzers

Hi all, I have read analyzer http://www.ros.org/wiki/diagnostics/T... and checked it. It works. I use SICK LMS200 with Pioneer-3DX, how can i collect diagnostic data for the pioneer motor and this laser sensor? regards,

2014-04-20 06:55:35 -0500 marked best answer Extracting message type in callback (Python)

Hey all, I want to extract data of a specific type from the message in the callback. I have only one callback where I get messages from different topics of different type like Float64, Odometry,.etc. Now I want to extract only the data of type Quaternion in side any message of any topic. My call back looks like (although its not correctly working): def callback(self, msg, arg): for m in msg.__slots__: if type(m) == [Quaternion]: self.process(m) but Quaternion is not directly recognized. Also I have to dig into the messages like Odometry has quaternion data but inside the pose.pose.position, how to check the whole structure of message for quaternion datatype data. Thanks in advance,

2014-04-20 06:53:33 -0500 marked best answer How to quit/exit from a subscriber

Hey all, I have two publishers with two topics using rospy. I have a third node that subscribe to each of both topics in sequence. I want to use one subscriber for a specified times (may be 10 or 20) and after that exit from this subscriber. Then I subscribe to second and want it to be automatically stopped after given number of times as above. I scanned the google I came to know subscriber.unregister() but it gives error that "'tuple' has no attribute 'unregister'". Any solution to exit from rospy subscriber automatically with out pressing Crl+C.

sb = None 
sb=rospy.Subscriber(topic1,type1,self.callback,(self,sb))
rospy.spin()
sb=rospy.Subscriber(topic2,type2,self.callback,(self,sb))
rospy.spin()

def callback(self,sb):
 self.c = self.c + 1
 if self.c == 10:
    sb.unregister()

Thanks

2014-04-20 06:52:44 -0500 marked best answer compiling java file in ros environment

Hi, I have a ros package my_pkg. I have c++ files in my_pkg/src folder and I can make the ros nodes using command "rosmake my_pkg". Is there any way to compile java file too while compiling the package if I add Server.java file. I dont want to use rosjava I just want to get Server.class and later want to run this class with command "java Server". Any hints please.. thanks

2014-04-20 06:52:40 -0500 marked best answer roslib.message.get_message_class python node error

Hi, I want to know the class of message giving message type via following one code line. I run this python node on(Fuerte/Ubuntu 12.04) and get following error while the same code does not give any error when I run it on (electric Ubuntu 10.04).

error:

msg_class = roslib.message.get_message_class(self.topic_type)
AttributeError: 'module' object has no attribute 'message'

Do I need to update roslib?

Thanks

2014-04-20 06:52:40 -0500 marked best answer including a java byte code class in ros stack

Hey all, I have a java program which act like a TCP socket server. And a ros C++ Client node interacts with it and share data on socket. I run my java program using command "java Server" and my C++ ros node like "rosrun my_pkg Cleint". I want to include my java Server program in my ros stack. How can I include and run it there? I dont want to make its node because its not needed at all. I simply want to run it there being included in my stack. Is there any way to run it via roslaunch or how? Also how can I integrate it in my stack? shall I make jar file for Server.class or how? Please give detailed hints, Thanks in advance