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

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

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

Raspberry Piは、ラズベリーパイ財団が開発した、名刺サイズのLinuxコンピュータです。 学校で基本的なコンピュータ科学の教育を促進することを意図しています。

Q&A

解決済

1回答

3698閲覧

Raspberry Pi3にROSをインストールしたい

koik

総合スコア12

Raspberry Pi

Raspberry Piは、ラズベリーパイ財団が開発した、名刺サイズのLinuxコンピュータです。 学校で基本的なコンピュータ科学の教育を促進することを意図しています。

0グッド

0クリップ

投稿2019/01/14 11:28

編集2019/01/14 11:29

Raspberry Pi 3 に ROS をインストルーしようとしています
https://asukiaaa.blogspot.com/2018/06/raspberry-pi-raspbianstretchrosmelodic.html?showComment=1545653273908#c4358038885777526403
このサイトを参考にしているのですが、
ビルドを実行すると下記のエラーが発生します。どうしたら良いでしょうか?

以前の質問は解決したのですが、また新たにエラーが出てしまいました

Processing catkin package: 'ros_environment'
==> Building with env: '/home/pi/ros_catkin_ws/install_isolated/env.sh'
==> cmake /home/pi/ros_catkin_ws/src_isolated/ros_environment -DCATKIN_DEVEL_PREFIX=/home/pi/ros_catkin_ws/devel_isolated/ros_environment -DCMAKE_INSTALL_PREFIX=/home/pi/ros_catkin_ws/install_isolated -DCMAKE_BUILD_TYPE=Release -G Unix Makefiles in '/home/pi/ros_catkin_ws/build_isolated/ros_environment'
-- Using CATKIN_DEVEL_PREFIX: /home/pi/ros_catkin_ws/devel_isolated/ros_environment
-- Using CMAKE_PREFIX_PATH: /home/pi/ros_catkin_ws/install_isolated;/opt/ros/kinetic
-- This workspace overlays: /home/pi/ros_catkin_ws/install_isolated;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/pi/ros_catkin_ws/build_isolated/ros_environment/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.14
Traceback (most recent call last):
File "/home/pi/ros_catkin_ws/build_isolated/ros_environment/catkin_generated/generate_cached_setup.py", line 22, in <module>
code = generate_environment_script('/home/pi/ros_catkin_ws/devel_isolated/ros_environment/env.sh')
File "/home/pi/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages/catkin/environment_cache.py", line 62, in generate_environment_script
env_after = ast.literal_eval(output.decode('utf8'))
File "/usr/lib/python2.7/ast.py", line 49, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "/usr/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 1
ROS_DISTRO was set to 'kinetic' before. Please make sure that the environment does not mix paths from different distributions.
^
SyntaxError: invalid syntax
CMake Error at /home/pi/ros_catkin_ws/install_isolated/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/usr/bin/python
"/home/pi/ros_catkin_ws/build_isolated/ros_environment/catkin_generated/generate_cached_setup.py")
returned error code 1
Call Stack (most recent call first):
/home/pi/ros_catkin_ws/install_isolated/share/catkin/cmake/all.cmake:198 (safe_execute_process)
/home/pi/ros_catkin_ws/install_isolated/share/catkin/cmake/catkinConfig.cmake:20 (include)
CMakeLists.txt:3 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/pi/ros_catkin_ws/build_isolated/ros_environment/CMakeFiles/CMakeOutput.log".
See also "/home/pi/ros_catkin_ws/build_isolated/ros_environment/CMakeFiles/CMakeError.log".
<== Failed to process package 'ros_environment':
Command '['/home/pi/ros_catkin_ws/install_isolated/env.sh', 'cmake', '/home/pi/ros_catkin_ws/src_isolated/ros_environment', '-DCATKIN_DEVEL_PREFIX=/home/pi/ros_catkin_ws/devel_isolated/ros_environment', '-DCMAKE_INSTALL_PREFIX=/home/pi/ros_catkin_ws/install_isolated', '-DCMAKE_BUILD_TYPE=Release', '-G', 'Unix Makefiles']' returned non-zero exit status 1

Reproduce this error by running:
==> cd /home/pi/ros_catkin_ws/build_isolated/ros_environment && /home/pi/ros_catkin_ws/install_isolated/env.sh cmake /home/pi/ros_catkin_ws/src_isolated/ros_environment -DCATKIN_DEVEL_PREFIX=/home/pi/ros_catkin_ws/devel_isolated/ros_environment -DCMAKE_INSTALL_PREFIX=/home/pi/ros_catkin_ws/install_isolated -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles'

Command failed, exiting.

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

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

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

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

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

guest

回答1

0

ベストアンサー

koikさん、

参考にされているウェブサイトでは、melodicのインストールの手順が書かれてますが、↑のエラーログでは、kineticと出ています。

インストールするROSも、ros_comm, desktop, desktop_fullと選べるようですが、どのような環境に、どのようなROSをインストールしようとしているのでしょうか?

こちらで、下記環境にて、ROS melodicdesktop_full版を、基本的に紹介されたサイトの手順通りにすすめたところ、一箇所エラーが出ましたが、パッケージを追加(sudo apt install libgazebo7-dev)して、再度ビルドしたところ、最後まで行きました。
あとは、OpenCV3は、ビルドする代わりに、ビルド済みのバイナリを導入しました。

  • Raspberry Pi 3B
  • Raspbian: 2018-11-13-raspbian-stretch
  • microSD 16GB
  • OpenCV3バイナリ導入
