Ask Your Question

jker's profile - activity

2015-06-03 07:30:30 -0500 received badge  Nice Question (source)
2014-11-15 04:11:04 -0500 received badge  Nice Question (source)
2014-05-29 10:52:47 -0500 received badge  Taxonomist
2014-05-29 00:00:29 -0500 received badge  Famous Question (source)
2014-03-24 02:03:28 -0500 received badge  Famous Question (source)
2014-02-19 02:52:55 -0500 received badge  Famous Question (source)
2014-02-16 20:44:24 -0500 received badge  Famous Question (source)
2014-01-28 17:31:13 -0500 marked best answer ROS Qt Interrupted System Call On Plugin Startup

I've recently been working on a python widget for rqt that creates a separate thread to read joystick data in from a pipe. I've tested it as a standalone python program and confirmed that it's getting valid data. However, when I put it into a python plugin for rqt that I've already created and tested, it crashes. After some tweaking of the code, it looks like it crashes at the end of the __init__ function in the plugin with IOError: [Errno 4] Interrupted system call when the pipe read is interrupted.

The initialization is basically:

  1. Create a joystick object that creates a thread to endlessly read in data from /dev/input/js0; start running it
  2. Create thread to endlessly check the Joystick object containing this other thread to look for new data; start running it
  3. Wait 5 seconds, during which joystick data prints out fine as I would expect
  4. The 5 Second wait ends, IOError: [Errno 4] Interrupted system call is thrown, and rqt loads as normal

A snippet of the plugin code is below. The Joystick class being referenced creates a thread in the same manner, opens a pipe using self._pipe = open('/dev/local/js0', 'r'), then reads in raw data for parsing using for character in

    class Joystick(Plugin):
      # Variables...
      def __init__(self, context):
          # Some initialization code here...
          # Create the joystick object and run its thread
          self._joystick_reader = LinuxJoystickReader()
          # Create a local thread and run it to print the joystick data
          self._joystick_thread_run = True
          self._joystick_read_thread = Thread(target=self.pub_joystick, args=())
          # Sleep, during which the data prints out fine
          # -- ERROR --
          # File "" line 35, in read_pipe
          # for character in
          # IOError: [Errno 4] Interrupted system call

       def pub_joystick(self):
         while self._joystick_thread_run:
           if self._joystick_reader.has_new_data():
             pub_str = str(self._joystick_reader.get_data_array()[0]) + ", " + str(self._joystick_reader.get_data_array()[1])
             print pub_str
2014-01-28 17:29:32 -0500 marked best answer Run Script on Starting rqt_gui Shell Plugin

I've been looking to automate a setup for rqt_gui, and I was wondering if there was any way to run a script on startup of an rqt_gui Shell plugin object. I know the shell currently acts normally and sources the .bashrc when started, but I was hoping that I could make a small script that would only be run in this shell (not in any normal shell I might use). I'm not too sure this is actually possible, but I figured it couldn't hurt to ask, if only to find out it can't be done easily.

2014-01-28 17:28:58 -0500 marked best answer Set rqt_gui Perspectives from Command Line

I'm currently writing a script to start rqt_gui with just the right preferences without any setup. So far I've been able to get the rviz preferences to be correct by copying a saved .vcg file to the ~/.rviz/ directory, where it stores such settings. I was hoping I could do something similar for rqt_gui.

My question is how do I make rqt_gui recognize a .preferences file from the command line? I know how to start up rqt_gui using the -p command to set the startup perspective, the problem is getting rqt_gui to recognize this perspective when opened for the first time.

2014-01-28 17:27:30 -0500 marked best answer Fuerte - kdl_conversions package missing

