Skip to content

JHermosillaD/webcam_launcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

📌 webcam_launcher

Steps to use your computer's built-in camera in ROS.

  1. Find the idVendor, idProduct and port path of your camera using lsusb
user@localhost:~$ lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 5986:212b Acer, Inc Integrated Camera

where

idVendor = 5986
idProduct = 212b
port path = /dev/bus/usb/001/003
  1. Create a rule in /etc/udev/rules.d. Starts with a number and specifies the idVendor and idProduct using the following template.
user@localhost:~$ sudo nano /etc/udev/rules.d/70-webcam.rules
SUBSYSTEMS=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="5986", ATTRS{idProduct}=="212b", MODE:="0666"
  1. Reload rules
user@localhost:~$ sudo udevadm control --reload
  1. Edits file /launch/elp.launch to include the idVendor and idProduct. Modify the other parameters according to the dimensions of your camera or add new ones.
<launch>
  <node pkg="nodelet" type="nodelet" name="nodelet_manager" args="manager" output="screen"/>

  <node pkg="nodelet" type="nodelet" name="libuvc_camera" args="load libuvc_camera/driver /nodelet_manager" output="screen">
    <param name="frame_id" value="elp_camera" />
    
    <!-- Parameters used to find the camera -->
    <param name="vendor" value="0x5986"/>
    <param name="product" value="0x212b"/>

    <!-- Image size and type -->
    <param name="width" value="1280"/>
    <param name="height" value="720"/>
    <param name="video_mode" value="mjpeg"/>
    <param name="frame_rate" value="30"/>

  </node>
</launch>
  1. Modifies the camera port permissions
user@localhost:~$ sudo chmod o+w /dev/bus/usb/001/003 
  1. Enjoy!
user@localhost:~/workspace$ catkin_make 
user@localhost:~$ roslaunch webcam_launcher elp.launcher

References

About

ROS package for integrated webcams

Topics

Resources

Stars

Watchers

Forks

Languages