OPENCV_DEB=libopencv3_3.4.5-20181227.1_armhf.deb curl -SL https://github.com/mt08xx/files/raw/master/opencv-rpi/${OPENCV_DEB} -o ${OPENCV_DEB} sudo apt install -y ./${OPENCV_DEB}

koikさんの今の環境で、なにかしら悪さをしてそうなので、microSDをフォーマットして、Raspbianを入れるところから、おこなってみるのはどうでしょうか。


  • roscore動作のログ
pi@raspberrypi:~ $ lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 9.6 (stretch) Release: 9.6 Codename: stretch pi@raspberrypi:~ $ rosversion -d melodic pi@raspberrypi:~ $ roscore ... logging to /home/pi/.ros/log/7b325892-1887-11e9-af47-b827ebeba3c9/roslaunch-raspberrypi-25815.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB. started roslaunch server http://raspberrypi:33933/ ros_comm version 1.14.3 SUMMARY ======== PARAMETERS * /rosdistro: melodic * /rosversion: 1.14.3 NODES auto-starting new master process[master]: started with pid [25922] ROS_MASTER_URI=http://raspberrypi:11311/ setting /run_id to 7b325892-1887-11e9-af47-b827ebeba3c9 process[rosout-1]: started with pid [25958] started core service [/rosout] ^C[rosout-1] killing on exit [master] killing on exit shutting down processing monitor... ... shutting down processing monitor complete done pi@raspberrypi:~ $

投稿2019/01/15 05:48

編集2019/01/15 05:50
mt08

総合スコア1825

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

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

koik

2019/01/16 06:31

ありがとうございます!! OS入れ直してみたら上記のエラーは解消されました。 しかし下記のエラーが発生しました [ 60%] Generating EusLisp manifest code for dynamic_reconfigure Traceback (most recent call last): File "/home/pi/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages/geneus/geneus_main.py", line 137, in genmain pkg_map = get_pkg_map() File "/home/pi/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages/geneus/geneus_main.py", line 56, in get_pkg_map pkgs = packages.find_packages(ws) File "/usr/lib/python2.7/dist-packages/catkin_pkg/packages.py", line 89, in find_packages packages = find_packages_allowing_duplicates(basepath, exclude_paths=exclude_paths, exclude_subspaces=exclude_subspaces, warnings=warnings) File "/usr/lib/python2.7/dist-packages/catkin_pkg/packages.py", line 157, in find_packages_allowing_duplicates path_parsed_packages, warnings_lists = zip(*pool.map(parser, data)) File "/usr/lib/python2.7/multiprocessing/pool.py", line 251, in map return self.map_async(func, iterable, chunksize).get() File "/usr/lib/python2.7/multiprocessing/pool.py", line 567, in get raise self._value InvalidPackage: Error(s) in package '/home/pi/ros_catkin_ws/install_isolated/share/roscpp_tutorials/package.xml': The manifest contains invalid XML: no element found: line 1, column 0 ERROR: Error(s) in package '/home/pi/ros_catkin_ws/install_isolated/share/roscpp_tutorials/package.xml': The manifest contains invalid XML: no element found: line 1, column 0 CMakeFiles/dynamic_reconfigure_generate_messages_eus.dir/build.make:146: ターゲット '/home/pi/ros_catkin_ws/devel_isolated/dynamic_reconfigure/share/roseus/ros/dynamic_reconfigure/manifest.l' のレシピで失敗しました make[2]: *** [/home/pi/ros_catkin_ws/devel_isolated/dynamic_reconfigure/share/roseus/ros/dynamic_reconfigure/manifest.l] エラー 3 CMakeFiles/Makefile2:1194: ターゲット 'CMakeFiles/dynamic_reconfigure_generate_messages_eus.dir/all' のレシピで失敗しました make[1]: *** [CMakeFiles/dynamic_reconfigure_generate_messages_eus.dir/all] エラー 2 Makefile:138: ターゲット 'all' のレシピで失敗しました make: *** [all] エラー 2 <== Failed to process package 'dynamic_reconfigure': Command '['/home/pi/ros_catkin_ws/install_isolated/env.sh', 'make', '-j1']' returned non-zero exit status 2 Reproduce this error by running: ==> cd /home/pi/ros_catkin_ws/build_isolated/dynamic_reconfigure && /home/pi/ros_catkin_ws/install_isolated/env.sh make -j1 Command failed, exiting.
koik

2019/01/16 06:33

xmlということから、上記サイトのtinyxml2に関することかと考え、最新版のインストールを上記サイトに基づいて行いましたが、解消されませんでした
mt08

2019/01/16 08:00

エラーを出たあとに、"最新版のtinyxml2をインストール"をされたんでしょうか? もう一度、ウェブサイトに書かれた手順通りに、最初から、やってみたほうがいいと思います。 なにかしら、手順をスキップすると、生成されるファイルがおかしかくなるのかもしれません。 > InvalidPackage: Error(s) in package > '/home/pi/ros_catkin_ws/install_isolated/share/roscpp_tutorials/package.xml': > The manifest contains invalid XML: > no element found: line 1, column 0 > ERROR: Error(s) in package > '/home/pi/ros_catkin_ws/install_isolated/share/roscpp_tutorials/package.xml': > The manifest contains invalid XML: > no element found: line 1, column 0 がエラーの原因っぽいので、`package.xml`がうまくできてないとか? エラーメッセージも、目を通したほうがいいと思います。
koik

2019/01/22 02:24

ありがとうございました!!
koik

2019/01/22 04:53

何度も申し訳ありません。また別のエラーに関して質問いたしましたので、お時間ありましたらよろしくお願いいたします。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問