git clone USB_CAM roswiki
git clone https://github.com/ros-drivers/usb_cam.git
and install usb-cam
sudo apt install ros-melodic-usb-cam
check which port connected to camera
ls -ltr /dev/video*
video0 -> laptop cam
video1 -> USB cam
Based on this, fix code.
Example: (look at the line 92)
run command (node)
rosrun usb_cam usb_cam
run command (launch)
roslaunch usb_cam usb_cam-test.launch
But I meet error...;-(
[rosrun] Couldn't find executable named usb_cam below /home/yulimhwang/catkin_ws/src/usb_cam
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
solution:
You should make executable file.
chmod +x usb_cam_node.cpp
OMG.. I meet another error. ;-<
[ERROR] [1661190157.805564400]: VIDIOC_S_FMT error 22, Invalid argument
[ INFO] [1661190157.830886597]: Using transport "raw"
[usb_cam-2] process has died [pid 14232, exit code 1, cmd /home/yulimhwang/catkin_ws/devel/lib/usb_cam/usb_cam_node __name:=usb_cam __log:=/home/yulimhwang/.ros/log/cf913f8a-2241-11ed-87d1-0c7a15d6d9c7/usb_cam-2.log].
log file: /home/yulimhwang/.ros/log/cf913f8a-2241-11ed-87d1-0c7a15d6d9c7/usb_cam-2*.log
I....don't....know.... why only webcam run...
I know~~
thanks charm.
we must to change /dev/video2.
not video1.
'ROS' 카테고리의 다른 글
[ros melodic] create new worksape (0) | 2022.12.07 |
---|---|
[ROS] 3D Lidar_Velodyne VLP16_points (0) | 2022.08.23 |
[ROS] RLException: [launch name] is neither a launch file in package [package name] nor is [package name] a launch file name error (0) | 2022.08.23 |
[ROS melodic] 3D Lidar (Velodyne) 2D Camera Calibration (0) | 2022.08.23 |
[ROS] spin, sleep, Rate (0) | 2022.07.20 |