質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

Q&A

解決済

1回答

4412閲覧

ROS ImportErrorに関する質問

BASEBALL-Y

総合スコア67

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

0グッド

0クリップ

投稿2021/02/21 16:52

編集2021/02/22 11:47

質問内容

現在、ubuntuでROSを使っているのですが、以下のエラーが表示されます。

解決策を知っている方がいましたら、教えて頂けると幸いです。

端末内のコマンド

$ cd <your_catkin_ws>/src $ git clone https://github.com/atotto/ultrasonic_scanner.git $ cd .. $ catkin_make $ roslaunch ultrasonic_scanner ultrasonic_scanner_demo.launch

エラー内容

ImportError: cannot import name 'Log' from 'rosgraph_msgs.msg' (unknown location)

修正(2021/2/22 追記)

Traceback (most recent call last): File "/home/user/ros_catkin_ws/devel/bin/roslaunch", line 15, in <module> exec(compile(fh.read(), python_script, 'exec'), context) File "/home/user/ros_catkin_ws/src/ros_comm/roslaunch/scripts/roslaunch", line 34, in <module> import roslaunch File "/home/user/ros_catkin_ws/devel/lib/python3/dist-packages/roslaunch/__init__.py", line 34, in <module> exec(__fh.read()) File "<string>", line 62, in <module> File "/home/user/ros_catkin_ws/src/ros_comm/roslaunch/src/roslaunch/scriptapi.py", line 42, in <module> import roslaunch.parent File "/home/user/ros_catkin_ws/src/ros_comm/roslaunch/src/roslaunch/parent.py", line 54, in <module> import roslaunch.server File "/home/user/ros_catkin_ws/src/ros_comm/roslaunch/src/roslaunch/server.py", line 83, in <module> from rosgraph_msgs.msg import Log ImportError: cannot import name 'Log' from 'rosgraph_msgs.msg' (unknown location)

環境

ubuntu20.04
ros noetic

コマンドを打つ際に使用したサイト

使用したサイト

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

BASEBALL-Y

2021/02/22 11:48

すみません。修正させていただきました。 もしよければ、確認のほどよろしくお願い致します。
tetsunosuke

2021/02/22 13:31

この件については全く詳しくなく再現しようと思ったのですが http://wiki.ros.org/kinetic/Installation/Ubuntu ROS Kinetic ONLY supports Wily (Ubuntu 15.10), Xenial (Ubuntu 16.04) and Jessie (Debian 8) for debian packages. この時点でUbuntuが新しすぎるとだめなのでは?と思いました。
BASEBALL-Y

2021/03/12 07:07

tetsunosukeさん。回答ありがとうございます。 なるほどです!
guest

回答1

0

ベストアンサー

似たようなエラーはたくさんありましたが、ここのエラーは全く末尾以外同じように見えます。"I get this error"のくだりです。

antonellaさんによれば、

For the first part of the question, you are missing the compressed-image-transport package. Since I'm assuming you are running Raspbian and thus building ROS from source, you will need to follow these instructions for adding released packages and building the compressed-image-transport from source (as well as for all other ROS package dependencies for raspicam_node).

For the second error, it is likely the same issue, that you don't have the rosgraph_msgs package installed. The instructions on the linked page should help with that as well.

だそうで、つまるところ(正規の)マニュアルを見てインストールしてください、だそうです。

他のfrom rosgraph_msgs.msg import Logが出る原因となった事例も見ましたが、その場合は古いROSと新しいROSが一緒になって悪さをしているのではないか、とのことでした。
もし可能であれば、以下の2つがよいのではないでしょうか。

  1. 全てのROSモジュールを洗いざらい削除する
  2. 正規のマニュアルに従ってROSをインストールしなおす

投稿2021/02/23 00:38

編集2021/02/23 00:46
退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問