Webots启动教程

启动Webots

首次启动Webots时,它将打开“欢迎使用Webots!”。菜单,其中包含可能的起点列表。

Linux

打开一个终端,然后键入webots以启动Webots。

macOS

打开安装Webots软件包的目录,然后双击Webots图标。

Windows

在Windows 10和Windows 7上,打开Start菜单,转到Program Files / Cyberbotics菜单,然后单击Webots R2021a菜单项。

在Windows 8上,打开Start屏幕,滚动到屏幕的右侧,直到找到Cyber​​botics部分,然后单击Webots图标。

您也可以cmd.exe通过键入webots或从DOS控制台()启动Webots webots.exe。该命令仅在从C:\Program Files\Webots\msys64\mingw64\bin目录执行时才有效(假定在中安装了Webots C:\Program Files)。如果将上述目录添加到您的Path环境变量中,则它也可以在任何目录中工作。 注意:webots-bin.exe从DOS控制台进行的调用可能无法工作,因为某些设置可能会丢失。 注意:webotsw.exe从DOS控制台进行调用会在后台启动Webots并立即返回。

命令行参数

从终端(Linux / Mac)或命令提示符(Windows)启动Webot时,可以使用以下命令行选项:

Usage: webots [options] [worldfile]

Options:

  --help

    Display this help message and exit.

  --version

    Display version information and exit.

  --sysinfo

    Display information about the system and exit.

  --mode=<mode>

    Choose the startup mode, overriding application preferences. The <mode>

    argument must be either pause, realtime, run or fast.

  --fullscreen

    Start Webots in fullscreen.

  --minimize

    Minimize the Webots window on startup.

  --batch

    Prevent Webots from creating blocking pop-up windows.

  --stdout

    Redirect the stdout of the controllers to the terminal.

  --stderr

    Redirect the stderr of the controllers to the terminal.

  --stream[="key[=value];..."]

    Start the Webots streaming server. Parameters may be

    given as an option:

      port=1234          - Start the streaming server on port 1234.

      mode=<x3d|mjpeg>   - Specify the streaming mode: x3d (default) or mjpeg.

      monitorActivity    - Print a dot '.' on stdout every 5 seconds.

      disableTextStreams - Disable the streaming of stdout and stderr.

  --log-performance=<file>[,<steps>]

    Measure the performance of Webots and log it in the file specified in the

    <file> argument. The optional <steps> argument is an integer value that

    specifies how many steps are logged. If the --sysinfo option is used, the

    system information is prepended into the log file.

Please report any bug to https://cyberbotics.com/bug

可选worldfile参数指定要打开的.wbt文件的名称。如果未指定,则Webots尝试打开最近打开的文件。

该--minimize选项用于在启动时最小化(图标化)Webots窗口。这也将跳过初始屏幕和最终的“欢迎对话框”。从脚本自动启动Webot时,可以使用此选项来避免窗口使屏幕混乱。请注意,WebotsFast在--minimize指定时自动使用该模式。

该--mode=<mode>选项可用于以指定的仿真模式启动Webots。四种可能的模拟模式为:pause,realtime,run和fast; 它们对应于Webots图形用户界面的模拟控制按钮。该选项将覆盖但不修改Webots首选项中保存的启动模式。例如,键入webots --mode=pause filename.wbt以pause模式启动Webots 。

该--sysinfo选项在标准输出流上显示有关当前系统的杂项信息,并退出Webots。

在--stdout和--stderr选项具有Webots控制台输出重定向到主叫终端或处理的效果。例如,这可用于将控制器输出重定向到文件或将其通过管道传递给Shell命令。 --stdout重定向控制器的stdout流,同时--stderr重定向stderr流。请注意,stderr流还可能包含Webots错误或警告消息。

该--stream选项启动Webots流服务器。可以提供一个选项来更改流服务器的默认参数。此选项是一个字符串,其中包含参数键及其值的列表,并用分号分隔。下描述了受支持的选项。

Key

Value example

Description

port

1234

The port on which the streaming server is open.

mode

x3d or mjpeg

The streaming mode used by the streaming server.

monitorActivity

 

Print a dot '.' on stdout every 5 seconds.

disableTextStreams

 

Disable the streaming of stdout and stderr.

                                         Streaming server options

例如,以下命令将在TCP端口'1234'上启用服务器的情况下启动Webots,并将禁用stdout和stderr的流: webots --stream="port:1234;disableTextStreams"

您可以在本节中获取有关Web流的更多信息。

安全模式

Webots可能无法启动,因为它被阻止在导致Webots或OpenGL崩溃的世界上。在这种情况下,可以在安全模式下启动Webots。安全模式强制Webots从一个空白的世界开始,减少所有OpenGL选项并存储这些首选项。为此,只需WEBOTS_SAFE_MODE在运行Webots的环境中设置环境变量。

以这种方式成功启动后,您必须取消设置此环境变量,再次打开您的世界并增加OpenGL首选项。此操作可能会导致新的崩溃。

在Windows上

1.打开Environment Variables系统对话框。为此,请在search barWindows的中查找“环境变量” start menu,单击Edit the system environment variables,这将打开System Properties对话框至Advanced选项卡。单击Environment Variables底部的按钮。

2.添加一个新的WEBOTS_SAFE_MODE用户环境变量。要做到这一点,在user variables面板中,点击New按钮,添加一个New User Variable名为WEBOTS_SAFE_MODE用的价值true。

3.照常启动Webots。

在Linux和macOS上

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Webots官方教程文档是一份详细的指南,旨在帮助用户学习和使用Webots仿真平台。以下是一些常见的Webots官方教程文档: 1. Webots用户指南:这是最全面的Webots教程文档,涵盖了Webots的基本概念、界面操作、场景创建、控制器编写等方面的内容。用户指南提供了详细的说明和示例,适合初学者和有一定经验的用户参考。 2. Webots API参考手册:这是Webots官方提供的API参考文档,包含了Webots中可用的函数、类和方法的详细说明。API参考手册对于开发人员来说非常有用,可以帮助他们了解和使用Webots提供的各种功能和接口。 3. Webots示例模型文档:Webots官方提供了一些示例模型,这些模型在教程文档中有详细的说明和解释。示例模型文档介绍了每个示例模型的用途、功能和使用方法,用户可以通过学习这些示例模型来理解和应用Webots的功能。 4. Webots开发指南:这是一份专门针对开发人员的教程文档,介绍了如何使用Webots进行机器人控制器的开发。开发指南包含了控制器编写的基本知识、编程语言的选择、API使用技巧等内容,对于开发人员来说非常实用。 以上是一些常见的Webots官方教程文档,用户可以根据自己的需求和学习进度选择相应的文档进行学习和参考。这些文档通常可以在Webots官方网站上找到,也可以在Webots软件安装目录下找到。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值