Ask Your Question

superawesomepandacat's profile - activity

2019-05-09 11:44:52 -0600 received badge  Great Question (source)
2017-02-17 06:17:36 -0600 received badge  Nice Answer (source)
2016-09-21 02:57:37 -0600 received badge  Famous Question (source)
2016-04-12 07:36:57 -0600 received badge  Good Question (source)
2015-06-29 03:28:43 -0600 received badge  Famous Question (source)
2014-10-11 04:04:44 -0600 received badge  Nice Answer (source)
2014-01-28 17:29:43 -0600 marked best answer Extract values in DisparityImage

I am trying to extract the values of certain points in a stereo_msgs::DisparityImage message. I'm assuming that the values are stored in "sensor_msgs/Image image" inside the DisparityImage message. So I did this:

void disparityrelay::callback(const stereo_msgs::DisparityImage::ConstPtr& disparity)
    cv_bridge::CvImagePtr cv_ptr;
        cv_ptr = cv_bridge::toCvCopy(disparity->image, sensor_msgs::image_encodings::TYPE_32FC1);
    catch (cv_bridge::Exception& e)
        ROS_ERROR("cv_bridge exception: %s", e.what());

    imshow("Display", cv_ptr->image);

But all I got is a black and white image. Did I do something wrong, or am I just not approaching this correctly?

2014-01-28 17:29:42 -0600 marked best answer TimeSynchronizer too slow for PointCloud2 and LaserScan.

I used messaged_filters to sync messages from a pointcloud2 topic and and a laserscan topic, process, and publish it. But the publish rate is too slow for it to be of any use, even without doing anything in the processing bit. About 5-8 seconds for each published.

Does anyone know any alternatives?

2014-01-28 17:29:29 -0600 marked best answer opencv stereo correspondence "OpenCV Error: Bad argument (Unknown array type) in cvarrToMat"

I'm trying to compute depth using stereo correspondence but keep getting the error in the title of this question. I don't really know how to debug this.


        void imageprocess::get_depth()
            Size size = bridge[0]->image.size();
            Mat imgl, imgr, disp;

            cvtColor(bridge[0]->image, imgl, CV_RGB2GRAY, 1);
            cvtColor(bridge[1]->image, imgr, CV_RGB2GRAY, 1);

            CvStereoBMState* state = cvCreateStereoBMState(0, 16);
            cvFindStereoCorrespondenceBM(&imgl, &imgr, &disp, state);

            imshow(WINDOWM, disp);


Unless my C++ is a lot rustier than I thought, I think I'm using the functions correctly. Which is why I don't see any problem with my code.

It works fine without:

cvFindStereoCorrespondenceBM(&imgl, &imgr, &disp, state);

and the function decleration is:

cvFindStereoCorrespondenceBM(const CvArr* left, const CvArr* right, CvArr* disparity, CvStereoBMState* state)

Edit: I also tried from

    Size size = bridge[0]->image.size();
    Mat imgl, imgr;

    cvtColor(bridge[0]->image, imgl, CV_RGB2GRAY, 1);
    cvtColor(bridge[1]->image, imgr, CV_RGB2GRAY, 1);

    CvMat cvimgl, cvimgr, cvdisp;

    cvimgl = imgl;
    cvimgr = imgr;

    CvStereoBMState* state = cvCreateStereoBMState(0, 16);
    cvFindStereoCorrespondenceBM(&cvimgl, &cvimgr, &cvdisp, state);
2014-01-28 17:29:28 -0600 marked best answer Subscribing to multiple topics of the same type.

Is it possible to subscribe to multiple topics of the same type using a single callback function? If it's possible, I can't figure out how.

Please and thank you.

2014-01-28 17:29:28 -0600 marked best answer gmapping: base_link to odom missing

The simulated robot I'm using does not define a transformation from \base_link to \odom. When I started Gazebo and load the robot, the top most node of the frames tree is the \base_link.

When I run gmapping, \odom is automatically created with a \map parent, on a separate tree from the rest of the robot's frames.

So I'm manually writing a transformation from \base_link to \odom. However, there's a nav_msgs::odometry topic published by the robot which I suspect is the odometry of the robot in the world frame. I can't figure out how to make use of that topic.

Do I just read from it and broadcast the transform like in How would gmapping know which is the odometry frame? Is it the name?

If it's the name then the \base_link frame of my robot isn't named "base_link". Is that a problem?

On a related note, does the transformation from base_link to laser has to be direct? Or as long as a path on the tree exists, it's fine?

2014-01-28 17:28:10 -0600 marked best answer Newbie Dependency Question

First of all, I have to admit that I've only did the tutorials until ROS/Tutorials/UsingRxconsoleRoslaunch and then I jumped right into stage/Tutorials/SimulatingOneRobot.

I'm trying to build the teleop_base package in the tutorial but I'm getting one dependency error which I'm not sure if I can ignore. After executing rosmake teleop_base:

