I'm working with Gazebo Ignition and I would like to read sensor data in a custom plugin directly from the Entity Component Manager. The goal is to replicate what was done in Gazebo Classic using the SensorManager, like this for an Imu sensor:
imu_sensor_ = std::dynamic_pointer_cast<gazebo::sensors::ImuSensor>(
gazebo::sensors::SensorManager::Instance()->GetSensor(imuScopedName));
I'm having difficulties since the ECM works with SDF types and doesn't provide access to the sensor ID, which is necessary to call the methods that return the values read from the sensor.
Thanks for any help in advance