Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

launchファイルの使い方について #431

Open
shryt opened this issue Nov 15, 2022 · 4 comments
Open

launchファイルの使い方について #431

shryt opened this issue Nov 15, 2022 · 4 comments

Comments

@shryt
Copy link

shryt commented Nov 15, 2022

launchファイルを使って、gazeboやrqt_guiと一緒に、lispで書いたパブリッシャ・サブスクライバのノードを起動してみたいのですが、nodeタグのpkgやtypeなどの属性をどのように指定したらよいかわからず困っております。第5回6.1のroslaunch example.launchの実行はできる状態です。そのため、launchファイルの使い方を教えていただけると幸いです。

ログを見る限り、ROS pathとしてenshu_ws/srcにあるフォルダが認識されているようなので、試しにenshu_ws/src/testというフォルダを作り、その中に1.lispというファイルを作成し、#!/usr/bin/env roseusを最初に書き、chmod +x 1.lispを実行した状態です(つまり./1.lispで起動できる状態です)。同フォルダにtest.launchというファイルを作成し、

<launch>
    <node pkg="test" type="1.lisp" name="test1" />
</launch>

と書いた上でroslaunch test.launchを実行してみましたが、やはり認識されない状態です。

以下ログです。

mech-user@ki00087:~/enshu_ws/src/test$ roslaunch test.launch 
... logging to /home/mech-user/.ros/log/a8794e5c-6485-11ed-aa42-207918514a2d/roslaunch-ki00087-9469.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://ki00087:35799/

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.13

NODES
  /
    test1 (test/1.lisp)

