roslaunch Commandline Tools 官方文档 翻译

 

The roslaunch package comes with roslaunch tool as well as several support tools to assist in the process of launching ROS Nodes.

roslaunch软件包随附roslaunch工具以及一些支持工具,以协助启动ROS节点。

目录

  1. roslaunch
    1. Launch syntax
    2. Passing in args
    3. Non-launch options
    4. Internal-use only options
    5. Environment Variables (advanced users)
  2. roslaunch-deps
    1. Usage
  3. roslaunch-check
  4. roslaunch-logs
    1. Usage

 

 

roslaunch

roslaunch is an important tool that manages the start and stop of ROS nodes. It takes one or more .launch files as arguments.

roslaunch是管理ROS节点的开始和停止的重要工具。 它需要一个或多个.launch文件作为参数。

Launch syntax

launch 语法

Most roslaunch commands require the name of a launch file. You can either specify the file path of the launch file, or you can specify a package name and launch file in that package, e.g.

大多数roslaunch命令都需要启动文件的名称。您可以指定启动文件的文件路径,也可以在该包中指定包名称和启动文件,例如。

$ roslaunch roslaunch example.launch
or
$ roscd roslaunch
$ roslaunch example.launch

roslaunch <package-name> <launch-filename> [args]

  • Launch <launch-filename> located in <package-name>, e.g.:

  •  

    启动<package-name>中的 <launch-filename> 文件

    $ roslaunch rospy_tutorials talker_listener.launch

    roslaunch will find a file with the matching name inside the specified package and run it.

  • roslaunch将在指定的包中找到具有匹配名称的文件并运行它。

roslaunch <launch-file-paths...> [args]

  • Launch the file(s) specified by relative or absolute paths, e.g.

  •  

    启动由相对或绝对路径指定的文件,例如.

    $ roslaunch pr2_robot/pr2_bringup/pr2.launch

roslaunch - [args] New in Indigo

  • Launch the roslaunch XML passed as standard input, e.g.

  •  

    启动作为标准输入传递的roslaunch XML,例如.

    $ rosrun package generate_launch | roslaunch -

-p port

  • If you launched roscore on a different port using the -p option, you need to pass in the -p flag to roslaunch as well, e.g.

  •  

    如果您使用-p选项在不同的端口上启动了roscore,则还需要将-p标志传递给roslaunch,例如。

    $ roslaunch -p 1234 package filename.launch

    This will dynamically override the port setting in your ROS_MASTER_URI.

  • 这将动态覆盖ROS_MASTER_URI中的端口设置。

--wait

  • Delay the launch until a roscore is detected.

  • 延迟启动,直到检测到roscore。

--local

  • Launch of the local nodes only. Nodes on remote machines will not be run.
  • 仅启动本地节点。 远程计算机上的节点将不会运行。

--screen

  • Force all node output to screen. Useful for node debugging.
  • 强制所有节点输出到屏幕。 对于节点调试很有用。

--log New in Melodic

  • Force all node output to log file. Also useful for node debugging.
  • 强制所有节点输出到日志文件。 对于节点调试也很有用。

-v

  • Enable verbose printing. Useful for tracing roslaunch file parsing.
  • 启用详细打印。 对于跟踪roslaunch文件解析很有用。

--dump-params

  • Print parameters in launch file in YAML format.
  • 以YAML格式在启动文件中打印参数。

 

Passing in args

传入参数

If the file you are launching specifies args that require setting, you can do so using an identical syntax to ROS remapping arguments, e.g.:

如果您要启动的文件指定了需要设置的args,则可以使用与ROS重新映射参数相同的语法来进行设置,例如:

roslaunch my_file.launch arg:=value

Non-launch options

非启动项

The following options provide information about a launch file without actually doing a launch. These options use the same launch-file resolution as the regular roslaunch command. You can either specify the file path of the launch file, or you can specify a package name and launch file in that package, e.g. for the example.launch file in the roslaunch package, you can use:

以下选项提供有关启动文件的信息,而不实际执行启动。这些选项使用与常规roslaunch命令相同的启动文件分辨率。可以指定启动文件的文件路径,也可以指定该包中的包名称和启动文件,例如,对于roslaunch包中的example.launch文件,可以使用:

  • roslaunch --nodes roslaunch $ROS_ROOT/tools/roslaunch/example.launch

    or

    roslaunch --nodes roslaunch example.launch

--nodes <package-name> <launch-file>
--nodes <launch-file>

  • List nodes by 'name' that are in <launch-file>. This is useful for figuring out the node name to pass to --args.

  • 按<名称>列出<launch-file>中的节点。 这对于确定要传递给--args的节点名称很有用。

--args <node-name> <package-name> <launch-file>
--args <node-name> <launch-file>

  • Display the command-line arguments that roslaunch uses when launching the node in <launch-file> named <node-name>. This is handy if you just want to launch that particular node for debugging, e.g.

  •  

    显示roslaunch使用的命令行参数(在启动<launch file>文件中,名为<node name>的启动节点时)。如果您只想启动特定节点进行调试,这很方便,例如。

    $ roslaunch --args my_node file.launch | bash

    You can also use this option with substitution args (for bash, you have to be careful to use single-quotes instead of double-quotes):

  •  

    您还可以将此选项与替换args一起使用(对于bash,必须小心使用单引号而不是双引号):

    $ roslaunch --args '$(anon my_node)' file.launch

