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

dinosaur's profile - activity

2022-03-09 10:15:54 -0500 received badge  Nice Question (source)
2021-06-12 12:28:52 -0500 received badge  Notable Question (source)
2021-06-12 12:28:52 -0500 received badge  Famous Question (source)
2021-05-19 06:49:28 -0500 received badge  Famous Question (source)
2020-03-19 11:03:16 -0500 received badge  Notable Question (source)
2020-02-07 04:48:46 -0500 received badge  Enlightened (source)
2020-02-07 04:48:46 -0500 received badge  Good Answer (source)
2019-11-15 16:18:12 -0500 marked best answer waitForTransform gets slower and slower

I'm running ros hydro on ubuntu 12.04.

I'm using openni_tracker v0.2.0. I'm trying to write a python script that draws an arrow between the user's head and right hand, using frames published by the skeleton tracker.

The two transforms kinect_link -> head_1 and kinect_link -> right_hand_1 are both getting published consistently at a rate of 30 hz.

Here are two snippets of my code:

  1. tf_listener.waitForTransform('head_1', 'right_hand_1',  rospy.Time(0), rospy.Duration(0.5))
  ...
  2. hand_pose_hand_frame = PoseStamped()
  3. hand_pose_hand_frame.header.frame_id = 'right_hand_1'
  4. hand_pose_hand_frame.pose.orientation = Quaternion(w=1.0, x=0.0, y=0.0, z=0.0)
  5. hand_pose = tf_listener.transformPose('head_1', hand_pose_hand_frame)

I need line 5 because I'm drawing the arrow in the head_1 frame. I've found that if I don't include line 1, then line 5 will often fail because the transform doesn't exist. However, line 1 is problematic. The longer my code runs, the slower line 1 runs, until eventually every call times out. I used python's time.clock() to profile my code's performance over time:

image description

Since the necessary transform information is getting published at 30 hz the whole time, I can't figure out what waitForTransform is actually waiting for.

How can I fix my call to waitForTransform so that it has the same performance at T=25 as it does at T=5?

2019-11-15 16:18:12 -0500 received badge  Nice Answer (source)
2019-11-06 10:04:44 -0500 received badge  Favorite Question (source)
2019-11-06 10:04:04 -0500 received badge  Nice Question (source)
2019-08-06 11:20:56 -0500 marked best answer ImportError for any rosdep command

Any rosdep command I try to run gives me the same error:

[robosalmon ~/catkin_ws_source_pkgs (localhost)]$ rosdep -h
Traceback (most recent call last):
  File "/usr/bin/rosdep", line 3, in <module>
    from rosdep2.main import rosdep_main
  File "/usr/lib/python2.7/dist-packages/rosdep2/__init__.py", line 45, in <module>
    from .lookup import RosdepDefinition, RosdepView, RosdepLookup, \
  File "/usr/lib/python2.7/dist-packages/rosdep2/lookup.py", line 44, in <module>
    from .sources_list import SourcesListLoader
  File "/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py", line 49, in <module>
    from .gbpdistro_support import get_gbprepo_as_rosdep_data, download_gbpdistro_as_rosdep_data
  File "/usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py", line 19, in <module>
    from .platforms.debian import APT_INSTALLER
  File "/usr/lib/python2.7/dist-packages/rosdep2/platforms/debian.py", line 34, in <module>
    from rospkg.os_detect import OS_DEBIAN, OS_LINARO, OS_UBUNTU, OsDetect
ImportError: cannot import name OS_LINARO

I've tried sudo apt-get install python-rosdep and it was apparently successful, but didn't fix rosdep.

How can I fix rosdep?

2019-08-06 11:20:56 -0500 received badge  Self-Learner (source)
2019-05-20 02:28:11 -0500 marked best answer Query rosparam for public/private status

Can the rosparam command line tool tell me whether a parameter is private or public? If so, how?

2019-05-20 02:27:35 -0500 received badge  Famous Question (source)
2018-12-07 09:53:41 -0500 received badge  Nice Question (source)
2018-11-14 13:03:56 -0500 received badge  Notable Question (source)
2018-08-31 16:06:08 -0500 received badge  Famous Question (source)
2018-06-20 13:30:32 -0500 marked best answer Why does rospy instantiate msg arrays as lists but deserialize them as tuples?

According to the ROS wiki page for msg,

In rospy, arrays are deserialized as tuples for performance reasons, but you can set fields to tuples and lists interchangeably.

I can't complain about the interchangability, but I'd expect that if msg arrays are deserialized as tuples, they would always be tuples unless the programmer explicity sets them to lists. However, I've observed that when instantiating a rospy msg using its empty constructor, any array fields are instantiated as empty lists. For example:

>>> from visualization_msgs.msg import Marker
>>> m = Marker()
>>> m.points
[]

This inconsistency means it's harder to write methods that deal with msg array fields because you have to expect the field to sometimes be an array and sometimes be a tuple. For example:

# list version -- only works if you know your marker was created by calling the constructor
def add_point_to_marker(marker, point):
    marker.points.append(point)