I recently downloaded the latest arm_navigation (from for my recent Fuerte install. However when I attempt to build the arm_kinematics_constraint_aware package, I get the following error.

arm_navigation/arm_kinematics_constraint_aware/src/kdl_arm_kinematics_plugin.cpp:35:37: fatal error: kdl_conversions/kdl_msg.h: No such file or directory

I double checked and there is indeed no kdl_conversions package in my ROS_PACKAGE_PATH (let alone in geometry, where I expected it to be).

So I downloaded the geometry package (from hg and make the ROS_PACKAGE_PATH reference it instead. However, I can't build it because it uses catkin (I tried to go through the tutorials, but I couldn't get it to work). Is there any way to get a regular version of geometry that uses rosmake for Fuerte? Or some way to get arm_navigation working without kdl_conversions?

I also ran

sudo apt-get install ros-fuerte-arm-navigation --fix-missing

for the heck of it, but it didn't fix my problem.

2014-01-28 17:27:06 -0500 marked best answer Upgrading to Fuerte and Ubuntu 12.04 Woes

I recently decided to upgrade my project created on Electric on Ubuntu 10.04 to Fuerte and 12.04 for various reasons. Everything worked fine with the old setup, and many things would be broken in the upgrade. I managed to fix most of them, however there are several which I just cannot figure out and have been unable to find clear explanations about online. I've tried to make the descriptions brief so this post doesn't become monstrous, but please ask questions if you have them and I'll try to stay on top of this post. Also, I can't get the hang of formatting for these posts, so I put the lines as numbered lists, the numbers don't actually mean anything.


Problem A) It looks like it can't find file, or that I need to manually add it. However any attempt to do so in the CMakeLists.txt file for the package just turns up more errors.

  1. [ 80%] Building CXX object src/utils/CMakeFiles/getFirmwareVersion.dir/getFirmwareVersion.o
  2. Linking CXX executable ../../../bin/getFirmwareVersion
  3. /usr/bin/ld: CMakeFiles/getFirmwareVersion.dir/getFirmwareVersion.o: undefined reference to symbol 'typeinfo for log4cxx::helpers::ObjectPtrBase'
  4. /usr/bin/ld: note: 'typeinfo for log4cxx::helpers::ObjectPtrBase' is defined in DSO /usr/lib/ so try adding it to the linker command line
  5. /usr/lib/ could not read symbols: Invalid operation
  6. collect2: ld returned 1 exit status <h2&gt;<br/></h2&gt;<>

Problem B) I'm very confused as to why the uvc_camera package suddenly needs a .cfg file, as it wasn't an issue before.

  1. CMake Error at /opt/ros/fuerte/stacks/dynamic_reconfigure/cmake/cfgbuild.cmake:82 (message):
    Dynamic reconfigure has been invoked but could not find a .cfg to build.
    Please add one to your package/cfg directory. Aborting.
  2. Call Stack (most recent call first):
    /opt/ros/fuerte/stacks/dynamic_reconfigure/cmake/cfgbuild.cmake:87 (gencfg_cpp)
    CMakeLists.txt:25 (include) <h2&gt;<br/></h2&gt;<>

Problem C) There are many more errors similar to the ones below that I left out to make this post shorter. From what it looks like, tf got a few major changes, do I just have to go through manually and change everything to the new tf functions and objects?

  1. /myRos/laser_pipeline/laser_geometry/src/laser_geometry.cpp: In member function 'void laser_geometry::LaserProjection::transformLaserScanToPointCloud_(const string&, sensor_msgs::PointCloud&, const LaserScan&, tf::Transformer&, double, int)':
  2. /myRos/laser_pipeline/laser_geometry/src/laser_geometry.cpp:251:86: error: no matching function for call to 'btVector3::setInterpolate3(tf::Vector3&, tf::Vector3&, btScalar&)'
  3. /myRos/laser_pipeline/laser_geometry/src/laser_geometry.cpp:251:86: note: candidate is:
  4. /opt/ros/fuerte/stacks/bullet/include/LinearMath/btVector3.h:236:25: note: void btVector3::setInterpolate3(const btVector3&, const btVector3&, btScalar)
  5. /opt/ros/fuerte/stacks/bullet/include/LinearMath/btVector3.h:236:25: note: no known conversion for argument 1 from 'tf::Vector3' to 'const btVector3&'
  6. /myRos/laser_pipeline/laser_geometry/src/laser_geometry.cpp:256:48: error: no matching function for call to 'tf::Matrix3x3::getRotation ...
2014-01-28 17:26:54 -0500 marked best answer rospy logging not printing across computers

The Setup: Two computers, both running various nodes. Computer A is the master where the launch file is run from that launched all the nodes being used. Computer B is a slave running several nodes as directed by Computer A.

The Problem: While running a python node, I noticed that none of the rospy.log*() calls print anything to the screen on A when it is called by a node on B. However calling the rospy logging functions while on A prints on A (I haven't tried checking B, as I'm not sure how to force ROS terminal output).

My Attempts: I've tried all of the logging levels, and manually setting the log level of the node, but no dice. As a workaround I've just been publishing debug information to a topic from the node in B and echoing the topic on A, but this is a messy way to get it done and it would be simpler to just have everything print in the main terminal the launch file is run from.

