0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ROSのcv_cameraノードから画像メッセージが1つしか配信されない問題を解決

Last updated at Posted at 2021-11-15

OS:Ubuntu18.04
ROSのバージョン:melodic
USBカメラ: UCAM-C0220FEBK

問題

cv_cameraというパッケージを下記のリンクからインストールし、カメラ画像を扱おうとしたものの、画像が1枚しか配信されていませんでした。

Screenshot from 2021-11-15 13-58-22.png

この写真にあるとおり、:white_check_mark:Status: OK とあるものの、そのすぐ下の:white_check_mark: Imageの欄では"1 images received"と書いてあります。つまり、/cv_camera/image_rawトピックが1つしか配信されていません。

解決方法

以下のコマンドで解決しました。

rosparam set use_sim_time false

原因

問題の原因はROSの時間形式が適切ではなかったことにありました。rostopic echo /cv_camera/image_raw というコマンドを打って確かめようとしたところ、下記のようなメッセージが帰ってきたことから判明しました。

WARNING: no messages received and simulated time is active.
Is /clock being published?

自分自身がLeGO-LOAMで地図を作成するときに、rosbagではなく自分が所有するセンサから取り込んだデータを利用するときにuse_sim_timeの設定をfalseにしたりtrueにしたりしていたのでそのことを完全に忘れてしまっていました。

たまに上記のコマンドでうまく行かなかったりしたのですが、一度 true にしてから再度falseにしてあげると問題が解決されました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?