繁体   English   中英

ROS 启动文件问题

[英]ROS Launch file Issue

我正在实现一个简单的 roslaunch 文件,但我得到了一个退出代码 2 状态我已将确切的日志粘贴在任何想法会导致此问题以及如何纠正它的下方。 当通过 rosrun 用作节点时,它可以完美运行。

kshitij@Kshitij:~/catkin_ws$ roslaunch apriltag_ros apriltag.launch 
... logging to /home/kshitij/.ros/log/c7672d6c-479d-11ec-bd02-c56b9aa24743/roslaunch-Kshitij-20782.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://Kshitij:38583/

SUMMARY
========

PARAMETERS
* /rosdistro: noetic
* /rosversion: 1.15.13

NODES
/
apriltag_ros (apriltag_ros/tagdetector.py)

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

setting /run_id to c7672d6c-479d-11ec-bd02-c56b9aa24743
process[rosout-1]: started with pid [20800]
started core service [/rosout] 
process[apriltag_ros-2]: started with pid [20803]
usage: tagdetector.py [-h] [-f FAMILIES] [-B N] [-t N] [-x SCALE] [-b SIGMA] [-0] [-1] [-2] [-c]
tagdetector.py: error: unrecognized arguments: __name:=apriltag_ros __log:=/home/kshitij/.ros/log/c7672d6c-479d-11ec-bd02-c56b9aa24743/apriltag_ros-2.log
[apriltag_ros-2] process has died [pid 20803, exit code 2, cmd /home/kshitij/catkin_ws/src/apriltag_ros/scripts/tagdetector.py __name:=apriltag_ros __log:=/home/kshitij/.ros/log/c7672d6c-479d-11ec-bd02-c56b9aa24743/apriltag_ros-2.log].
log file: /home/kshitij/.ros/log/c7672d6c-479d-11ec-bd02-c56b9aa24743/apriltag_ros-2*.log

启动文件代码如下

<?xml version = "1.0"?>

<launch>
    <node name = "apriltag_ros" pkg = "apriltag_ros" type = "tagdetector.py"  output="screen" />
</launch>

链接到 ROS 论坛上的同一问题: https://answers.ros.org/question/391124/roslaunch-exit-code-2-error/

output

用法:tagdetector.py [-h] [-f FAMILIES] [-BN] [-t N] [-x SCALE] [-b SIGMA] [-0] [-1] [-2] [-c]

显示, tagdetector.py是一个脚本,需要使用一些特定参数调用。 首先,您应该确保脚本是否是 rosnode,以确保像这样通过 roslaunch 启动它是正确的。 其次,查看启动文档,其中显示了如何将 arguments 添加到节点。

因此,您需要通过添加将一些提到的参数添加到您的启动文件中

args="-h"

到节点启动条目。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM