Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/revision' into merge-revision-in…
Browse files Browse the repository at this point in the history
…to-develop
  • Loading branch information
stefaniapedrazzi committed Oct 14, 2019
2 parents bd507ec + 13a45bd commit c317fb0
Show file tree
Hide file tree
Showing 26 changed files with 282 additions and 118 deletions.
1 change: 1 addition & 0 deletions .appveyor-build-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ install:
- type %APPVEYOR_BUILD_FOLDER%\src\install_scripts\bash_profile.appveyor >> C:\msys64\home\appveyor\.bash_profile
- bash --login -c "cd $WEBOTS_HOME_PATH; git submodule init; git submodule update"
- bash --login -c "$WEBOTS_HOME_PATH/src/install_scripts/msys64_installer.sh --all"
- bash --login -c "$WEBOTS_HOME_PATH/src/install_scripts/nodejs_windows_installer.sh"
- bash --login -c "$WEBOTS_HOME_PATH/src/install_scripts/inno_setup_installer.sh"
- python -m pip install --upgrade pip
- pip install PyGithub
Expand Down
1 change: 1 addition & 0 deletions .appveyor-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ install:
- type %APPVEYOR_BUILD_FOLDER%\src\install_scripts\bash_profile.appveyor >> C:\msys64\home\appveyor\.bash_profile
- bash --login -c "cd $WEBOTS_HOME_PATH; git submodule init; git submodule update"
- bash --login -c "$WEBOTS_HOME_PATH/src/install_scripts/msys64_installer.sh --all"
- bash --login -c "$WEBOTS_HOME_PATH/src/install_scripts/nodejs_windows_installer.sh"
- bash --login -c "$WEBOTS_HOME_PATH/src/install_scripts/inno_setup_installer.sh"
- python -m pip install --upgrade pip
- pip install PyGithub
Expand Down
2 changes: 1 addition & 1 deletion bin/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/node
/streamer
/webots-bin

26 changes: 13 additions & 13 deletions dependencies/Makefile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ qt-clean:
qt: $(WEBOTS_HOME_LIB)/libQt5Core.so.$(QT_VERSION)

$(WEBOTS_HOME_LIB)/libQt5Core.so.$(QT_VERSION): $(WEBOTS_DEPENDENCY_PATH)/$(QT_PACKAGE)
tar xvjfm $(WEBOTS_DEPENDENCY_PATH)/$(QT_PACKAGE) -C $(WEBOTS_HOME)
tar xfm $(WEBOTS_DEPENDENCY_PATH)/$(QT_PACKAGE) -C $(WEBOTS_HOME)

$(WEBOTS_DEPENDENCY_PATH)/$(QT_PACKAGE):
rm -f $(WEBOTS_DEPENDENCY_PATH)/$(QT_PACKAGE)
Expand All @@ -49,33 +49,33 @@ $(WEBOTS_DEPENDENCY_PATH)/$(QT_PACKAGE):


open-al-clean:
rm -rf $(WEBOTS_DEPENDENCY_PATH)/openal $(WEBOTS_DEPENDENCY_PATH)/$(OPENAL_PACKAGE)* $(WEBOTS_HOME_LIB)/libopenal*
rm -rf $(WEBOTS_DEPENDENCY_PATH)/openal $(WEBOTS_DEPENDENCY_PATH)/$(OPENAL_PACKAGE)* $(WEBOTS_HOME_LIB)/libopenal.so*

open-al: $(WEBOTS_HOME_LIB)/libopenal.so

$(WEBOTS_HOME_LIB)/libopenal.so: $(WEBOTS_DEPENDENCY_PATH)/openal
cp -ar $(WEBOTS_DEPENDENCY_PATH)/openal/build/libopenal.so* $(WEBOTS_HOME_LIB)/
cp -a $(WEBOTS_DEPENDENCY_PATH)/openal/build/libopenal.so* $(WEBOTS_HOME_LIB)/

$(WEBOTS_DEPENDENCY_PATH)/openal:
rm -f $(WEBOTS_DEPENDENCY_PATH)/$(OPENAL_PACKAGE)
wget $(DEPENDENCIES_URL)/$(OPENAL_PACKAGE) -P $(WEBOTS_DEPENDENCY_PATH)
tar xvjfm $(WEBOTS_DEPENDENCY_PATH)/$(OPENAL_PACKAGE) -C $(WEBOTS_DEPENDENCY_PATH)
tar xfm $(WEBOTS_DEPENDENCY_PATH)/$(OPENAL_PACKAGE) -C $(WEBOTS_DEPENDENCY_PATH)
rm -f $(WEBOTS_DEPENDENCY_PATH)/$(OPENAL_PACKAGE)


