Robotics StackExchange | Archived questions

webcam not appearing in "rostopic list"

Hi everyone,

I am new to ROS and have been trying to run a camera calibration using PTAM, however I am having some issues getting the camera recognised and to appear with rostopic list.

I have followed the tutorial below, http://pharos.ece.utexas.edu/wiki/index.php/How_to_Use_a_Webcam_in_ROS_with_the_usb_cam_Package however I get the following error when running rosmake usb_cam:

[ 50%] Building CXX object src/libusb_cam/CMakeFiles/usb_cam.dir/usb_cam.cpp.o
/home/mvs/rosbuild_ws/package_dir/usb_cam/bosch_drivers/usb_cam/src/libusb_cam/usb_cam.cpp: In function ‘int init_mjpeg_decoder(int, int)’:
/home/mvs/rosbuild_ws/package_dir/usb_cam/bosch_drivers/usb_cam/src/libusb_cam/usb_cam.cpp:282:16: error: ‘avcodec_init’ was not declared in this scope
   avcodec_init();
                ^
/home/mvs/rosbuild_ws/package_dir/usb_cam/bosch_drivers/usb_cam/src/libusb_cam/usb_cam.cpp:292:43: error: ‘avcodec_alloc_context’ was not declared in this scope
   avcodec_context = avcodec_alloc_context();
                                           ^
/home/mvs/rosbuild_ws/package_dir/usb_cam/bosch_drivers/usb_cam/src/libusb_cam/usb_cam.cpp:311:44: error: ‘avcodec_open’ was not declared in this scope
   if (avcodec_open(avcodec_context, avcodec) < 0)
                                            ^
/home/mvs/rosbuild_ws/package_dir/usb_cam/bosch_drivers/usb_cam/src/libusb_cam/usb_cam.cpp: In function ‘void usb_cam_camera_shutdown()’:
/home/mvs/rosbuild_ws/package_dir/usb_cam/bosch_drivers/usb_cam/src/libusb_cam/usb_cam.cpp:872:28: error: ‘av_free’ was not declared in this scope
     av_free(avcodec_context);
                            ^
/home/mvs/rosbuild_ws/package_dir/usb_cam/bosch_drivers/usb_cam/src/libusb_cam/usb_cam.cpp:876:27: error: ‘av_free’ was not declared in this scope
     av_free(avframe_camera);
                           ^
/home/mvs/rosbuild_ws/package_dir/usb_cam/bosch_drivers/usb_cam/src/libusb_cam/usb_cam.cpp:879:24: error: ‘av_free’ was not declared in this scope
     av_free(avframe_rgb);

The missing packages are not around anymore, so is there an alternative to use?

I feel there should be a simpler way to get the a usb camera working, am I missing somthing?

Thank you, any help will be appreciated.

Asked by ryanj on 2015-06-09 20:49:02 UTC

Comments

Is there special reason why you use rosbuild and build the package from source?

Asked by BennyRe on 2015-06-10 03:56:41 UTC

Using sudo apt-get install ros-electric-bosch-drivers gives E: unable to locate package ros-electric-bosch-drivers. Unless there is somthing I am doing wrong there is no extra reason I am building from source.

Asked by ryanj on 2015-06-10 06:00:29 UTC

Are you using ROS electric?

Asked by BennyRe on 2015-06-10 06:47:12 UTC

No, jade. Just tried ros-jade-bosch-drivers and did not work.

Asked by ryanj on 2015-06-10 07:04:47 UTC

Yes this doesn't work. The package ros-electric-bosch-drivers is for the ROS electric distro.

Asked by BennyRe on 2015-06-10 07:22:28 UTC

Answers

Simply use sudo apt-get install ros-jade-usb-cam

Asked by BennyRe on 2015-06-10 07:23:48 UTC

Comments

This has allowed me to run the tutorial, thank you! However the camera does not come up listed when running rostopic list; am I missing something? I am trying to complete this tutorial.

Asked by ryanj on 2015-06-10 09:01:51 UTC

This tutorial is missing the rosrun/roslaunch part where you start the camera node. See the ROS wiki page of your package on how to launch the node.

Asked by BennyRe on 2015-06-10 09:26:15 UTC

It got rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 image:=/camera/image_raw camera:=/camera is this what you mean by starting camera node. I am having difficulty finding the ROS wiki page related to this.

Asked by ryanj on 2015-06-11 07:30:21 UTC

Where you able to get it working?

Asked by krusion on 2016-11-01 19:16:25 UTC