Skip to content

Conversation

@ygoumaz
Copy link
Contributor

@ygoumaz ygoumaz commented Dec 5, 2022

Resolves #5565.

The new launcher is compiled to WEBOTS_HOME/webots-controller.
Available options are:

  • --protocol: can be either ipc or tcp. ipc is used for local connections (i.e. Webots is started on the same machine as the controller). tcp is used for remote connections (e.g. Webots is started on a different machine than the controller). ipc is used by default if this option is not given.
  • --ip_address: The IP address of the remote machine on which the Webots instance is running. Mandatory for tcp connections and can be omitted when using ipc.
  • --port: 1234 is used by default, as it is the default port of Webots. This parameter allows to connect to a specific instance of Webots if multiple of them are running on the target machine. The port of a Webots instance can be set at its launch.
  • --robot_name: Target a specific robot by specifying its name in case multiple robots wait for an extern controller in the Webots instance.
  • --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.
  • --stdout-redirect: Redirect the stdout of the controller to the Webots console.
  • --stderr-redirect: Redirect the stderr of the controller to the Webots console.

Example:

./webots-controller $WEBOTS_HOME/projects/samples/devices/controllers/gps/gps --protocol=tcp --ip_address=localhost --port=1234 --robot_name=MyBot

Tasks:

@ygoumaz ygoumaz added the feature Implementation of a major feature label Dec 5, 2022
@ygoumaz ygoumaz added this to the R2023b milestone Dec 5, 2022
@ygoumaz ygoumaz self-assigned this Dec 5, 2022
@ygoumaz ygoumaz added the test sources Start the sources test on all platforms label Dec 6, 2022
@ygoumaz
Copy link
Contributor Author

ygoumaz commented Jan 30, 2023

I have resolved all mentioned issues, including the ability to launch the extern controller from any location, as it will automatically execute from its own directory. Running the controller launcher within the target controller's directory can be done without the need for "./" prefix, and Windows users can now use both forward and backward slashes. Robot names with spaces are now supported. Although I have tested in all languages and platforms, there may still be undiscovered edge cases, and I could not retest Matlab as my license has expired since my last test.

@ygoumaz ygoumaz marked this pull request as ready for review January 30, 2023 15:28
@ygoumaz ygoumaz requested review from ad-daniel and omichel January 30, 2023 15:28
ad-daniel
ad-daniel previously approved these changes Jan 31, 2023
Copy link
Contributor

@ad-daniel ad-daniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing else from me, works well on linux both for python, C and java

Copy link
Member

@omichel omichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me.
I just have a very minor change request.

@ygoumaz ygoumaz requested a review from omichel February 1, 2023 09:18
Copy link
Member

@omichel omichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good for me.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Implementation of a major feature test sources Start the sources test on all platforms

Development

Successfully merging this pull request may close these issues.

4 participants