Users may want to make changes to the behavior and feature-set of MotoROS2. To do this, it is necessary to build the MotoROS2 project from source code.
Please note that building from source code is not required for normal usage of MotoROS2. It is only required when you want to change the included functionality.
- Microsoft Windows
- Microsoft Visual Studio 2017 or higher (the Community Edition is also known to work). The MotoPlus SDK is not compatible with Visual Studio Code.
- MotoPlus SDK for Visual Studio v1.5.1 or higher.
This is not the same as MotoPlus IDE. Users in Asian regions will need to purchase this software from Yaskawa America directly.
If you already have a license for an older version of the MotoPlus SDK, please contact
[email protected]
or[email protected]
for assistance obtaining a newer edition. - libmicroros library and headers that corresponds to your target edition of ROS 2 (Foxy, Humble, etc) and the Yaskawa controller series you are building MotoROS2 for
Although
libmicroros
as used by MotoROS2 is derived from the open-source micro-ROS project, various patches were needed to make it compatible with MotoPlus. As of writing, these patches can not be made open-source yet. Because of this, we distribute thelibmicroros
dependency as a closed-source library. These can be found on the micro_ros_motoplus/Releases page.
Clone the yaskawa-global/motoros2 repository.
Obtain the libmicroros
and headers for your target ROS 2 variant and controller series.
These are provided as separate downloads and can be found on the micro_ros_motoplus/Releases page.
When downloading libmicroros
from the repo, the folder will be named with a unique identifier corresponding to the time stamp of the build.
Rename the folder to libmicroros_<controller-series>_<ros-2-variant>
.
E.g. libmicroros_yrc1000_humble
.
Move the folder containing libmicroros
and the headers inside the folder with the Visual Studio solution (ie: MotoROS2.sln
).
Example showing where libmicroros_yrc1000_humble
should be moved for a Humble build of MotoROS2 targetting a YRC1000 controller:
motoros2
|-- libmicroros_yrc1000_humble
| |-- include
| | `-- ...
| |-- build_info.yaml
| `-- libmicroros.yrcLib_humble
|-- src
| |-- ...
| `-- MotoROS2_AllControllers.vcxproj
|-- ...
`-- MotoROS2.sln
Now open MotoROS2.sln
in Visual Studio.
The Configuration Manager dropdown should be pre-populated with the supported combinations of controller models and ROS 2 variants. If it is not, you will need to add them manually. This procedure will also allow you to verify the Visual Studio project configuration is correct.
-
In the project tree, expand the
MotoPlus Libraries
>micro-ROS
folder. Check for thelibmicroros
library that was obtained in theSetup
procedure above.If is is not in the project tree, right-click the
MotoPlus Libraries
folder in the project tree and selectAdd
>Existing Item
.Navigate to the
libmicroros
library file and add it to the project. -
In the top menu, choose
Project
>Properties
. Use theConfiguration
dropdown to choose the correct configuration for your robot controller model and ROS 2 variant.Choose
VC++ Directories
from the left tree view. Verify the path tolibmicroros
headers exists in theInclude Directories
field. This can be a relative path, using MSBuild macros. Copy this path, as it will be used again in the next step.Example:
$(ProjectDir)..\libmicroros_yrc1000_humble\include;
NOTE: Do not use the$(SolutionDir)
macro in this step. The path should be either relative to the project file or absolute. -
Choose
NMake
from the left tree view. Ensure the start of theInclude Search Path
includes the path to thelibmicroros
headers. Example:$(ProjectDir)..\libmicroros_yrc1000_humble\include;
Click
OK
to close the properties dialog.Repeat these setup instructions for each controller model and ROS 2 variant that you wwant to build MotoROS2 for.
Use the Configuration Manager dropdown to select your target controller model and ROS 2 variant.
From the main menu, navigate to Build
> Build MotoROS2
to build the project.
Alternatively, if you are targeting multiple configurations, navigate to Build
> Batch Build
.
Check each configuration that you are targeting and then click Build
.