tork-a / jog_control

Apache License 2.0
56 stars 18 forks source link

TRA1にてjog_control起動エラー #32

Closed Yone-Tech closed 5 years ago

Yone-Tech commented 5 years ago

TRA1実機にてjog_controlを起動しようとしましたがエラーになりました。 対応策を教えて頂けますでしょうか。 ROSバージョンはindigoです

下記コマンドを実行しました。

$ roslaunch tra1_bringup tra1_bringup.launch eth:=eth1
$ roslaunch tra1_bringup tra1_moveit.launch

Rviz起動後 $ roslaunch jog_launch tra1.launch を実行しましたがエラーが発生しました。

[tra1.launch] is neither a launch file in package [jog_launch] nor is [jog_launch] a launch file name
The traceback for the exception was written to the log file

どのように対処すればよろしいでしょうか。 また、上記エラーのlogファイルはどこに作成されますでしょうか。

Moirai commented 5 years ago

jog_launchパッケージへのパスが通っていないか、jog_launchの中にtra1.launchが存在しないのどちらかのように見えます。 ワークスペースを作成してこのパッケージを利用されていると思います。 https://github.com/tork-a/jog_control#install-from-source の最後の行の $ source devel/setup.bash にあたる、 自分のワークスペース配下のdevelの下のsetup.bashを実行しておく必要があります。

Yone-Tech commented 5 years ago

ご回答ありがとうございます。 結果は同じエラーとなりました。

techno@techno:~$ roslaunch jog_launch tra1.launch 
[tra1.launch] is neither a launch file in package [jog_launch] nor is [jog_launch] a launch file name
The traceback for the exception was written to the log file

パスを確認すると下記のように出力されたためパスは通っていると考えてよいでしょうか。

$ echo $ROS_PACKAGE_PATH
/home/techno/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks

ファイルが存在していませんでした。 /opt/ros/indigo/includeの中にjog_launchフォルダはありませんでした。

インストール手順を説明いたします。 基本は手順に沿って行いましたが少し変更しています。

$ source /opt/ros/indigo/setup.bash   ←kinekteをindigoに書き換え
$ mkdir -p ws/src
$ cd ws
$ wstool init src
$ wstool set -t src jog_control --git http://github.com/tork-a/jog_control
$ wstool update -t src
$ rosdep install -r --from-path src --ignore-src

ここまでは実行でき次のコマンドはエラーとなるため

$ catkin build
catkin: コマンドが見つかりません

代わりに $ catkin_make を実行しました。すると

省略
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "fake_joint_launch"
  with any of the following names:

    fake_joint_launchConfig.cmake
    fake_joint_launch-config.cmake

  Add the installation prefix of "fake_joint_launch" to CMAKE_PREFIX_PATH or
  set "fake_joint_launch_DIR" to a directory containing one of the above
  files.  If "fake_joint_launch" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  jog_control/jog_launch/CMakeLists.txt:4 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/techno/ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/techno/ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

とエラーになったため ダウンロードしたfake_jointをws/srcに入れ再度

$ catkin_make
中略
[100%] Building CXX object jog_control/jog_controller/CMakeFiles/jog_controller.dir/src/moc_jog_slider.cxx.o
Linking CXX executable /home/techno/ws/devel/lib/fake_joint_driver/fake_joint_driver_node
[100%] Built target fake_joint_driver_node
Linking CXX executable /home/techno/ws/devel/lib/jog_controller/jog_joint_node
[100%] Built target jog_joint_node
Linking CXX shared library /home/techno/ws/devel/lib/libjog_controller.so
[100%] Built target jog_controller
Linking CXX executable /home/techno/ws/devel/lib/jog_controller/jog_frame_node
[100%] Built target jog_frame_node
techno@techno:~/ws$ source devel/setup.bash

と行いました。

$ catkin_makeを実行ではだめなのでしょうか。 よろしくお願いたします。

Moirai commented 5 years ago

ファイルが存在していませんでした。 /opt/ros/indigo/includeの中にjog_launchフォルダはありませんでした。

gitからソースコードをワークスペースに落として来て使っているはずなので、 launchファイルがあるべき場所は 自分のワークスペース配下/src/jog_control/jog_launch/launchフォルダの下になります。

パスについては、roscdして、移動した場所が、 自分のワークスペース配下/devel になっているのであれば、 そのターミナルのパスは通っていると判断できます。

そうなると、本当にtra1.launchファイルが自分のワークスペース配下に無いために今回のエラーが出ていると考えられます。

$ wstool set -t src jog_control --git http://github.com/tork-a/jog_control
$ wstool update -t src

