Skip to content

Commit

Permalink
Merge branch 'master' into sync-released-c3f2c4260
Browse files Browse the repository at this point in the history
  • Loading branch information
omichel committed Jan 3, 2024
2 parents c3f2c42 + e7fd629 commit 7bc2209
Show file tree
Hide file tree
Showing 106 changed files with 1,554 additions and 991 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_suite_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ jobs:
path: artifact
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1
uses: tj-actions/branch-names@v7.0.7
- name: Extract Webots and Cache
run: |
tar xjf artifact/webots-*-x86-64*.tar.bz2 -C artifact
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_suite_linux_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ jobs:
path: artifact
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1
uses: tj-actions/branch-names@v7.0.7
- name: Extract Webots and Cache
run: |
tar xjf artifact/webots-*-x86-64*.tar.bz2 -C artifact
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_suite_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
- name: Install Webots Compilation Dependencies
run: |
# swig wget and cmake are already installed
pip install setuptools
npm install -g appdmg
- name: Set Commit SHA in Version
if: ${{ github.event_name == 'schedule' }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_suite_mac_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
- name: Install Webots Compilation Dependencies
run: |
# swig wget and cmake are already installed
pip install setuptools
npm install -g appdmg
- name: Set Commit SHA in Version
if: ${{ github.event_name == 'schedule' }}
Expand Down
6 changes: 3 additions & 3 deletions Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<key>CFBundleExecutable</key>
<string>webots</string>
<key>CFBundleGetInfoString</key>
<string>Webots R2023b, Copyright 1998-2023 Cyberbotics Ltd.</string>
<string>Webots R2023b revision 1, Copyright 1998-2023 Cyberbotics Ltd.</string>
<key>CFBundleIconFile</key>
<string>webots_icon</string>
<key>CFBundleIdentifier</key>
Expand All @@ -47,11 +47,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>R2023b</string>
<string>R2023b revision 1</string>
<key>CFBundleSignature</key>
<string>wbt </string>
<key>CFBundleVersion</key>
<string>R2023b</string>
<string>R2023b revision 1</string>
<key>LSMinimumSystemVersion</key>
<string>10.14</string>
<key>CSResourcesFileMapped</key>
Expand Down
210 changes: 0 additions & 210 deletions docs/discord/update.py

This file was deleted.

53 changes: 25 additions & 28 deletions docs/guide/matlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ Here is a simple MATLAB controller example:
```MATLAB
function simple_example
% uncomment the next two lines to use the MATLAB desktop
%desktop;
%keyboard;
TIME_STEP = 32;
my_led = wb_robot_get_device('my_led');
Expand All @@ -40,41 +36,42 @@ while wb_robot_step(TIME_STEP) ~= -1
end
```

### Using the MATLAB Desktop
### Debugging Using the MATLAB Desktop

In order to avoid cluttering the desktop with too many windows, Webots starts MATLAB with the *-nodesktop* option.
The *-nodesktop* option starts MATLAB without user interface and therefore it keeps the memory usage low which is useful in particular for multi-robot experiments.
If you would like to use the MATLAB desktop to interact with your controller you just need to add these two MATLAB commands somewhere at the beginning of your controller m-file:
For each controller written using MATLAB, Webots will start a new instance of MATLAB to act as an interpreter.
In order to avoid cluttering the desktop with too many windows, Webots starts each instance of MATLAB in non-interactive mode.
This means that MATLAB starts without the user interface which keeps the memory usage low; this is particularly useful in multi-robot experiments.
Any output to stdout (such as `disp` or `fprintf`) will also be redirected to the Webots console.

```MATLAB
desktop;
keyboard;
```
If you would like to use the MATLAB desktop to interact with your controller, you will need to run it in `<extern>` mode with the appropriate additional argument.
You can read more about that [here](running-extern-robot-controllers.md).

The `desktop` command brings up the MATLAB desktop.
The `keyboard` stops the execution of the controller and gives control to the keyboard (`K>>` prompt).
Then MATLAB opens your controller m-file in its editor and indicates that the execution is stopped at the `keyboard` command.
After that, the controller m-file can be debugged interactively, i.e., it is possible to continue the execution step-by-step, set break points, watch variable, etc.
While debugging, the current values of the controller variables are shown in the MATLAB workspace.
It is possible to *continue* the execution of the controller by typing `return` at the `K>>` prompt.
Finally the execution of the controller can be terminated with <kbd>ctrl</kbd>-<kbd>C</kbd> key combination.
**Note**: This is equivalent to inserting the command `keyboard` in your controller code, but this is strongly discouraged since it will cause an error during non-interactive execution of the code.

Once the controller is terminated, the connection with Webots remains active.
Running an external controller in interactive mode will automatically place a breakpoint at the first line of your controller.
Once MATLAB desktop has initialized, it will halt the execution of the controller and give control to the keyboard (`K>>` prompt).
MATLAB also opens your controller m-file in its editor and indicates that the execution is stopped at the breakpoint.

At this point, the controller m-file can be debugged interactively, i.e., it is possible to continue the execution step-by-step, set break points, watch variable, etc.
You can use the navigation buttons in the Editor Toolstrip such as Continue/Pause, Step, and Quit Debugging to control the execution.
While running, the controller will run normally until it terminates or reaches another breakpoint.
While paused, the current values of the controller variables are shown in the MATLAB workspace, and the Command Window becomes available.
You can read more about debugging MATLAB code on the [MathWorks homepage](https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html).

While paused (or after the controller has been terminated), the connection with Webots remains active.
Therefore it becomes possible to issue Webots commands directly on the MATLAB prompt, for example you can interactively issue commands to query the sensors, etc.:

```MATLAB
>> wb_robot_step(1000);
>> wb_gps_get_values(gps)
K>> wb_robot_step(1000);
K>> wb_gps_get_values(gps)
ans =
0.0001 0.0030 -0.6425
>> |
```

It is possible to use additional `keyboard` statements in various places in your ".m" controller.
So each time MATLAB will run into a `keyboard` statement, it will return control to the `K>>` prompt where you will be able to debug interactively.

At this point, it is also possible to restart the controller by calling its m-file from MATLAB prompt.
The execution of the controller can be terminated with <kbd>Ctrl</kbd>+<kbd>C</kbd> key combination, or by quitting the debugger.
However, since all controllers are functions, their Workspace (local variables) will be lost after termination.
It is possible to re-run the controller by calling `launcher` from MATLAB prompt.
Note that this will restart the controller only, not the whole simulation, so the current robot and motor positions will be preserved.
If you want to restart the whole simulation you need to use the `Reload` button as usual.
If you want to restart the whole simulation you need to use the `Reload` button in Webots as usual.
10 changes: 9 additions & 1 deletion docs/guide/running-extern-robot-controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ Concrete use cases are discussed in the [Setup](#setup) section.
--robot-name=<robot-name>
Target a specific robot by specifying its name in case multiple robots wait for an extern controller in the Webots instance.
--interactive
Launch MATLAB in interactive debugging mode.
See https://cyberbotics.com/doc/guide/matlab#using-the-matlab-desktop for more information.
--matlab-path=<matlab-path>
For MATLAB controllers, this option allows to specify the path to the executable of a specific MATLAB version.
By default, the launcher checks in the default MATLAB installation folder.
Expand Down Expand Up @@ -170,7 +174,11 @@ It is recommended that you do not override this `WEBOTS_TMPDIR` environment vari
### Running a MATLAB Extern Robot Controller

Matlab controllers can also be started using the launcher.
By default, the launcher will look for the latest installed version of MATLAB in the following locations, depending on the OS:
By default, the new instance of MATLAB will be running in non-interactive ("batch") mode.
However, by providing the `--interactive` option, this can be overridden, which will cause the full desktop user interface to run.
See [this page](matlab.md) for more details on how to debug webots controllers using the MATLAB desktop.

Regardless of mode, the launcher will look for the latest installed version of MATLAB in the following locations, depending on the OS:

- **Windows**: C:\Program Files\MATLAB\R20XXx\bin\win64\MATLAB.exe
- **Linux**: /usr/local/MATLAB/R20XXx/bin/matlab
Expand Down
Loading

0 comments on commit 7bc2209

Please sign in to comment.