我已经从here下载并编译了一些Ros节点(只是为了获得更多信息)。我尝试使用取自该存储库的launchfile启动带有参数的5个ROS节点。
在执行source catkin_ws/devel_isolated/setup.bash和roslaunch crab.launch(上面链接中的启动文件)之后,出现下一个错误:
root@beaglebone:~# roslaunch crab.launch
... logging to /root/.ros/log/4f6332fe-dbe2-11e3-86a8-7ec70b079d59/roslaunch-beaglebone-2067.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://beaglebone:58881/
SUMMARY
========
PARAMETERS
* /clearance
* /duration_ripple
* /duration_tripod
* /joint_lower_limit
* /joint_upper_limit
* /port_name
* /robot_description
* /rosdistro
* /rosversion
* /trapezoid_h
* /trapezoid_high_radius
* /trapezoid_low_radius
NODES
/
crab_body_kinematics (crab_body_kinematics/body_kinematics)
crab_gait (crab_gait/gait_kinematics)
crab_imu (crab_imu/imu_control)
crab_leg_kinematics (crab_leg_kinematics/leg_ik_service)
crab_maestro_controller (crab_maestro_controller/controller_sub)
ROS_MASTER_URI=http://localhost:11311
core service [/rosout] found
ERROR: cannot launch node of type [crab_leg_kinematics/leg_ik_service]: can't locate node [leg_ik_service] in package [crab_leg_kinematics]
ERROR: cannot launch node of type [crab_maestro_controller/controller_sub]: can't locate node [controller_sub] in package [crab_maestro_controller]
ERROR: cannot launch node of type [crab_body_kinematics/body_kinematics]: can't locate node [body_kinematics] in package [crab_body_kinematics]
ERROR: cannot launch node of type [crab_gait/gait_kinematics]: can't locate node [gait_kinematics] in package [crab_gait]
ERROR: cannot launch node of type [crab_imu/imu_control]: can't locate node [imu_control] in package [crab_imu]我已经按照一些关于类似问题的其他威胁中的建议重新安装了这些包。
我也注意到
1º-如果我将所有节点的executables移动到文件夹src/<package>/,我就能够执行roslaunch crab.launch。但我不想就这样离开,这不是正常的工作方式;)
其他信息:
2º-如果我先执行source devel_isolated/<package>/setup.bash,然后执行roslaunch crab.launch,那么我只有source-d的包就可以工作并执行……(而另一个仍然没有)
3º-所以我让source-d所有的source devel_isolated/<package>/setup.bash,然后再试一次:这次没有人工作。
这导致我们认为问题是由于ROS变量环境造成的:如果我在2º之后创建了一个export | grep ROS,我可以看到包路径出现在$ROS_PATH-s中,而其他路径不在那里:
root@beaglebone:~# export | grep ROS
declare -x ROS_DISTRO="hydro"
declare -x ROS_ETC_DIR="/opt/ros/hydro/etc/ros"
declare -x ROS_MASTER_URI="http://localhost:11311"
declare -x ROS_PACKAGE_PATH="/root/catkin_ws/src/crab_msgs:/root/catkin_ws/src/joy:/root/catkin_ws
/src/ps3joy:/root/catkin_ws/src/xacro:/root/catkin_ws/src/roslint:/root/catkin_ws/src/kdl_parser:/root/catkin_ws
/src/urdf:/root/catkin_ws/src/urdf_parser_plugin:/root/catkin_ws/src:/opt/ros/hydro/share:/opt/ros/hydro
/stacks:/root/ros_catkin_ws/install_isolated/share:/root/ros_catkin_ws/install_isolated/stacks"
declare -x ROS_ROOT="/opt/ros/hydro/share/ros"
declare -x ROS_TEST_RESULTS_DIR="/root/catkin_ws/build_isolated/crab_msgs/test_results"
root@beaglebone:~# source catkin_ws/devel_isolated/crab_imu/setup.bash
declare -x ROS_PACKAGE_PATH="/root/catkin_ws/src/crab_imu:/root/catkin_ws/src/crab_msgs:/root/catkin_ws
/src/joy:/root/catkin_ws/src/ps3joy:/root/catkin_ws/src/xacro:/root/catkin_ws/src/roslint:/root/catkin_ws
/src/kdl_parser:/root/catkin_ws/src/urdf:/root/catkin_ws/src/urdf_parser_plugin:/root/catkin_ws/src:/opt
/ros/hydro/share:/opt/ros/hydro/stacks:/root/ros_catkin_ws/install_isolated/share:/root/ros_catkin_ws
/install_isolated/stacks"
declare -x ROS_TEST_RESULTS_DIR="/root/catkin_ws/build_isolated/crab_imu/test_results"似乎3º覆盖了在...之前执行的source,这意味着在ROS_PACKAGE_PATH中不会出现所有应该出现的包。
我也尝试过使用export命令来强制ROS_PACKAGE_PATH,但它不起作用。所以,我不得不改变更多的环境变量,但不知道是哪一个...
所以,我不知道我的诊断是否正确,如果是的话,我应该做些什么来纠正这个问题…希望我已经收集了足够的信息。
提前感谢!!
伊尼戈
发布于 2020-11-30 15:47:17
设置文件的可执行位。您很可能需要为文件设置可执行权限。
chmod +x filename.https://stackoverflow.com/questions/30069147
复制相似问题