の後に、srcフォルダの中にjog_controlの一式が入っているか確認して、入っていなければダウンロードに失敗しているので、もう一度updateしてみてください。

(別件ですが、jog_control、indigoで動作するのか私は存じ上げないです)。

7675t commented 5 years ago

jog_controlはindigoでも動作するはずですが、今回のエラーはそれ以前のところで起動できていないです。対処法としては、 @Moirai のとおりで、jog_launchパッケージがあるか、確認してみてください。

Yone-Tech commented 5 years ago

ご回答ありがとうございます。 roscdすると /opt/ros/indigo$ となりました。 自分のワークスペース配下/devel とならなかったためこの点が不具合だと思います。 設定方法をお教え頂けますでしょうか。 お手数おかけしますがよろしくお願い申し上げます。

Moirai commented 5 years ago

https://github.com/tork-a/jog_control/issues/32#issuecomment-466401770  です

Yone-Tech commented 5 years ago

インストール手順を最後まで行い、 $ source devel/setup.bash を実行しても

techno@techno:~$ roscd
techno@techno:/opt/ros/indigo$ 

と変化がありませんでした。

「自分のワークスペース配下のdevelの下のsetup.bashを実行しておく必要があります。」 というのは $ source devel/setup.bash であっているでしょうか。何かコマンドを追加する必要があるのでしょうか。

自分のワークスペース配下/src/jog_control/jog_launch/launch/tra1.launch はありました。 お手数おかけしますがよろしくお願い申し上げます。

Moirai commented 5 years ago

自分のワークスペースの下のdevelの下のsetup.bashをsourceします。 cdした場所にいるのなら、 source ワークスペース名/devel/setup.bash ですね。 単に、Linuxで言うところの絶対パスを正しく指定せずに、sourceしているから自分のワークスペース配下のsetup.bashが動いていないのだと思います。

Yone-Tech commented 5 years ago

ご回答ありがとうございます。

 techno@techno:~$ source ws/devel/setup.bash
 bash: /home/techno/ws/devel/_setup_util.py: 許可がありません
 Failed to run '"/home/techno/ws/devel/_setup_util.py" ': return code 126

とエラーが出てきます。 ファイルのプロパティを見ますとアクセス権はありました。 解決策を教えていただけますでしょうか。よろしくお願い申し上げます。

Moirai commented 5 years ago

ワークスペースと_setup_util.pyの ls -la した結果を貼ってください。

Yone-Tech commented 5 years ago

以下のようになりました。よろしくお願いいたします。

techno@techno:~$ ls -la ws
合計 24
drwx------  5 techno techno 4096  2月 28 11:19 .
drwxr-xr-x 30 techno techno 4096  2月 28 14:21 ..
-rw-------  1 techno techno   98  2月 28 11:19 .catkin_workspace
drwx------  9 techno techno 4096  2月 28 11:19 build
drwx------  5 techno techno 4096  2月 28 11:19 devel
drwx------  4 techno techno 4096  2月 28 11:19 src
techno@techno:~/ws/devel$ ls -la _setup_util.py
-rw------- 1 techno techno 12433  2月 28 11:19 _setup_util.py
Moirai commented 5 years ago

権限の付き方がおかしいようです. ワークスペースをtechnoのユーザで作り直すか 今あるwsにtechnoの権限を付与すればいいのではと思います.

Yone-Tech commented 5 years ago

jog_control起動できました。ありがとうございます。 しかし、jog_controlのパネルが表示できません。 手順通りにrviz起動後にjog_controlを起動させました。 Addボタンを押しても見当たりません。 お手数ですが、ご教示くださいますようよろしくお願いいたします。

7675t commented 5 years ago

rvizのプラグイン(パネル)が表示できない場合、ビルドできていない可能性が高いです。 ワークスペースでもう一度、

$ catkin_make (catkin_toolsを使っている場合は、catkin build)
$ source devel/setup.bash

とします。fake_jointパッケージが無い、というエラーがまだ解決できていないでしょうか?その場合は、

$ cd ws/src
$ git clone https://github.com/tork-a/fake_joint.git

とする、もしくは、ネットがつながってない場合はzipファイルをダウンロードするなどしてソースコードを取得し、fake_jointパッケージも併せてビルドするようにしてみてください。

Yone-Tech commented 5 years ago

jog_controlパネル表示できjog動作を実現できました。 単純にパネル表示方法の知識不足でした。

Moirai様、7675t様ご教示頂きありがとうございました。 基本的な質問ばかりで大変お手数お掛けしました。大変勉強になりました。 ありがとうございました。

Moirai commented 5 years ago

よかったです.おつかれさまでした. 解決したらissueをcloseしておいてください.