2014-01-28 17:25:38 -0500 marked best answer pr2 Keeps Dropping Objects

I've been working with the pr2 pick and place example, and it seems that whenever the robot picks up an object (in this case, the mug from gazebo_worlds/objects/coffee_cup.model) and then moves either the base or the arm around around, the object wiggles out of the robot's grasp. I've changed the max force on the grasp from 50 (the default in the pick and place example) to 1000, but it seems to make no difference. Is there some way to prevent the object from falling out of the robot's grasp? It does not seems very realistic, is it some sort of bug in the simulator?

2014-01-28 17:25:22 -0500 marked best answer Spawn an .obj or .stl file in Gazebo

I recently got a couple models that I would like to import into gazebo. However they are of .obj and .stl file types (I have each model in both formats). Is there a direct way to import these models into Gazebo? Do I need to convert them to something else first?

I've made simple models out of boxes for Gazebo by writing raw xml files using commands like

rosrun gazebo spawn_model -file my_path/fridge.xml -gazebo -model Fridge -x 0 -y 1 -z .4 -Y 3.14159

However using this command and replacing -gazebo with -urdf just throws errors like

SpawnModel: Failure - model format is


GazeboROSNode SpawnModel Failure: input model_xml not Gazebo XML, or cannot be converted to Gazebo XML not URDF (nor COLLADA).

Clearly obj and stl are not the correct formats for these commands, so how is it done?

2014-01-28 17:25:16 -0500 marked best answer Setting Specific Turn Angle on the PR2

I have been working with the PR2 robot for a few weeks and I've found the need to have the robot rotate in place 90 to 180 degrees clockwise and counterclockwise. I'm working in Python and looked at the teleop package, and found a Python example here. The only problem, however, is that all of these systems only set the robot's velocity, whereas I just need the robot to turn to a specific angle while it is operating (and I haven't found any guides to this end). I could implement my own listener that takes in a desired angle then uses the teleop commands along with a PID control to turn to that angle, but I was hoping there was already a method for what I'm trying to do (preferably in Python) since it seems like a basic operation most users would probably find useful.

EDIT: I also found that geometry_msgs already has a message for pose which makes me think that there is an implementation for this somewhere (or perhaps this is just how the PR2 advertises it's current pose?)
tl;dr - How do I make the robot turn to a specific angle (in the global frame) in Python?

EDIT: I've gotten the package at and tried out the SLAM application in an empty world, and the robot goes to a random point when I set the pose to [0 0 0 0 03.14159 0]. Using the local version/however, the program gets stuck waiting for the action client to start.

move_base_client_ = actionlib.SimpleActionClient('move_base', MoveBaseAction)
move_base_client_.wait_for_server() # Gets stuck at this line using local

target = Pose(Point(0.0, 0.0, 0.0), Quaternion(0.000, 0.000, 3.14159, 0.0))
goal = MoveBaseGoal()
goal.target_pose.header.frame_id = '/map' # For local I use '/base_link'
goal.target_pose.pose = target

before these I run roslaunch pr2_gazebo pr2_empty_world.launch and then either roslaunch pr2_2dnav_slam pr2_2dnav.launch or roslaunch pr2_2dnav_local pr2_2dnav.launch

2014-01-28 17:25:11 -0500 marked best answer PR2 Pick and Place Crashes in

Hi I'm new to ROS, I've downloaded and installed Electric, and now I'm trying to get the PR2 to pick up and place objects in the Gazebo simulator. I'm interested in writing my own pick-and-place package using Python, so I've been following the tutorial here. I've downloaded all the relevant packages and I execute the command below in that order.

roslaunch pr2_gazebo pr2_empty_world.launch roslaunch gazebo_worlds table.launch roslaunch gazebo_worlds coffee_cup.launch export ROBOT=sim roslaunch pr2_tabletop_manipulation_launch pr2_tabletop_manipulation.launch stereo:=true rosrun pr2_pick_and_place_demos

Everything launches fine except for the last command, which gets stuck at the message:

[INFO] [WallTime: 1333224769.117507] [1004.719000] ik_utilities: waiting for IK services to be there

I'm not sure why it can't find IK services (or what they are, since I can't find it in the tutorial), so what is it and how do I get it so the PR2 can grasp objects?

EDIT: For some reason it gets past this line now, but after it moves the arms and head it crashes with the output below (Sorry about the format, but pasting here I can't get the newlines to work properly unless I space it out to every other line):

[INFO] [WallTime: 1333234720.247776] [431.624000] ik_utilities: waiting for IK services to be there

[INFO] [WallTime: 1333234720.370728] [431.630000] ik_utilities: services found

[INFO] [WallTime: 1333234720.388736] [431.631000] getting the IK solver info

[INFO] [WallTime: 1333234720.440548] [431.632000] done getting the IK solver info

[INFO] [WallTime: 1333234720.514891] [431.636000] ik_utilities: done init

[INFO] [WallTime: 1333234720.527255] [431.637000] done creating IKUtilities class objects

Traceback (most recent call last):

File "/opt/ros/electric/stacks/pr2_object_manipulation/applications/pr2_pick_and_place_demos/test/", line 110, in <module> sppe = SimplePickAndPlaceExample()

File "/opt/ros/electric/stacks/pr2_object_manipulation/applications/pr2_pick_and_place_demos/test/", line 54, in __init__ self.papm = PickAndPlaceManager()

File "/opt/ros/electric/stacks/pr2_object_manipulation/applications/pr2_pick_and_place_demos/src/pr2_pick_and_place_demos/", line 172, in __init__ self.cms[0] = controller_manager.ControllerManager('r', self.tf_listener, use_slip_controller, use_slip_detection)

File "/opt/ros/electric/stacks/pr2_object_manipulation/manipulation/pr2_gripper_reactive_approach/src/pr2_gripper_reactive_approach/", line 243, in __init__ self.cartesian_desired_pose = self.get_current_wrist_pose_stamped('/base_link')

File "/opt/ros/electric/stacks/pr2_object_manipulation/manipulation/pr2_gripper_reactive_approach/src/pr2_gripper_reactive_approach/", line 676, in get_current_wrist_pose_stamped (current_trans, current_rot) = self.return_cartesian_pose(frame)

File "/opt/ros/electric/stacks/pr2_object_manipulation/manipulation/pr2_gripper_reactive_approach/src/pr2_gripper_reactive_approach/", line 1429, in return_cartesian_pose (trans, rot) = self.tf_listener.lookupTransform(frame, self.whicharm+'_wrist_roll_link', rospy.Time(0)) tf.ExtrapolationException: Lookup would require extrapolation into the past. Requested time 431.621000000 but the earliest data is at time 431.960000000, when looking up transform from frame [/r_wrist_roll_link] to frame [/base_link]

Exception in thread Thread-32 (most likely raised during interpreter shutdown): Traceback (most recent call last):

File "/usr/lib/python2.6/", line 532, in __bootstrap_inner

File "/usr/lib/python2.6/", line 484, in run

File "/opt/ros/electric/stacks/pr2_object_manipulation/manipulation/pr2_gripper_reactive_approach/src/pr2_gripper_reactive_approach/", line 80, in joint_states_listener

File "/opt/ros/electric/stacks ... (more)

2013-10-23 12:03:08 -0500 received badge  Famous Question (source)
2013-10-18 02:24:11 -0500 received badge  Notable Question (source)
2013-09-07 20:22:46 -0500 received badge  Popular Question (source)
2013-08-27 07:33:04 -0500 marked best answer Foreign Relay Spams Topic

I have two ROS masters running on the same machine (on different ports) that I want to publish/subscribe a topic between one another. I've been using Foreign Relays for this purpose, since I've successfully used them to communicate between robots on different machines. However, whenever I run my relay and publish once to it on master A, the receiving topic on master B gets spammed with that one message at a rate of approximately 40,000Hz. These are the same parameters I've used in the launch files in packages where foreign relays work as expected, so I'm not sure why they are behaving differently as the only difference is that they're communicating on the same computer.

Master A's .launch file:

  <node name="generic_msg_foreign_relay" pkg="foreign_relay" type="foreign_relay"
        args="adv http: //localhost:11311 /test /test" respawn="true"/>

Master B's .launch file:

  <node name="respond_to_test_topic" pkg="testing"
        type="" output="screen" respawn="true"/>

And to publish I've just manually done rostopic pub /test std_msgs/String 'testing' once (no change with the -1 argument either).

I have not yet looked into Multimaster because I was hoping to not have to use any new packages (and foreign relay seems more customizable in terms of declaring the masters on startup), but if that's the only solution it'll have to do. However I'd like to know first if anyone can reproduce what I'm seeing, and if anyone has an idea what the problem might be?