open-cv-clean:
rm -rf $(WEBOTS_DEPENDENCY_PATH)/opencv-lin64 $(WEBOTS_DEPENDENCY_PATH)/$(OPENCV_PACKAGE)* $(WEBOTS_HOME)/lib/controller/libopencv_* $(WEBOTS_HOME)/include/opencv2

open-cv: $(WEBOTS_HOME)/lib/controller/libopencv_core.so.2.4.3
open-cv: $(WEBOTS_HOME)/lib/controller/libopencv_core.so

$(WEBOTS_HOME)/lib/controller/libopencv_core.so.2.4.3: $(WEBOTS_DEPENDENCY_PATH)/opencv-lin64
cp -ar $(WEBOTS_DEPENDENCY_PATH)/opencv-lin64/lib/* $(WEBOTS_HOME)/lib/controller
cp -ar $(WEBOTS_DEPENDENCY_PATH)/opencv-lin64/include/opencv2/ $(WEBOTS_HOME)/include/ -R
$(WEBOTS_HOME)/lib/controller/libopencv_core.so: $(WEBOTS_DEPENDENCY_PATH)/opencv-lin64
cp -a $(WEBOTS_DEPENDENCY_PATH)/opencv-lin64/lib/* $(WEBOTS_HOME)/lib/controller
cp -a $(WEBOTS_DEPENDENCY_PATH)/opencv-lin64/include/opencv2/ $(WEBOTS_HOME)/include/ -R

$(WEBOTS_DEPENDENCY_PATH)/opencv-lin64:
rm -f $(WEBOTS_DEPENDENCY_PATH)/$(OPENCV_PACKAGE)
wget $(DEPENDENCIES_URL)/$(OPENCV_PACKAGE) -P $(WEBOTS_DEPENDENCY_PATH)
tar zxvfm $(WEBOTS_DEPENDENCY_PATH)/$(OPENCV_PACKAGE) -C $(WEBOTS_DEPENDENCY_PATH)
tar xfm $(WEBOTS_DEPENDENCY_PATH)/$(OPENCV_PACKAGE) -C $(WEBOTS_DEPENDENCY_PATH)
rm -f $(WEBOTS_DEPENDENCY_PATH)/$(OPENCV_PACKAGE)


Expand All @@ -85,7 +85,7 @@ ois-clean:
ois: $(WEBOTS_HOME_LIB)/libOIS-1.4.0.so

$(WEBOTS_HOME_LIB)/libOIS-1.4.0.so: $(WEBOTS_DEPENDENCY_PATH)/$(OIS_PACKAGE)
tar xvjfm $(WEBOTS_DEPENDENCY_PATH)/$(OIS_PACKAGE) -C $(WEBOTS_HOME)
tar xfm $(WEBOTS_DEPENDENCY_PATH)/$(OIS_PACKAGE) -C $(WEBOTS_HOME)

$(WEBOTS_DEPENDENCY_PATH)/$(OIS_PACKAGE):
rm -f $(WEBOTS_DEPENDENCY_PATH)/$(OIS_PACKAGE)
Expand All @@ -99,7 +99,7 @@ pico-clean:
pico: $(WEBOTS_HOME_LIB)/libpico.so

$(WEBOTS_HOME_LIB)/libpico.so: $(WEBOTS_DEPENDENCY_PATH)/$(PICO_PACKAGE)
tar xvjfm $(WEBOTS_DEPENDENCY_PATH)/$(PICO_PACKAGE) -C $(WEBOTS_HOME)
tar xfm $(WEBOTS_DEPENDENCY_PATH)/$(PICO_PACKAGE) -C $(WEBOTS_HOME)

$(WEBOTS_DEPENDENCY_PATH)/$(PICO_PACKAGE):
rm -f $(WEBOTS_DEPENDENCY_PATH)/$(PICO_PACKAGE)
Expand All @@ -113,7 +113,7 @@ lua-gd-clean:
lua-gd: $(WEBOTS_HOME)/resources/lua/modules/gd/gd.so

$(WEBOTS_HOME)/resources/lua/modules/gd/gd.so: $(WEBOTS_DEPENDENCY_PATH)/$(LUA_GD_PACKAGE)
tar xvjfm $(WEBOTS_DEPENDENCY_PATH)/$(LUA_GD_PACKAGE) -C $(WEBOTS_HOME)/resources/lua/modules
tar xfm $(WEBOTS_DEPENDENCY_PATH)/$(LUA_GD_PACKAGE) -C $(WEBOTS_HOME)/resources/lua/modules

$(WEBOTS_DEPENDENCY_PATH)/$(LUA_GD_PACKAGE):
rm -f $(WEBOTS_DEPENDENCY_PATH)/$(LUA_GD_PACKAGE)
Expand All @@ -129,7 +129,7 @@ lua: $(WEBOTS_DEPENDENCY_PATH)/lua-5.2.3/src/liblua.a
$(WEBOTS_DEPENDENCY_PATH)/lua-5.2.3:
rm -f $(WEBOTS_DEPENDENCY_PATH)/$(LUA_PACKAGE)
wget http://www.lua.org/ftp/$(LUA_PACKAGE) -P $(WEBOTS_DEPENDENCY_PATH)
tar zxfm $(WEBOTS_DEPENDENCY_PATH)/$(LUA_PACKAGE) -C $(WEBOTS_DEPENDENCY_PATH)
tar xfm $(WEBOTS_DEPENDENCY_PATH)/$(LUA_PACKAGE) -C $(WEBOTS_DEPENDENCY_PATH)
rm -f $(WEBOTS_DEPENDENCY_PATH)/$(LUA_PACKAGE)

$(WEBOTS_DEPENDENCY_PATH)/lua-5.2.3/src/liblua.a: $(WEBOTS_DEPENDENCY_PATH)/lua-5.2.3
Expand Down
98 changes: 55 additions & 43 deletions docs/guide/installation-procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,18 @@ The [chapter](language-setup.md) covers the set up of these tools.

Webots will run on most recent Linux distributions running glibc2.11.1 or earlier.
This includes fairly recent Ubuntu, Debian, Fedora, SuSE, RedHat, etc.
Webots comes in two different package types: `.deb` and `.tar.bz2` (tarball).
The `.deb` package is aimed at the latest LTS Ubuntu Linux distribution whereas the tarball package includes many dependency libraries and it is therefore best suited for installation on other Linux distributions.
These packages can be downloaded from our [website](https://cyberbotics.com/download).

> **Note**: Some of the following commands requires the `root` privileges.
You can get these privileges by preceding all the commands by the `sudo` command.

<!-- -->
Webots comes in three different package types: `.deb` (Debian package), `.tar.bz2` (tarball package) and `.snap` (snap package).
The Debian package is aimed at the latest LTS Ubuntu Linux distribution whereas the tarball and snap packages includes many dependency libraries and are therefore best suited for installation on other Linux distributions.
All these packages can be installed from our [website](https://cyberbotics.com/download).

> **Note**: Webots will run much faster if you install an accelerated OpenGL drivers.
If you have a NVIDIA or AMD graphics card, it is highly recommended that you install the Linux graphics drivers from these manufacturers to take the full advantage of the OpenGL hardware acceleration with Webots.
Please find instructions in [this section](verifying-your-graphics-driver-installation.md).

<!-- -->

> **Note**: Webots needs the *ffmpeg* program to create MPEG-4 movies that can be installed with *ffmpeg* and *libfdk-aac1* packages and *ubuntu-restricted-extras* for H.264 codec.
The package names could slightly change on different releases and distributions.

#### Using Advanced Packaging Tool (APT)

The advantage of this solution is that Webots will be updated automatically with system updates.
This installation requires the `root` privileges which you can acquire from this command:
#### Installing the Debian Package with the Advanced Packaging Tool (APT)

```sh
sudo su -
```
The advantage of this installation is that Webots will be updated automatically with system updates.
The installation requires the `root` privileges.

First of all, Webots should be authenticated with the [Cyberbotics.asc](https://www.cyberbotics.com/Cyberbotics.asc) signature file which can be downloaded from the [Webots download page](https://www.cyberbotics.com/download), and installed using this command:

Expand All @@ -51,8 +37,8 @@ Then, you can configure your APT package manager by adding the Cyberbotics repos
Simply execute the following lines:

```sh
apt-add-repository 'deb https://www.cyberbotics.com/debian/ binary-amd64/'
apt-get update
sudo apt-add-repository 'deb https://www.cyberbotics.com/debian/ binary-amd64/'
sudo apt-get update
```

As an alternative, you can easily add the Cyberbotics repository from the `Software and Updates` application.
Expand All @@ -66,18 +52,39 @@ When you close the window, the APT packages list should be automatically updated
Otherwise you can manually execute the following command:

```sh
apt-get update
sudo apt-get update
```

Then proceed to the installation of Webots using:

```sh
apt-get install webots
sudo apt-get install webots
```

> **Note**: Although only the command line procedure is documented here, it is also possible to use any APT front-end tool, such as the Synaptic Package Manager, to proceed with the APT installation of Webots.
#### From the "tarball" Package
#### Installing the Debian Package Directly

This procedure explains how to install Webots directly from the Debian package (having the `.deb` extension), without using the APT system.
Unlike with the APT system, you will have to repeat this operation manually each time you want to upgrade to a newer version of Webots.

On Ubuntu, double-click on the Debian package file to open it with the Ubuntu Software App and click on the `Install` button.
If a previous version of Webots is already installed, then the text on the button could be different, like `Upgrade` or `Reinstall`.
Note that GNOME Software App distributed in the first release of Ubuntu 16.04 contains a bug preventing the installation of third-party packages.

Alternatively, the Debian package can also be installed using `apt` or `gdebi` with the `root` privileges:

```sh
sudo apt install ./webots_{{ webots.version.debian_package }}_amd64.deb
```

Or:

```sh
sudo gdebi webots_{{ webots.version.debian_package }}_amd64.deb
```

#### Installing the "tarball" Package

This section explains how to install Webots from the tarball package (having the `.tar.bz2` extension).
This package can be installed without the `root` privileges.
Expand All @@ -96,41 +103,46 @@ export WEBOTS_HOME=/home/username/webots

The export line should however be included in a configuration script like "/etc/profile", so that it is set properly for every session.

Some additional libraries are needed in order to properly run Webots.
In particular *make*, *g++*, *libjpeg8-dev* and *ffmpeg* have to be installed on the system.
> **Note**: Webots needs the *ffmpeg* and *libfdk-aac1* (from *ubuntu-restricted-extras* for H.264 codec) packages to create MPEG-4 movies.
You will also need to install *make*, *g++*, *libjpeg8-dev* to compile your own robot controllers.
Other particular libraries could also be required to recompile some of the distributed binary files.
In this case an error message will be printed in the Webots console mentioning the missing dependency.
The package names could slightly change on different releases and distributions.

> **Note**: On old versions of Ubuntu or other linux distributions the library names and versions could be slightly different.

#### From the DEB Package
#### Installing the Snap Package

This procedure explains how to install Webots from the DEB package (having the `.deb` extension).
Snap packaging is a modern alternative to older packaging systems.
It runs software in a sand-boxed environment to guarantee the security of the operating system.
The snap package of Webots combines the advantages of the Debian package installed with APT and the tarball package.
To install it, simply follow the instructions from the official [snap store](https://snapcraft.io/webots) or proceed through the software center of your Ubuntu distribution.
It is very simple to install, automatically updates, runs on a large variety of Linux distributions and has no dependency.
However, the sand-boxing constraints of snaps yield the following limitations:

On Ubuntu, double-click on the DEB package file to open it with the Ubuntu Software App and click on the `Install` button.
If a previous version of Webots is already installed, then the text on the button could be different, like `Upgrade` or `Reinstall`.
Note that GNOME Software App distributed in the first release of Ubuntu 16.04 contains a bug preventing the installation of third-party packages.
##### Download Size

Alternatively, the DEB package can also be installed using `apt` or `gdebi` with the `root` privileges:
The download is significantly bigger as it includes all the dependencies of Webots (ffmpeg, python, C++ and java compilers, etc.).
For Webots R2019b revision 1, the download size of the snap is 1.8GB compared to 1.3GB of the Debian and tarball packages.

```sh
apt install ./webots_{{ webots.version.debian_package }}_amd64.deb
```
##### Extern Controllers

Or:
It is not possible to change the built-in dependencies of the snap package (Python interpreter, C/C++/Java compilers, JRE, etc.), or install any extra dependencies (native libraries, Python modules, etc.), or run MATLAB controllers.
However, when developing robot controllers, it is often useful to use various components such as a different version of Python, some Python modules (pip), native shared libraries, or to run some MATLAB controllers.
If such components are needed, users can install them on their system or local environment to create, possibly compile and link their robot controllers.
However, because of the snap sand-boxing, Webots will be unable to launch these controller itself.
To work around this problem, such controllers should be launched as extern controllers from outside of Webots.
Before launching extern controllers, you should set the `WEBOTS_HOME` environment variable to point to `/snap/webots/current/usr/share/webots` and add `$WEBOTS_HOME/lib` to your `LD_LIBRARY_PATH` environment variable, so that your controllers will find the necessary shared libraries.
The chapter entitled [running extern robot controllers](running-extern-robot-controllers.md) details how to run extern controllers, including with the snap version of Webots.

```sh
gdebi webots_{{ webots.version.debian_package }}_amd64.deb
```

#### Server Edition

Webots requires some graphical features that are usually not available by default on a linux server edition and additional packages needs to be available to make it work:
Webots requires some graphical features that are usually not available by default on a Linux server edition and additional packages needs to be available to make it work:

- `xserver-xorg-core`
- `libpulse0`

These packages are automatically installed when using the DEB package, but in case of the tarball package the user has to manually install them.
These packages are automatically installed when using the Debian package, but in case of the tarball package the user has to manually install them.

Additionally, it is also necessary to install an OS GUI, for example the Unity desktop `ubuntu-desktop` package.

Expand Down
21 changes: 19 additions & 2 deletions docs/guide/running-extern-robot-controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ For example, it may run it within a debugging environment, like *gdb*, a command
Also, the standard output and error streams (`stdout` and `stderr`) remain under the user control and are not sent to the Webots console.
It is even possible to read the standard input stream (`stdin`) like with any standard program.

> **Note**: If the `robot.synchronization` field is set to `TRUE` Webots will wait for the extern controller to be launched, otherwise the simulation will run whether the controller is started or not.
## Environment Variables

In order to be able to run an extern Webots controller, a number of environment variables should be set or extended.
Expand Down Expand Up @@ -49,12 +51,12 @@ Different use cases are detailed here from the most simple to the most complex:

### Single Simulation and Single Extern Robot Controller

You are running a single Webots simulation simultaneously on the same machine and this simulation has only one robot that you want to control from an external controller.
You are running a single Webots simulation simultaneously on the same machine and this simulation has only one robot that you want to control from an extern controller.
In this case, you simply need to set the `controller` field of this robot to `<extern>` and to launch the controller program from a console or from your favorite IDE.

### Single Simulation and Multiple Extern Robot Controllers

You are running a single Webots simulation simultaneously on the same machine and this simulation has several robots that you want to control from external controllers.
You are running a single Webots simulation simultaneously on the same machine and this simulation has several robots that you want to control from extern controllers.
In this case, for each robot that you want to control externally, you should set their `controller` field to `<extern>`.
Then, in the environment from which you are going to launch the extern controller, you should define an environment variable named `WEBOTS_ROBOT_NAME` and set it to match the `name` field of the [Robot](../reference/robot.md) node you want to control.
Once this environment variable is set, you can launch your controller and it will connect to the extern robot whose `name` matches the one provided in the environment variable.
Expand All @@ -70,6 +72,21 @@ If that simulation has more than one extern controller, you may also set the `WE

> **Note**: the environment variables can be set inside the controller program, before calling the `wb_robot_init()` function.
### Running Extern Robot Controller with the Snap Version of Webots

In order to compile and execute extern controllers, the following environment variables should be set:
```
export WEBOTS_HOME=/snap/webots/current/usr/share/webots
export LD_LIBRARY_PATH=$WEBOTS_HOME/lib
```

Because of the snap sand-boxing system, Webots has to use a special temporary folder to share information with robot controllers.
When you launch the snap version of Webots, the launcher computes the `WEBOTS_TMPDIR` environment variable if it is not already set.
This variable is computed from the `SNAP_USER_COMMON` environment variable which typically points to `/home/username/snap/webots/common`, a folder accessible by both Webots and your own programs.
Similarly, the libController will automatically check this folder and its contents to determine if it should use it to communicate with Webots.
It is recommended that you do not override this `WEBOTS_TMPDIR` environment variable, unless you want to experiment a different mechanism.


## Example Usage

1. Open for example the "WEBOTS\_HOME/projects/robots/softbank/nao/worlds/nao_demo.wbt" world file.
Expand Down
Loading

0 comments on commit c317fb0

Please sign in to comment.