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

rookie's profile - activity

2015-11-20 06:09:50 -0500 received badge  Student (source)
2015-05-30 03:43:05 -0500 received badge  Famous Question (source)
2015-05-24 07:34:58 -0500 received badge  Famous Question (source)
2015-05-12 06:34:03 -0500 received badge  Notable Question (source)
2015-03-08 16:15:22 -0500 received badge  Popular Question (source)
2015-03-08 03:34:18 -0500 commented question Order of nodes in roslaunch for accessing camera images

I have added my piece of code to the question. I hope that will help identify the problem. rosnode list shows three nodes acc to launch file: usbcam, image and rosout

2015-03-08 01:02:10 -0500 asked a question Order of nodes in roslaunch for accessing camera images

I am trying to run two nodes, one being the usb_cam node to start the camera and the second node to use the images for image processing. As there is no particular order in which the nodes are launched, the image processing node doesn't start displaying the highgui window as I'd written, which I think is probably because the usb_cam node hasn't started ?

It works fine when I run the node independently using rosrun, starting usb_cam node first and then the image processing thread.

How can I solve this problem?

EDIT: Code - IMAGE PROCESSING CODE

     #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/highgui/highgui.hpp>
     static const std::string OPENCV_WINDOW = "Image window";

     class ImageConverter
     {
         ros::NodeHandle nh_;
         image_transport::ImageTransport it_;
         image_transport::Subscriber image_sub_;
         image_transport::Publisher image_pub_;

     public:
         ImageConverter()
            : it_(nh_)
        {
         // Subscrive to input video feed and publish output video feed
          image_sub_ = it_.subscribe("/usb_cam/image_raw", 1,
          &ImageConverter::imageCb, this);
           image_pub_ = it_.advertise("/image_converter/output_video", 1);

          cv::namedWindow(OPENCV_WINDOW);
        }

        ~ImageConverter()
        {
            cv::destroyWindow(OPENCV_WINDOW);
         }

          void imageCb(const sensor_msgs::ImageConstPtr& msg)
         {

         cv::Mat img, img_resize;

           try
           {
              img = cv_bridge::toCvCopy(msg, "mono8")->image;
            }
            catch (cv_bridge::Exception& e)
            {
              ROS_ERROR("cv_bridge exception: %s", e.what());
              return;
            }

            if (img.rows > 60 && img.cols > 60)
                   cv::circle(img, cv::Point(50, 50), 10, CV_RGB(255,0,0));

              cv::resize(img, img_resize, cv::Size2i(img.cols/2, img.rows/2));


              cv::imshow(OPENCV_WINDOW, img_resize);
              cv::waitKey(3);

            }
        };

        int main(int argc, char** argv)                
        {
          ros::init(argc, argv, "image_converter");
          ImageConverter ic;
          ros::spin();
          return 0;
        }

Launch File:

      <launch>

      <node pkg="usb_cam" type="usb_cam_node" name="usbcam" required="true" clear_params="true" >
           <param name="video_device" value="/dev/video0" />
       </node>

      <node pkg="opencv_ros" type="image" name="image" required="true" clear_params="true" output="screen"/>

      </launch>

It gives me an error

       Webcam: expected picture but didn't get it...

       No JPEG data  found in image

       Error while decoding frame.

but this happens just once(first time I run it after booting). After I kill the process and run it again, it doesn't show this error, but the highui window doesn't open either.

2015-01-27 09:01:53 -0500 received badge  Famous Question (source)
2014-12-15 05:30:36 -0500 received badge  Notable Question (source)
2014-11-12 05:25:00 -0500 received badge  Famous Question (source)
2014-10-13 13:30:38 -0500 commented question cannot view image topic/calibration window with integrated webcam

I could find a solution to this problem..webcams and virtualbox don't go hand in hand i guess :P I just moved to a standalone Ubuntu machine and everything fell in place.

2014-10-13 08:26:58 -0500 received badge  Notable Question (source)
2014-10-02 00:48:32 -0500 commented answer CMake Error "tf" while building ar_track_alvar

Thanks.. i installed this package and catkin_make worked ! But I faced a weird problem that it gets stuck at around 22% and my Odroid hangs..probably the CPU usage is shooting up, something that has never happened before..I tried this twice but with the same result :/

