Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
360 views
in Technique[技术] by (71.8m points)

python - ROS Camera Calibration

I have a VM with ROS Noetic installed and I want to run a camera calibration on my USB Webcam. I followed the following guide and for the launcher, I put the following code:

<launch>
  <!-- This launchfile should bring up a node that broadcasts a ros image
       transport on /webcam/image_raw -->

  <arg name="DEVICEl" default="/dev/video0"/>
  <!-- The GStreamer framerate needs to be an integral fraction -->
  <arg name="FPS" default="30/1"/>
  <arg name="PUBLISH_FRAME" default="false"/>

  <node ns="left" name="gscam_driver_v4l" pkg="gscam" type="gscam" output="screen">
    <param name="camera_name" value="default"/>
    <param name="camera_info_url" value="package://gscam/examples/uncalibrated_parameters.ini"/>
    <param name="gscam_config" value="v4l2src device=$(arg DEVICEl) ! video/x-raw-rgb,framerate=$(arg FPS) ! ffmpegcolorspace"/>
    <param name="frame_id" value="/v4l_frame_l"/>
    <param name="sync_sink" value="true"/>
  </node>

  <node if="$(arg PUBLISH_FRAME)" name="v4l_transform" pkg="tf" type="static_transform_publisher" args="1 2 3 0 -3.141 0 /world /v4l_frame 10"/>
</launch>

I try to launch it and get the following response:

... logging to /home/dragonros/.ros/log/e62adeac-5d96-11eb-b879-09066182755f/roslaunch-ubuntu-42560.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

invalid ROS_HOSTNAME (an empty string)
invalid ROS_HOSTNAME (an empty string)
started roslaunch server http://ubuntu:35479/

SUMMARY
========

PARAMETERS
 * /left/gscam_driver_v4l/camera_info_url: package://gscam/e...
 * /left/gscam_driver_v4l/camera_name: default
 * /left/gscam_driver_v4l/frame_id: /v4l_frame_l
 * /left/gscam_driver_v4l/gscam_config: v4l2src device=/d...
 * /left/gscam_driver_v4l/sync_sink: True
 * /rosdistro: noetic
 * /rosversion: 1.15.9

NODES
  /left/
    gscam_driver_v4l (gscam/gscam)

ROS_MASTER_URI=http://localhost:11311

process[left/gscam_driver_v4l-1]: started with pid [42574]
[ WARN] [1611445425.340701580]: invalid ROS_HOSTNAME (an empty string)
[ INFO] [1611445425.361034554]: Using gstreamer config from rosparam: "v4l2src device=/dev/video0 ! video/x-raw-rgb,framerate=30/1 ! ffmpegcolorspace"
[ INFO] [1611445425.366515919]: camera calibration URL: package://gscam/examples/uncalibrated_parameters.ini
[ INFO] [1611445425.366725052]: Loaded camera calibration from package://gscam/examples/uncalibrated_parameters.ini

(gscam:42574): GStreamer-WARNING **: 15:43:45.455: 0.10-style raw video caps are being created. Should be video/x-raw,format=(string).. now.
[ INFO] [1611445425.455679084]: Time offset: 1611418553.717
[ INFO] [1611445425.555216304]: Publishing stream...
[ INFO] [1611445425.555412447]: Started stream.
[ERROR] [1611445425.555446013]: Could not get gstreamer sample.
[ INFO] [1611445425.555455586]: Stopping gstreamer pipeline...
[ INFO] [1611445425.557306732]: GStreamer stream stopped!
[ INFO] [1611445425.557374812]: Cleaning up stream and exiting...
[left/gscam_driver_v4l-1] process has finished cleanly
log file: /home/dragonros/.ros/log/e62adeac-5d96-11eb-b879-09066182755f/left-gscam_driver_v4l-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done

It says that it could not get gstreamer sample. Also, for some reason, when I plug my camera in to the computer, it creates both /dev/video0 and /dev/video1. This also what I get if I run rosrun gscam gscam. What should I do?

question from:https://stackoverflow.com/questions/65865736/ros-camera-calibration

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...