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

Bant's profile - activity

2021-09-27 10:31:53 -0500 received badge  Great Answer (source)
2021-05-29 13:59:46 -0500 received badge  Good Question (source)
2020-11-04 15:30:29 -0500 received badge  Nice Question (source)
2019-12-27 22:01:08 -0500 received badge  Good Answer (source)
2019-11-11 07:28:52 -0500 received badge  Nice Answer (source)
2018-09-26 05:54:19 -0500 received badge  Self-Learner (source)
2018-09-26 05:54:19 -0500 received badge  Teacher (source)
2018-09-26 05:54:14 -0500 received badge  Student (source)
2017-08-13 10:06:35 -0500 received badge  Famous Question (source)
2017-05-14 23:57:07 -0500 received badge  Notable Question (source)
2016-12-15 08:27:59 -0500 received badge  Famous Question (source)
2016-12-15 08:27:59 -0500 received badge  Notable Question (source)
2016-08-02 11:26:07 -0500 commented answer Tutorial 1.16 "ImportError: No module named beginner_tutorials.srv" with Catkin system build

Hi I know its old but I would also add:

catkin_package( CATKIN_DEPENDS roscpp rospy std_msgs message_runtime )

It feels like it only works for me if I uncomment the line in the catkin_package section and add message runtime to it.

2016-08-02 04:45:55 -0500 commented answer publish numpy matrix to topic

I think the tutorial only covers arrays, as they are using the "Floats" msg from rospy_tutorials. (Floats.msg: float32[] data)

2016-08-02 04:43:41 -0500 commented answer publish numpy matrix to topic

Thank you. I will do it like this for now. If I find a different approach I will add an answer here.

2016-08-02 04:42:41 -0500 received badge  Scholar (source)
2016-08-02 04:12:04 -0500 received badge  Popular Question (source)
2016-08-01 09:03:31 -0500 asked a question publish numpy matrix to topic

Hello together,

I would like to publish a 10x10x10 numpy-Matrix in one publishing step. Therefore I would like to know how I can declare the numpy.ndarray as a message type like

matrix.msg:

numpy.ndarray matrix

Is that even possible? What do I have to add to the CMakeLists.txt to get that running? Is there maybe a better way?

Thanks in advance!

2016-07-27 05:36:51 -0500 received badge  Popular Question (source)
2016-07-27 04:51:51 -0500 received badge  Editor (source)
2016-07-27 04:50:53 -0500 answered a question tf.LookupException: "base_link" passed to lookupTransform argument target_frame does not exist.

Hello together,

I fixed it and now it feels way to easy. But I will leave the solution here anyway. Maybe it helps the next person starting with tf's.

The running code: first node:

#!/usr/bin/env python

import rospy
import tf

class tf_firsttry_pub_class():
    def __init__(self):
        rospy.init_node('tf_firsttry_pub')
        now = rospy.Time.now()
        br = tf.TransformBroadcaster()
        R = rospy.Rate(150)
        while not rospy.is_shutdown():
            br.sendTransform((1, 1, 1), (0, 0, 0, 1), rospy.Time(), 'One','base_link')      
            R.sleep()


if __name__ == '__main__':
    try:
        tf_firsttry_pub_class()
    except rospy.ROSInterruptException:
        pass

second node:

#!/usr/bin/env python

import rospy
import tf


class tf_firsttry_listen_class():
    def __init__(self):
        rospy.init_node('tf_firsttry_listen')
        listener = tf.TransformListener()
        now = rospy.Time.now()
        while not rospy.is_shutdown():
            listener.waitForTransform('/base_link','/One',rospy.Time(), rospy.Duration(4.0))
            (trans, rot) = listener.lookupTransform('/base_link', '/One', rospy.Time(0))
            print trans


if __name__ == '__main__':
    try:
        tf_firsttry_listen_class()
    except rospy.ROSInterruptException:
        pass

Note the R = rospy.Rate(150) and R.sleep() in the first code and the listener.waitForTransform in the second!

2016-07-27 04:45:27 -0500 commented answer tf.LookupException: "base_link" passed to lookupTransform argument target_frame does not exist.

Fixed. A wait for transform in the second code and a rospy.rate(150) in the first one made it working. ;)

2016-07-27 04:42:01 -0500 received badge  Supporter (source)
2016-07-27 04:25:45 -0500 commented answer tf.LookupException: "base_link" passed to lookupTransform argument target_frame does not exist.

Sorry about that. I got messed up with the names during testing. But even with the same names the error remains.

2016-07-26 11:45:17 -0500 asked a question tf.LookupException: "base_link" passed to lookupTransform argument target_frame does not exist.

Hello together,

I am new with ros tf's and already worked myself threw the tf tutorials. (I am using ros indigo) As my first test with tf's after the tutorial I wrote 2 small nodes.

The first one is sending a tf:

#!/usr/bin/env python

import rospy
import tf

class tf_firsttry_pub_class():
    def __init__(self):
        rospy.init_node('tf_firsttry_pub')
        now = rospy.Time.now()
        br = tf.TransformBroadcaster()
        while not rospy.is_shutdown():
            br.sendTransform((1, 1, 1), (0, 0, 0, 1), rospy.Time(), 'one','base_link')
            rospy.Rate(50)


if __name__ == '__main__':
    try:
        tf_firsttry_pub_class()
    except rospy.ROSInterruptException:
        pass

The second is listening to the tf:

#!/usr/bin/env python

import rospy
import tf

class tf_firsttry_listen_class():
    def __init__(self):
        rospy.init_node('tf_firsttry_listen')
        listener = tf.TransformListener()
        now = rospy.Time.now()
        while not rospy.is_shutdown():
            (trans,rot)=listener.lookupTransform('/base_link','/one',rospy.Time(0))
            print trans

if __name__ == '__main__':
    try:
        tf_firsttry_listen_class()
    except rospy.ROSInterruptException:
        pass

When starting the second node this error occurs:

line 11, in __init__ (trans,rot)=listener.lookupTransform('/base_link','/one',rospy.Time(0)) tf.LookupException: "base_link" passed to lookupTransform argument target_frame does not exist.

I already found in a different question that a try: except: shell around the listener could help as it may only fail at the beginning but that doesn't help.

As you see the code is easy but I am totally stuck. I think I misunderstood something but can't figure out what.

Any solutions?

Thanks in advance!