Motion Master
|
ℹ️ Motion Master
v5.x.x
and subsequent versions are built from this repository. However, Motion Masterv4.x.x
, which exclusively supports IgH EtherCAT Master, continues to be built from the igh-release branch in the old repository.🌱 This repository will eventually replace synapticon/motion-master.
Motion Master is a C++ application that communicates with SOMANET devices via fieldbuses and exposes a WebSocket API to its clients. Clients can perform various tasks such as device listing, data exchange, and file management, as well as execute complex procedures like encoder calibration and auto-tuning.
Clone this repository along with all its submodules:
Note: If you've already cloned the repository but haven't yet initialized or updated its submodules, you can do so with the following command:
git submodule update --init --recursive
.
You can configure and build the project using the following commands:
Now run it as follows:
The previous command will use the SOEM EtherCAT master driver, initializing on the network interface with the provided MAC address (20:88:10:7C:62:6D). It will bind the server to the specified WebSocket ports: 63524 for request-response communication and 63525 for publish-subscribe communication. These WebSocket ports are optional; if not specified, the default ports 63524 and 63525 will be used.
We recommend using Visual Studio Code with the following extensions installed:
⚠️ Important: The verified compatible version of the CMake Tools extension for this repository is
1.20.53
.
Visual Studio Code CMake Tools will automatically initialize Vcpkg and and install the libraries specified in the vcpkg.json file.
We follow the Google C++ Style Guide. For a concise summary tailored to this project, refer to our local style guide.
You can run Google's linter on this repository using the following command:
To automatically format all source code files in the motion_master
directory, use the following command:
This approach provides greater control over the environment, tools, and Vcpkg caching.
Prerequisites:
To temporarily enable cl.exe
in your PowerShell 7 (x64) session, follow these steps:
Run the following command to initialize the Visual Studio environment:
Once the new PowerShell session starts, verify that cl.exe is available by running:
ℹ️ The previous steps are necessary because the Developer Command Prompt for VS 2022 may default to the 32-bit toolset, causing linker failures in 64-bit builds. You can verify this by running
cl
and checking if the output includes for x86.
To start the self-hosted runner, navigate to the directory where you enabled the Visual Studio compiler, then run the following command in the terminal:
Below is a one-line PowerShell script (run.ps1
) that sets up the Visual Studio environment and launches the self-hosted runner:
Next, navigate to the GitHub workflow and trigger it.
Another approach is to use Dependency Walker.
An efficient method to check for missing DLL dependencies and test Motion Master on a newly installed operating system is to use Windows Sandbox.
OBLAC Drives v25.x
releases use Motion Master v5.x
, which is based on SOEM rather than IgH EtherCAT Master. To run Motion Master v5.x
as a Docker container on the OBLAC Box, make sure to stop and disable the EtherCAT (IgH EtherCAT Master) service.
If the MM_MAC
environment variable is not set when starting the Docker container, the entrypoint script will automatically extract the MAC address from the /etc/ethercat.conf
file. This simplifies setup, requiring only that the EtherCAT service be stopped, with no additional steps needed when starting the container.
There are two methods for accessing the OBLAC Box to perform this task:
Once you have access, stop and disable the current Motion Master Docker container and EtherCAT services by running the following commands:
Alternatively, use the following command, replacing id_rsa
with the OBLAC Box's private key and oblac-drives-7dc95497
with the OBLAC Box's hostname:
When prompted for a password, enter: administrator
⚠️ Important: Ensure that you are running the latest version of the OBLAC Drives Update Service (v3.0.6) before proceeding to the next step.
You can now open the OBLAC Drives Update Service and install the desired v25.x
release of the OBLAC Drives.
To manually start the Docker container and specify the MAC address, use the following command:
If you need to revert to using the IgH EtherCAT master, execute the opposite commands:
Open the OBLAC Drives Update Service and install the desired v24.x
release of the OBLAC Drives.