While a meta-ros layer is available, it is currently unmaintained, however there does seem to be some movement, potentially resulting in meta-ros being maintained by the community.
Additionally, meta-ost-ros provides ost-ros-image
to build an image adding ROS Core to ost-image
.
rosdep
manages ROS dependencies by mapping ROS packages names to the name of their corresponding native package name (e.g. apt packages for ubuntu).
This means that while cross compiling ROS2 nodes is fairly straight forward , its dependencies won't be, and ROS(2) must still be present on the host system.
Even compiling ROS2 from source seems to rely on this mechanism to some extent, meaning that even cross compiling all of ROS2 to work within a yocto image is not feasible, or at least not trivial.