2014-10-01 20:54:28 -0500 received badge  Popular Question (source)
2014-10-01 02:28:15 -0500 received badge  Notable Question (source)
2014-09-30 07:08:00 -0500 asked a question CMake Error "tf" while building ar_track_alvar

I am trying to build the AR tag detector package ar_track_alavar on Odroid U3 running ROS hydro on Lubuntu 13.04 Running catkin_make after cloning the package gives me the following error :

CMake Error at /opt/ros/hydro/share/catkin/cmake/catkinConfig.cmake:75 (find_package): Could not find a package configuration file provided by "tf" with any of the following names:

tfConfig.cmake
tf-config.cmake

Add the installation prefix of "tf" to CMAKE_PREFIX_PATH or set "tf_DIR" to a directory containing one of the above files. If "tf" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): ar_track_alvar/CMakeLists.txt:10 (find_package)

-- Configuring incomplete, errors occurred! Invoking "cmake" failed

Can someone please explain how to resolve this error?

2014-09-30 03:47:39 -0500 received badge  Supporter (source)
2014-09-30 03:47:36 -0500 received badge  Scholar (source)
2014-09-15 10:07:52 -0500 received badge  Popular Question (source)
2014-09-12 12:58:39 -0500 commented answer How to tackle 'symbol lookup error' and 'ros::InvalidNameException' on Odroid

Thanks, will try this out !

2014-09-12 09:06:00 -0500 commented answer How to tackle 'symbol lookup error' and 'ros::InvalidNameException' on Odroid

Thanks! the first step didn't work..i tried apt-get update but i got an error: Failed to fetch http://winswitch.org/dists/precise/Re... Unable to find expected entry 'main/binary-armhf/Packages' in Release file) Wont lubuntu upgrade to a higher version and screw up hydro with apt-get upgrade?

2014-09-12 03:27:10 -0500 asked a question How to tackle 'symbol lookup error' and 'ros::InvalidNameException' on Odroid

I am trying to run camera calibration on my Odroid U3 running Lubuntu 13.04. I ran the following command :

rosrun uvc_camera uvc_camera_node width:=640 height:=480 frame:=camera device:=/dev/video0

after which a i got an error :

terminate called after throwing an instance of 'ros::InvalidNameException' what(): Character [4] is not valid as the first character in Graph Resource Name [480]. Valid characters are a-z, A-Z, / and in some cases ~. Aborted (core dumped)

running the same command without specifying height and width, i get the following error:

/opt/ros/hydro/lib/uvc_camera/uvc_camera_node: symbol lookup error: /opt/ros/hydro/lib/libimage_transport.so: undefined symbol: _ZN3ros7package10getPluginsERKSsS2_RSt6vectorISsSaISsEEb

How do I overcome this problem??

I have followed earlier tutorials successfully and have sourced required files.

2014-09-05 07:18:00 -0500 received badge  Popular Question (source)
2014-08-23 10:05:02 -0500 commented question cannot view image topic/calibration window with integrated webcam

yes i tried rosrun image_view image_view image:/image_raw I got a window, filled with green color along with a noisy band on top

2014-08-23 06:02:25 -0500 received badge  Editor (source)
2014-08-23 05:57:57 -0500 edited question cannot view image topic/calibration window with integrated webcam

Hello All,

I'm new to the ROS environment, currently running ROS hydro on Ubuntu 12.04 in virtualbox. I am trying to run camera calibration as per instructions on the ROS tutorials, using the integrated facetime HD camera. It works perfectly fine using cheese/openCV. But when i run the camera calibration, all i get is a gray image I tried to subscribe to the image topic and view the published image in a seperate window. I get a green screen

I run the following commands:

-roscore

-rosrun uvc_camera uvc_camera_node frame:=camera device:=/dev/video0

opening /dev/video0

pixfmt 0 = 'MJPG' desc = 'MJPEG'

discrete: 1280x720: 1/1

discrete: 640x480: 1/1

discrete: 320x240: 1/1

int (Brightness, 0, id = 980900): 0 to 100 (1)

-rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 image:=/image_raw :=/

output of rostopic list is:

  1. /camera_info

  2. /image_raw

  3. /rosout

  4. /rosout_agg

Can you please let me know where i am going wrong with this?