I'm running Webots R2023a where I have a robot node marked as Supervisor in Webots world (*.wbt file) to be controlled by an external node in ROS2 network. When writing a webots-ros2 plugin, I'm faced with an issue where I cannot access robot fields inside the plugin implementation file.
The init
function of the plugin provides a WebotsNode
object which inherits a ROS2 node:
init(webots_ros2_driver::WebotsNode *node, std::unordered_map<std::string, std::string> ¶meters)
However, I need a reference to the current robot as a webots::Supervisor
object so I can retrieve nodes and fields of this robot (using the Supervisor API methods) to have full control over various aspects of the simulation.
Is it possible to get a handle to the robot?