panda@Amaranth:~/stagetutorial/teleop_base$ rosmake teleop_base
[ rosmake ] rosmake starting...                                                                                    
[ rosmake ] Packages requested are: ['teleop_base']                                                                
[ rosmake ] Logging to directory /home/panda/.ros/rosmake/rosmake_output-20121122-235959                           
[ rosmake ] Expanded args ['teleop_base'] to:
[rosmake-0] Starting >>> roslang [ make ]                                                                          
[rosmake-1] Starting >>> std_msgs [ make ]                                                                         
[rosmake-2] Starting >>> geometry_msgs [ make ]                                                                    
[rosmake-0] Finished <<< roslang  No Makefile in package roslang                                                   
[rosmake-3] Starting >>> bullet [ make ]                                                                           
[rosmake-1] Finished <<< std_msgs  No Makefile in package std_msgs                                                 
[rosmake-0] Starting >>> roscpp [ make ]                                                                           
[rosmake-2] Finished <<< geometry_msgs  No Makefile in package geometry_msgs                                       
[rosmake-2] Starting >>> rospy [ make ]                                                                            
[rosmake-1] Starting >>> nav_msgs [ make ]                                                                         
[rosmake-3] Finished <<< bullet ROS_NOBUILD in package bullet                                                      
[rosmake-3] Starting >>> sensor_msgs [ make ]                                                                      
[rosmake-0] Finished <<< roscpp  No Makefile in package roscpp                                                     
[rosmake-2] Finished <<< rospy  No Makefile in package rospy                                                       
[rosmake-1] Finished <<< nav_msgs  No Makefile in package nav_msgs                                                 
[rosmake-3] Finished <<< sensor_msgs  No Makefile in package sensor_msgs                                           
[rosmake-2] Starting >>> rosconsole [ make ]                                                                       
[rosmake-0] Starting >>> angles [ make ]                                                                           
[rosmake-3] Starting >>> rostest [ make ]                                                                          
[rosmake-1] Starting >>> roswtf [ make ]                                                                           
[rosmake-2] Finished <<< rosconsole  No Makefile in package rosconsole                                             
[rosmake-3] Finished <<< rostest  No Makefile in package rostest                                                   
[rosmake-3] Starting >>> message_filters [ make ]                                                                  
[rosmake-0] Finished <<< angles ROS_NOBUILD in package angles                                                      
[rosmake-2] Starting >>> teleop_base [ make ]                                                                      
[rosmake-1] Finished <<< roswtf  No Makefile in package roswtf                                                     
[rosmake-3] Finished <<< message_filters  No Makefile in package message_filters                                   
[rosmake-3] Starting >>> tf [ make ]                                                                               
[rosmake-3] Finished <<< tf ROS_NOBUILD in package tf                                                              
[ rosmake ] All 21 lineseleop_base: 0.2 sec ]                                           [ 1 Active 14/15 Complete ]
  mkdir -p bin
  cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake  ..
  [rosbuild] Building package teleop_base
  Failed to invoke /opt/ros/fuerte/bin/rospack deps-manifests teleop_base
  [rospack] Error: package/stack teleop_base depends on non-existent package joy

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

    Failed to invoke rospack to get compile flags for package 'teleop_base'.
    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:3 (rosbuild_init)

  -- Configuring incomplete, errors occurred!
[ rosmake ] Output from build of package teleop_base written to:
[ rosmake ]    /home/panda/.ros/rosmake/rosmake_output-20121122-235959/teleop_base/build_output.log
[rosmake-2] Finished <<< teleop_base [FAIL] [ 0.21 seconds ]                                                       
[ rosmake ] Halting due to failure in package teleop_base. 
[ rosmake ] Waiting for other threads to complete.     
[ rosmake ] Results:                                                                                               
[ rosmake ] Built 15 packages with 1 failures.                                                                     
[ rosmake ] Summary output to directory                                                                            
[ rosmake ] /home/panda/.ros/rosmake/rosmake_output-20121122-235959

Okay so the package 'joy' which is missing is to interface a joystick, which I don't think I'd be using. It said "Built 15 package with 1 failures."

Can I just proceed and ignore the failure since I don't need the the joy package anyways?

How do I check if the 15 packages are built?

If I just go into the manifest and remove the 'joy' dependency line, will ... (more)

2014-01-11 20:54:16 -0600 received badge  Notable Question (source)
2013-09-23 13:27:16 -0600 marked best answer error: ‘SurfFeatureDetector’ is not a member of ‘cv’

I'm trying to work out how to use OpenCV on ROS.

I've gone through the cv_bridge tutorial and understand how to convert to the sensor_msgs::Image to the format used by OpenCV, in order to use the image with OpenCV libraries, and convert it back to sensor_msgs::Image. And by the cv::circle and cv::NamedWindow examples in the cv_bridge tutorial, I assumed that I can use the algorithms in the OpenCV documentation by referring to the cv namespace.

So I decided to write a simple program to try out the feature detector algorithms in OpenCV, referring to And got to this point:

#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>

int main(int argc, char** argv)
  ros::init(argc, argv, "panda");

  cv::Mat image;

  image = cv::imread(argv[1], 0);

  int minHessian = 400;
  cv::SurfFeatureDetector detector( minHessian );

  cv::namedWindow( "Display window");

  cv::imshow( "Display window", image );

  return 0;


But I got an error:

error: ‘SurfFeatureDetector’ is not a member of ‘cv’

It works with the cv::SurfFeatureDetector line commented out. I'm stuck at that point. I don't think I'm missing any headers. Any help?

Please and thank you.

2013-09-04 22:41:32 -0600 marked best answer Merging Multiple PointCloud2

Is there a way to merge two different PointCloud2 messages? Assuming they are defined in the same frame of course.

2013-07-26 01:49:15 -0600 marked best answer Trying to install dependencies.

Trying to install dependencies for (rgbdslam) following the instruction on the page:

rosdep install rgbdslam_freiburg

But I keep getting the error saying:

ERROR: Rosdep cannot find all required resources to answer your query
Missing resource XXXXXXX

Basically, it is missing the resources that it is suppose to install, like octomap.

I've tried grabbing the missing resources manually, using rosws, but got stuck at octomap, where the error pops up even though octomap is already in the package path. So I decided to double back and try to investigate what I did or assumed wrong in the first place.

Any help?