# tuple version -- only works if you know your marker was created by deserialization
def add_point_to_marker(marker, point):
    marker.points += point

# generic version
def add_point_to_marker(marker, point):
    marker.points = list(marker.points) + [point]

A method that naively assumes list or tuple will work perfectly until the time you pass it the other. Then it's a long and painful bug hunt.

Just wondering, am I missing something here? Why was it designed like this? Is it a bug or a feature?

2018-05-08 18:45:44 -0500 received badge  Nice Answer (source)
2018-05-08 12:28:47 -0500 received badge  Popular Question (source)
2018-03-07 06:18:46 -0500 received badge  Notable Question (source)
2017-11-06 18:52:37 -0500 marked best answer Is there a way to always supprress desktop notifications in catkin tools?

With catkin tools, I used the catkin build command to build a workspace. When finished building, it displays a desktop notification that looks like this:

image description

I know that the option --no-notify can be used to suppress notifications each time I build, but I'd like to suppress them more permanently so that I don't have to specify --no-notify every time I build.

2017-10-30 05:45:00 -0500 received badge  Popular Question (source)
2017-09-21 18:00:09 -0500 marked best answer Guide to action client state ID numbers

I'm writing an action server, and I got an unhelpful error message:

/my_action_server set_canceled:120: To transition to a cancelled state, the goal must be in a pending, recalling, active, or preempting state, it is currently in state: 2

The message is unhelpful becasue I don't know what state "2" is. I've found this documentation about action servers, but it doesn't say which state is "2".

I would like to know the indices of the various states so that I can debug my action server.

2017-09-21 18:00:05 -0500 received badge  Popular Question (source)
2017-09-20 21:45:08 -0500 asked a question Guide to action client state ID numbers

Guide to action client state ID numbers I'm writing an action server, and I got an unhelpful error message: /my_action_

2017-09-12 20:23:12 -0500 edited question How can I configure the prefix that prints with a log message?

How can I set the prefix that prints with a log message? Ros log messages print out with a prefix. The prefix may inclu

2017-09-12 20:22:58 -0500 asked a question How can I configure the prefix that prints with a log message?

How can I set the prefix that prints with a log message? Ros log messages print out with a prefix. The prefix may inclu

2017-08-23 01:00:01 -0500 received badge  Popular Question (source)
2017-08-18 19:34:14 -0500 asked a question Query rosparam for public/private status

Query rosparam for public/private status Can the rosparam command line tool tell me whether a parameter is private or pu

2017-06-28 13:09:18 -0500 asked a question Is there a way to always supprress desktop notifications in catkin tools?

Is there a way to always supprress desktop notifications in catkin tools? With catkin tools, I used the catkin build com

2017-06-14 11:13:23 -0500 received badge  Self-Learner (source)
2017-04-20 14:38:39 -0500 marked best answer Rviz image status "ok" but no image

I'm having trouble viewing a kinect image in RViz. Today, the same rviz config file that has worked in the past did not work. I thought there may be a problem with rviz, so I uninstalled and reinstalled it. That may be part of the problem.

System:

  • ros hydro on ubuntu 12.04
  • rviz version 1.10.20 compiled against OGRE version 1.7.4 (Cthugha)
  • Video card (from lspci): NVIDIA Corporation GK106 [GeForce GTX 645 OEM] (rev a1)
  • using kinect v1 with openni_launch driver

Steps taken:

  1. Click Add, select Image
  2. Set topic to /yellow_kinect/rgb/image_color

Result:

  • Image status is "Ok"
  • Number of frames is incrementing normally
  • No image shown -- just black pixels in the image panel

Other things tried:

  • Tried using the Camera display type in my RViz, instead of Image. This does not work either (it's an all-white image).

Sanity checks:

  • rosrun image_view image_view image:=/yellow_kinect/rgb/image_color -- When I do this, I see the live image, not black.
  • I confirmed that RViz and the kinect are both talking to ros master on the same machine (my robot)
  • When I try the same thing from another computer in my lab, the image shows up correctly in RViz.

I think it's an issue with the state of ROS or RViz on my desktop. I was using RViz constantly with the same system setup for weeks. Then I wasn't using it for a few weeks, and now it's broken.

Any suggestions on how to make RViz display the camera images would be greatly appreciated!

2017-03-13 01:03:28 -0500 received badge  Notable Question (source)
2017-03-13 01:03:28 -0500 received badge  Famous Question (source)
2016-09-21 17:01:39 -0500 received badge  Famous Question (source)
2016-09-21 17:01:39 -0500 received badge  Notable Question (source)
2016-07-05 15:41:30 -0500 received badge  Famous Question (source)
2016-06-09 13:56:18 -0500 received badge  Notable Question (source)
2016-06-09 13:56:18 -0500 received badge  Famous Question (source)
2016-06-06 07:36:39 -0500 received badge  Famous Question (source)
2016-06-03 17:11:48 -0500 received badge  Famous Question (source)
2016-06-03 14:24:28 -0500 received badge  Famous Question (source)
2016-04-27 13:01:15 -0500 received badge  Famous Question (source)