masuko-shingo / jetson-nano

自分用jetsonnanoの記録
MIT License
0 stars 0 forks source link

roscoreしてもuvc_camera_nodeが通らない #11

Closed masuko-shingo closed 2 years ago

masuko-shingo commented 2 years ago

roscoreしてもuvc_camera_nodeが通らない

$ rosrun uvc_camera uvc_camera_node 
[ERROR] [1638900795.266183164]: [registerPublisher] Failed to contact master at [192.168.0.42:11311].  Retrying...
^Copening /dev/video0
pixfmt 0 = 'YUYV' desc = 'YUYV 4:2:2'
  discrete: 640x480:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 160x120:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 176x144:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 320x176:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 320x240:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 352x288:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 432x240:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 544x288:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 640x360:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 752x416:   1/25 1/20 1/15 1/10 1/5 
  discrete: 800x448:   1/20 1/15 1/10 1/5 
  discrete: 800x600:   1/20 1/15 1/10 1/5 
  discrete: 864x480:   1/20 1/15 1/10 1/5 
  discrete: 960x544:   1/15 1/10 1/5 
  discrete: 960x720:   1/10 1/5 
  discrete: 1024x576:   1/10 1/5 
  discrete: 1184x656:   1/10 1/5 
  discrete: 1280x720:   2/15 1/5 
  discrete: 1280x960:   2/15 1/5 
pixfmt 1 = 'MJPG' desc = 'Motion-JPEG'
  discrete: 640x480:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 160x120:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 176x144:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 320x176:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 320x240:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 352x288:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 432x240:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 544x288:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 640x360:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 752x416:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 800x448:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 800x600:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 864x480:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 960x544:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 960x720:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 1024x576:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 1184x656:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 1280x720:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 1280x960:   1/30 1/25 1/20 1/15 1/10 1/5 
  int (Brightness, 0, id = 980900): 0 to 255 (1)
  int (Contrast, 0, id = 980901): 0 to 255 (1)
  int (Saturation, 0, id = 980902): 0 to 255 (1)
  bool (White Balance Temperature, Auto, 0, id = 98090c): 0 to 1 (1)
  int (Gain, 0, id = 980913): 0 to 255 (1)
  menu (Power Line Frequency, 0, id = 980918): 0 to 2 (1)
    0: Disabled
    1: 50 Hz
    2: 60 Hz
  int (White Balance Temperature, 16, id = 98091a): 0 to 10000 (10)
  int (Sharpness, 0, id = 98091b): 0 to 255 (1)
  int (Backlight Compensation, 0, id = 98091c): 0 to 1 (1)
  menu (Exposure, Auto, 0, id = 9a0901): 0 to 3 (1)
  int (Exposure (Absolute), 16, id = 9a0902): 1 to 10000 (1)
  bool (Exposure, Auto Priority, 0, id = 9a0903): 0 to 1 (1)

uvc_cameraの確認

jetsonnano@jetsonnano-desktop:/opt/ros/melodic/share/uvc_camera$ ls
cmake  launch  nodelet_uvc_camera.xml  package.xml

uvc_cameraがないわけではなさそう
pc側でroscoreして,

$ roscore

roslaunch uvc_camera camera_node.launchを実行

jetsonnano@jetsonnano-desktop:~$ roslaunch uvc_camera camera_node.launch 
... logging to /home/jetsonnano/.ros/log/bc3f2e1c-578d-11ec-a61a-7c7635a4ab69/roslaunch-jetsonnano-desktop-14197.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.

started roslaunch server http://192.168.0.59:39225/

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.11
 * /uvc_camera/auto_focus: False
 * /uvc_camera/camera_info_url: file:///opt/ros/m...
 * /uvc_camera/device: /dev/video0
 * /uvc_camera/focus_absolute: 0
 * /uvc_camera/fps: 30
 * /uvc_camera/frame: wide_stereo
 * /uvc_camera/height: 240
 * /uvc_camera/width: 320

NODES
  /
    uvc_camera (uvc_camera/uvc_camera_node)

ROS_MASTER_URI=http://192.168.0.42:11311

process[uvc_camera-1]: started with pid [14206]
[ INFO] [1638902687.536160081]: camera calibration URL: file:///opt/ros/melodic/share/uvc_camera/example.yaml
[ INFO] [1638902687.543610623]: Unable to open camera calibration file [/opt/ros/melodic/share/uvc_camera/example.yaml]
[ WARN] [1638902687.543682969]: Camera calibration file /opt/ros/melodic/share/uvc_camera/example.yaml not found.
opening /dev/video0
pixfmt 0 = 'YUYV' desc = 'YUYV 4:2:2'
  discrete: 640x480:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 160x120:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 176x144:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 320x176:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 320x240:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 352x288:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 432x240:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 544x288:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 640x360:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 752x416:   1/25 1/20 1/15 1/10 1/5 
  discrete: 800x448:   1/20 1/15 1/10 1/5 
  discrete: 800x600:   1/20 1/15 1/10 1/5 
  discrete: 864x480:   1/20 1/15 1/10 1/5 
  discrete: 960x544:   1/15 1/10 1/5 
  discrete: 960x720:   1/10 1/5 
  discrete: 1024x576:   1/10 1/5 
  discrete: 1184x656:   1/10 1/5 
  discrete: 1280x720:   2/15 1/5 
  discrete: 1280x960:   2/15 1/5 
pixfmt 1 = 'MJPG' desc = 'Motion-JPEG'
  discrete: 640x480:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 160x120:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 176x144:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 320x176:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 320x240:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 352x288:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 432x240:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 544x288:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 640x360:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 752x416:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 800x448:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 800x600:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 864x480:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 960x544:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 960x720:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 1024x576:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 1184x656:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 1280x720:   1/30 1/25 1/20 1/15 1/10 1/5 
  discrete: 1280x960:   1/30 1/25 1/20 1/15 1/10 1/5 
  int (Brightness, 0, id = 980900): 0 to 255 (1)
  int (Contrast, 0, id = 980901): 0 to 255 (1)
  int (Saturation, 0, id = 980902): 0 to 255 (1)
  bool (White Balance Temperature, Auto, 0, id = 98090c): 0 to 1 (1)
  int (Gain, 0, id = 980913): 0 to 255 (1)
  menu (Power Line Frequency, 0, id = 980918): 0 to 2 (1)
    0: Disabled
    1: 50 Hz
    2: 60 Hz
  int (White Balance Temperature, 16, id = 98091a): 0 to 10000 (10)
  int (Sharpness, 0, id = 98091b): 0 to 255 (1)
  int (Backlight Compensation, 0, id = 98091c): 0 to 1 (1)
  menu (Exposure, Auto, 0, id = 9a0901): 0 to 3 (1)
  int (Exposure (Absolute), 16, id = 9a0902): 1 to 10000 (1)
  bool (Exposure, Auto Priority, 0, id = 9a0903): 0 to 1 (1)
Setting auto_focus is not supported
Setting focus_absolute is not supported
select timeout in grab

jetsonnanoにモニターを繋げて

rosrun image_view image_view image:=image/image_raw

でいけたっぽい?

masuko-shingo commented 2 years ago
$ vim ~/.bashrc

bashrcに以下を追加

# source ~/workspace/devel/setup.bash

ros.yamlを編集

$ vim  ~/workspa/src/darknet_ros/darknet_ros/config/ros.yaml

以下に変更

subscribers:

  camera_reading:
    topic: /image_raw
    queue_size: 1

PCでroscore
その後
nanoで

$ roslaunch uvc_camera camera_node.launch