--find <node-name> <package-name> <launch-file>
--find <node-name> <launch-file>

  • Print name of launch file that the node named <node-name> is defined in. Launch files often have many includes, which can make it difficult to find where an actual <node> definition resides. For example:

  •  

    定义节点<node name>的启动文件的打印名。启动文件通常包含许多包含文件,这可能使得很难找到实际的<node>定义所在的位置。 例如:

    $ roslaunch --find /included/talker roslaunch example.launch

--files <filename>

  • Print all files included in processing <filename>, including the file itself. This is useful for passing to other command line tools, e.g.

  •  

    打印处理<filename>中包含的所有文件,包括文件本身。这对于传递给其他命令行工具很有用,例如。

    $ roslaunch --files foo.launch | xargs grep stuff

--ros-args

  • Display command-line arguments for this launch file
  • 显示此启动文件的命令行参数
    <launch>
      <!-- ros_args.launch -->
      <arg name="foo" default="true" doc="I pity the foo'."/>
      <arg name="bar" doc="Someone walks into this."/>
      <arg name="baz" default="false"/>
      <arg name="nop"/>
      <arg name="fix" value="true"/>
    </launch>
    
    $> roslaunch --ros-args ros_args.launch
    Required Arguments:
      bar: Someone walks into this.
      nop: undocumented
    Optional Arguments:
      baz (default "false"): undocumented
      foo (default "true"): I pity the foo'.

 

Internal-use only options

仅供内部使用的选项

roslaunch uses several command-line options that are for internal use only, including -c, -u, and --core.

roslaunch使用几个仅供内部使用的命令行选项,包括-c,-u和--core。

 

Environment Variables (advanced users)

环境变量(高级用户)

NOTE: this section is intended for advanced users only

注意:本部分仅适用于高级用户

  • ROSLAUNCH_SSH_UNKNOWN

    • When launching on remote machines, SSH requires that the remote machine's key be stored in the local known_hosts file. You can set roslaunch to ignore this constraint and allow connections to machines for which you don't have keys established. This is a dangerous option as it introduces a security hole and should only be used if you understand the consequences.

    • 在远程计算机上启动时,SSH要求将远程计算机的密钥存储在本地known_hosts文件中。 您可以将roslaunch设置为忽略此约束,并允许连接到您尚未为其建立密钥的计算机。 这是一个危险的选择,因为它会引入安全漏洞,只有在您了解后果后才可以使用。

 

roslaunch-deps

roslaunch-deps reports which ROS Packages a .launch file depends on. It can also track down command build problems, such as missing dependencies in package manifests or syntax errors.

roslaunch-deps报告ROS打包.launch文件所依赖的文件。 它还可以跟踪命令生成问题,例如程序包清单中缺少相关性或语法错误。

 

Usage

To get warnings about dependencies missing in manifest files, run with the -w warn option:

要获取有关清单文件中缺少依赖项的警告,请使用-w warn选项运行:

$ roslaunch-deps -w file.launch

To get more verbose output to help track where a dependency is coming from, run with the -v verbose option:

要获取更多详细输出以帮助跟踪依赖项的来源,请使用-v详细选项运行:

$ roslaunch-deps -v file.launch

 

roslaunch-check

roslaunch-check is a command-line version of launch file checking. You can run by the follwoing:

roslaunch-check是启动文件检查的命令行版本。 您可以按以下方式运行:

$ rosrun roslaunch roslaunch-check launch            (passing a directory)
$ rosrun roslaunch roslaunch-check test/launch       (passing a sub directory)
$ rosrun roslaunch roslaunch-check launch/aa.launch  (passing a file)

 

roslaunch-logs

Roslaunch stores log files for a particular run together in a subdirectory of the ROS log directory ($ROS_ROOT/log or $ROS_LOG_DIR). In general, logs files are stored in ROS_LOG_DIR/run_id, where run_id is a unique ID associated with a particular run of a roscore.

Roslaunch将特定运行的日志文件存储在ROS日志目录的子目录($ ROS_ROOT / log或$ ROS_LOG_DIR)中。 通常,日志文件存储在ROS_LOG_DIR / run_id中,其中run_id是与roscore的特定运行关联的唯一ID。

Example:

# roslaunch-logs                                                                                               
/root/.ros/log/eef4c2b6-2c3f-11ea-96bb-0242ac110003

 

Usage

roslaunch-logs is meant to be used together with the 'cd' command, e.g.

roslaunch日志应该与“cd”命令一起使用,例如。

cd `roslaunch-logs`
root@ea57f5de462a:~/.ros/log/eef4c2b6-2c3f-11ea-96bb-0242ac110003# 

You can type this command to quickly go to the directory with the log files for your nodes.

您可以键入此命令以快速转到包含节点日志文件的目录。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值