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

Albatross's profile - activity

2022-11-03 18:52:13 -0500 received badge  Great Question (source)
2018-07-05 22:34:06 -0500 received badge  Good Question (source)
2016-07-07 13:59:43 -0500 received badge  Famous Question (source)
2016-03-19 18:38:51 -0500 received badge  Nice Question (source)
2016-01-11 11:14:51 -0500 commented answer How to change the version of Python catkin uses

I checked the date on catkin_create_pkg from /usr/local, turns out it was created in 2013, so it must have been from when I was mucking around with ROS in the past. I thought I uninstalled all of the old stuff and replaced it with the new version, but it seems a few things were missed.

2016-01-11 11:06:47 -0500 commented answer How to change the version of Python catkin uses

Thanks! I've got it working now. Uninstalling with pip or pip3 didn't fix it (got a message saying it couldn't find anything to uninstall) so what I ended up doing was just renaming the file in /usr/local/bin to something else so it wouldn't use that one.

2016-01-11 10:42:52 -0500 received badge  Notable Question (source)
2016-01-09 03:19:11 -0500 received badge  Popular Question (source)
2016-01-08 13:54:36 -0500 commented question How to change the version of Python catkin uses

I'm using Ubuntu 14.04 with ROS Indigo. I think installed it with apt-get install python-catkin-pkg, I also did an install of ros-indigo-desktop-full earlier when going through the tutorials, which may have included it?

2016-01-08 12:49:08 -0500 asked a question How to change the version of Python catkin uses

I'm trying to create a package with catkin_create_pkg but it is failing with this error:

Traceback (most recent call last):
File "/usr/local/bin/catkin_create_pkg", line 10, in <module> from catkin_pkg.package_templates import create_package_files, PackageTemplate ImportError: No module named 'catkin_pkg'

I think this is because it is trying to use Python 3 rather than Python 2. (running python -c "import catkin_pkg" works, but running python3 -c "import catkin_pkg" gives the import error)

Is there a nice way to switch it to always use Python 2 instead (the default Python on my system, and the one I prefer to use)? I just installed it with apt-get following the tutorials. Other stuff like catkin_make and catkin_init_workspace work fine, catkin_create_pkg was the first command I ran into that didn't work.

2015-11-28 16:19:41 -0500 marked best answer PCL not being built with rosmake

I'm trying to build ROS fuerte on my debian sid/jessie machine. I'm compiling from source as the apt-get stuff doesn't work for me. Pretty much everything runs fine except packages that depend on the PCL package. When I try to build the gazebo_plugins with rosmake, I get an error like the one below:

  mkdir -p bin
  cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake  ..
  [rosbuild] Building package gazebo_plugins
  Failed to invoke /opt/ros/fuerte/bin/rospack deps-manifests gazebo_plugins
  [rospack] Error: package/stack gazebo_plugins depends on non-existent package pcl


  CMake Error at /opt/ros/fuerte/share/ros/core/rosbuild/public.cmake:129 (message):


    Failed to invoke rospack to get compile flags for package 'gazebo_plugins'.
    Look above for errors from rospack itself.  Aborting.  Please fix the
    broken dependency!

  Call Stack (most recent call first):
    /opt/ros/fuerte/share/ros/core/rosbuild/public.cmake:203 (rosbuild_invoke_rospack)
    CMakeLists.txt:4 (rosbuild_init)


  -- Configuring incomplete, errors occurred!

I tried doing rosmake on perception_pcl, but ended up with this error:

  mkdir -p bin
  cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake  ..
  [rosbuild] Building package pcl_ros
  [rosbuild] Including /opt/ros/fuerte/share/roscpp/rosbuild/roscpp.cmake
  [rosbuild] Including /opt/ros/fuerte/share/roslisp/rosbuild/roslisp.cmake
  [rosbuild] Including /opt/ros/fuerte/share/rospy/rosbuild/rospy.cmake
  -- [rosbuild] Found SSE3 extensions, using flags: -msse3 -mfpmath=sse
  CMake Error at CMakeLists.txt:21 (find_package):
    By not providing "FindPCL.cmake" in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by "PCL", but
    CMake did not find one.

    Could not find a package configuration file provided by "PCL" with any of
    the following names:

      PCLConfig.cmake
      pcl-config.cmake

    Add the installation prefix of "PCL" to CMAKE_PREFIX_PATH or set "PCL_DIR"
    to a directory containing one of the above files.  If "PCL" provides a
    separate development package or SDK, be sure it has been installed.


  -- Configuring incomplete, errors occurred!

It seems like there is a cmake file missing? I did a grep of my system, and the files it mentions aren't anywhere. I also tried downloading the stand-alone pcl code from github, and these files still don't exist.

I feel like I am doing something wrong, but I am not sure how to fix it, any help would be greatly appreciated. I am new to ROS and fairly new to unix. Let me know if you need any more information. Thanks! :)

2015-06-04 15:39:56 -0500 received badge  Famous Question (source)
2014-04-20 06:54:55 -0500 marked best answer Easiest way to control an inverted pendulum

I'm trying to create a simple model for a controller of an inverted pendulum.

What I have so far is a model that receives position and velocity from the pendulum, and outputs motor commands. What I want is a physical model that this controller can interact with (using ROS topics to communicate between the two)

I have a feeling this should be relatively simple, but I can't seem to find a good place to start. I think all I need is a rod with mass/intertia with a revolute joint attached to a cart, that can move linearly.

What would you suggest as the best way to set up this environment? I've looked at http://www.openrobots.org/morse/doc/stable/user/actuators/armature.html (armature actuators) in MORSE, but I'm not sure how to build a model that can use them properly.

Any help or suggestions will be much appreciated! :)

I've mostly been using MORSE/Blender, and I'd prefer to keep working with that simulator, but a solution using Gazebo would be okay as well

(I'm using ROS Fuerte on Debian Jessie, with Gazebo 1.7 and MORSE 1.0.1)

EDIT:

Just to follow up in case anyone else runs into a similar problem, here is a list of tutorials that I've found to be helpful:

Accessing and modifying joint state: http://gazebosim.org/wiki/Tutorials/1.3/intermediate/pid_control_joint Revolute joint for the pendulum: http://gazebosim.org/wiki/Tutorials/1.2/control_robot/animate_joint Creating a subscriber for ROS messages: http://gazebosim.org/wiki/Tutorials/1.5/ros_enabled_model_plugin Pendulum control for newer version of Gazebo (doesn't work for me, but might for you): http://gazebosim.org/wiki/Tutorials/1.9/Using_A_URDF_In_Gazebo

2014-04-20 06:54:42 -0500 marked best answer How do I convert an ROS image into a numpy array?

Hi All,

I'm trying to read ROS images published from a video camera (from MORSE) into a numpy array in my python script, but I don't know what is the correct way to do this, and everything I have tried hasn't worked.

Does anyone know how to do this?

Here is a snippet of what I have tried so far:

import numpy 
import rospy 
from sensor_msgs.msg import Image

def vis_callback( data ):
  im = numpy.array( data.data, dtype=numpy.uint8 )
  doSomething( im )
rospy.init_node('bla',anonymous=True)
sub_vis = rospy.Subscriber('navbot/camera/image',Image,vis_callback)

rospy.spin()

I get an error that looks like this:

[ERROR] [WallTime: 1370383204.000265] bad callback: <function vis_callback at 0x32e2398>
Traceback (most recent call last):
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/ros_comm-1.8.15-py2.7.egg/rospy/topics.py", line 678, in _invoke_callback
    cb(msg)
  File "ros_simulate.py", line 55, in vis_callback
    im = numpy.array(data.data,dtype=numpy.uint8)
ValueError: invalid literal for long() with base 10: "':\x0f\xff';\x10\xff+A\x12\xff7Q\x16\xffB`\x18\xffGg\x18\xffDa\x15\xff=W\x12\xff2H\r\xff*<\x0b\xff&8\n\xff$6\t\xff%6\t\xff'9\n\xff*>\n\xff0G\x0b\xff8S\x0b\xff;Y\n\xff:X\t\xff8V\x07\xff6T\x06\xff2N\x04\xff-F\x04\xff+B\x03\xff&<\x03\xff(?\x05\xff#8\x07\xff\x1e0\x07\xff\x19)\x07\xff\x19(\x08\xff\x1b+\t\xff\x1e0\x0b\xff\x1e0\x0b\xff 3\x0c\xff\x1e1\x0b\xff\x1e1\x0b\xff\x1d/\n\xff\x1c-\t\xff\x1c,\t\xff\x1a*\x08\xff\x1d.\x08\xff(>\x0b\xff-F\x0c\xff<[\x0f\xffJo\x12\xffJp\x12\xffKr\x12\xffLs\x12\xffMt\x13\xffMu\x13\xff"

I noticed that the Image object has a deserialize_numpy() method, I couldn't find any documentation on how to use it, so I crossed my fingers and tried it out:

def vis_callback( data ):
  im = numpy.array(data.deserialize_numpy(data.data, numpy ), dtype=numpy.uint8)
  doSomething( im )

and got more errors:

[ERROR] [WallTime: 1370383699.289428] bad callback: <function vis_callback at 0x34b5410>
Traceback (most recent call last):
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/ros_comm-1.8.15-py2.7.egg/rospy/topics.py", line 678, in _invoke_callback
    cb(msg)
  File "ros_simulate.py", line 53, in vis_callback
    im = numpy.array(data.deserialize_numpy(data.data, numpy ), dtype=numpy.uint8)
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/sensor_msgs/msg/_Image.py", line 282, in deserialize_numpy
    raise genpy.DeserializationError(e) #most likely buffer underfill
DeserializationError: unpack requires a string argument of length 8
2014-04-10 05:05:28 -0500 received badge  Notable Question (source)
2014-03-25 17:06:43 -0500 received badge  Enlightened (source)
2014-03-25 17:06:43 -0500 received badge  Good Answer (source)
2014-03-25 09:17:58 -0500 commented answer rosjava - errors setting up a simple publisher
2014-03-25 09:17:46 -0500 commented answer rosjava - errors setting up a simple publisher

For me I didn't use eclipse, and I had to manually find and download various libraries to get it running. Most things were installed in the /opt/ros/hydro/share/maven/ directory, I kept a list of the other dependencies that I will post below.

2014-03-23 21:16:10 -0500 received badge  Nice Answer (source)
2014-03-12 04:52:50 -0500 received badge  Good Question (source)
2014-03-12 04:42:27 -0500 received badge  Famous Question (source)
2014-01-31 16:43:31 -0500 marked best answer rosjava - errors setting up a simple publisher

I'm trying to set up a simple publisher using rosjava (pure java, I don't need Android). I've been following some tutorials and making lots of progress, but now I'm stuck. Here is the code I have so far:

import org.ros.concurrent.CancellableLoop;
import org.ros.namespace.GraphName;
import org.ros.node.AbstractNodeMain;
import org.ros.node.ConnectedNode;
import org.ros.node.NodeMain;
import org.ros.node.topic.Publisher;

import org.ros.node.NodeConfiguration;
import org.ros.node.Node;
import org.ros.internal.node.DefaultNode;

import org.ros.node.DefaultNodeFactory;

import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.Executors;

public class Publisher_Test {

  private DefaultNode node;
  //private Publisher<std_msgs.String> publisher;

  private final ScheduledExecutorService scheduler =
           Executors.newScheduledThreadPool(1);

  public Publisher_Test() {
    NodeConfiguration node_cfg = NodeConfiguration.newPrivate();
    DefaultNodeFactory factory = new DefaultNodeFactory( scheduler );
    node = (DefaultNode)factory.newNode( node_cfg );

    System.out.println("In Constructor");
    final Publisher<std_msgs.String> publisher = node.newPublisher("chatter", std_msgs.String._TYPE);
    node.executeCancellableLoop( new CancellableLoop() {

            private int seq;

            @Override
        protected void setup() {
            seq=0;
            System.out.println("Setting up loop");
        }

            @Override
        protected void loop() throws InterruptedException {

            System.out.println("Looping");
            try {
              while (true) {
                    org.ros.message.std_msgs.String();
            std_msgs.String str = publisher.newMessage();
            str.setData( "Hello world! " + seq++ );
            publisher.publish(str);
            Thread.sleep(1000);
              }
            } catch (Exception e) {
              e.printStackTrace();
            }
        }
    });
  }
}

I've been basing this off of this question and this tutorial. Some of the syntax used is out of data, so I've been looking through the source code here to get things to compile.

I'm using ROS Hydro on an Ubuntu 13.04 machine. My goal is to get a publisher and subscriber implemented in pure java running in jython. I've compiled my class using javac, and can import it into jython fine, I get an error when I try to set up my node in the constructor for Publisher_Test:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    at org.ros.concurrent.ListenerGroup.addAll(ListenerGroup.java:85)
    at org.ros.concurrent.ListenerGroup.addAll(ListenerGroup.java:101)
    at org.ros.internal.node.DefaultNode.<init>(DefaultNode.java:132)
    at org.ros.node.DefaultNodeFactory.newNode(DefaultNodeFactory.java:41)
    at org.ros.node.DefaultNodeFactory.newNode(DefaultNodeFactory.java:46)
    at Publisher_Test.<init>(Publisher_Test.java:31)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.python.core.PyReflectedConstructor.constructProxy(PyReflectedConstructor.java:210)

java.lang.NullPointerException: java.lang.NullPointerException

From what I understand so far, it looks like DefaultNodeFactory is setting up the DefaultNode with the Collection<nodelistener> to be null (which looking at the source code seems to be a valid thing to do), and then the addAll() method which is called in the DefaultNode constructor throws this exception when it tries to iterate on null.

I'm thinking I need to give a Listener to the DefaultNodeFactory, but I am unsure how I would go about doing this. What is a ... (more)

2014-01-31 16:43:31 -0500 received badge  Teacher (source)
2014-01-31 16:43:31 -0500 received badge  Self-Learner (source)