auto-starting new master
process[master]: started with pid [9496]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to a8794e5c-6485-11ed-aa42-207918514a2d
process[rosout-1]: started with pid [9522]
started core service [/rosout]
ERROR: cannot launch node of type [test/1.lisp]: test
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/mech-user/enshu_ws/src/robot-programming/cart_humanoid
ROS path [2]=/home/mech-user/enshu_ws/src/dynamixel_motor/dynamixel_controllers
ROS path [3]=/home/mech-user/enshu_ws/src/dynamixel_motor/dynamixel_driver
ROS path [4]=/home/mech-user/enshu_ws/src/dynamixel_motor/dynamixel_motor
ROS path [5]=/home/mech-user/enshu_ws/src/dynamixel_motor/dynamixel_msgs
ROS path [6]=/home/mech-user/enshu_ws/src/robot-programming/dynamixel_7dof_arm
ROS path [7]=/home/mech-user/enshu_ws/src/dynamixel_motor/dynamixel_tutorials
ROS path [8]=/home/mech-user/enshu_ws/src/dynamixel_urdf
ROS path [9]=/home/mech-user/enshu_ws/src/kobuki/kobuki
ROS path [10]=/home/mech-user/enshu_ws/src/kobuki/kobuki_auto_docking
ROS path [11]=/home/mech-user/enshu_ws/src/kobuki/kobuki_bumper2pc
ROS path [12]=/home/mech-user/enshu_ws/src/kobuki/kobuki_capabilities
ROS path [13]=/home/mech-user/enshu_ws/src/kobuki/kobuki_controller_tutorial
ROS path [14]=/home/mech-user/enshu_ws/src/kobuki_desktop/kobuki_dashboard
ROS path [15]=/home/mech-user/enshu_ws/src/kobuki/kobuki_description
ROS path [16]=/home/mech-user/enshu_ws/src/kobuki_desktop/kobuki_desktop
ROS path [17]=/home/mech-user/enshu_ws/src/kobuki_desktop/kobuki_gazebo
ROS path [18]=/home/mech-user/enshu_ws/src/kobuki_desktop/kobuki_gazebo_plugins
ROS path [19]=/home/mech-user/enshu_ws/src/kobuki/kobuki_keyop
ROS path [20]=/home/mech-user/enshu_ws/src/kobuki/kobuki_random_walker
ROS path [21]=/home/mech-user/enshu_ws/src/kobuki/kobuki_rapps
ROS path [22]=/home/mech-user/enshu_ws/src/kobuki_desktop/kobuki_rviz_launchers
ROS path [23]=/home/mech-user/enshu_ws/src/kobuki/kobuki_safety_controller
ROS path [24]=/home/mech-user/enshu_ws/src/kobuki/kobuki_node
ROS path [25]=/home/mech-user/enshu_ws/src/kobuki/kobuki_testsuite
ROS path [26]=/home/mech-user/enshu_ws/src/kobuki_desktop/kobuki_qtestsuite
ROS path [27]=/home/mech-user/enshu_ws/src/robot-programming/mechatrobot
ROS path [28]=/home/mech-user/enshu_ws/src/turtlebot/turtlebot
ROS path [29]=/home/mech-user/enshu_ws/src/turtlebot_apps/turtlebot_actions
ROS path [30]=/home/mech-user/enshu_ws/src/turtlebot_apps/turtlebot_apps
ROS path [31]=/home/mech-user/enshu_ws/src/turtlebot/turtlebot_bringup
ROS path [32]=/home/mech-user/enshu_ws/src/turtlebot_apps/turtlebot_calibration
ROS path [33]=/home/mech-user/enshu_ws/src/turtlebot/turtlebot_capabilities
ROS path [34]=/home/mech-user/enshu_ws/src/turtlebot_interactions/turtlebot_dashboard
ROS path [35]=/home/mech-user/enshu_ws/src/turtlebot/turtlebot_description
ROS path [36]=/home/mech-user/enshu_ws/src/turtlebot_simulator/turtlebot_gazebo
ROS path [37]=/home/mech-user/enshu_ws/src/turtlebot_interactions/turtlebot_interactions
ROS path [38]=/home/mech-user/enshu_ws/src/turtlebot_interactions/turtlebot_interactive_markers
ROS path [39]=/home/mech-user/enshu_ws/src/turtlebot_msgs
ROS path [40]=/home/mech-user/enshu_ws/src/turtlebot_apps/turtlebot_follower
ROS path [41]=/home/mech-user/enshu_ws/src/turtlebot_apps/turtlebot_navigation
ROS path [42]=/home/mech-user/enshu_ws/src/turtlebot_apps/turtlebot_rapps
ROS path [43]=/home/mech-user/enshu_ws/src/turtlebot_interactions/turtlebot_rviz_launchers
ROS path [44]=/home/mech-user/enshu_ws/src/turtlebot_simulator/turtlebot_simulator
ROS path [45]=/home/mech-user/enshu_ws/src/turtlebot_simulator/turtlebot_stage
ROS path [46]=/home/mech-user/enshu_ws/src/turtlebot_simulator/turtlebot_stdr
ROS path [47]=/home/mech-user/enshu_ws/src/turtlebot/turtlebot_teleop
ROS path [48]=/home/mech-user/enshu_ws/src/robot-programming/turtleboteus
ROS path [49]=/home/mech-user/enshu_ws/src/robot-programming/dxl_armed_turtlebot
ROS path [50]=/home/mech-user/enshu_ws/src/robot-programming/daisya_euslisp_tutorials
ROS path [51]=/opt/ros/melodic/share
@k-okada
Copy link
Member

k-okada commented Nov 15, 2022

<node pkg="test" type="1.lisp" name="test1" />testというパッケージ内の1.lispという実行ファイルを実行します。
testというディレクトリがあれば,testというパッケージというわけではなくて,testというディレクトリがあったうえで,いくつか条件があります。おおざっぱには,package.xmlCMakeLists.txtがあればよいのですが,その中に書くべき内容はいろいろルールがあるので,一回testディレクトリを消して,
catkin_create_pkg test roseus
として作成しなおして,そこに1.lispを追加して,さらにcatkin build してsource devel/setup.bashするとrospack find test でパッケージが見つかれば,launchファイルも動くと思います。

@shryt
Copy link
Author

shryt commented Nov 15, 2022

無事にroslaunchで実行することができました。ありがとうございました。ちなみにここでの質問はCloseしないほうが良いでしょうか。

@k-okada
Copy link
Member

k-okada commented Nov 15, 2022 via email

@shryt
Copy link
Author

shryt commented Nov 15, 2022

わかりました。ありがとうございました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants