@@ -58,10 +58,6 @@ class ignition::gazebo::systems::ImuPrivate
58
58
// / \brief Ign-sensors sensor factory for creating sensors
59
59
public: sensors::SensorFactory sensorFactory;
60
60
61
- // / \brief True to compute and output orientation values,
62
- // / false to leave the orientation field empty in the published msg.
63
- public: bool outputOrientation = true ;
64
-
65
61
public: Entity worldEntity = kNullEntity ;
66
62
67
63
// / \brief Create IMU sensor
@@ -86,19 +82,6 @@ Imu::Imu() : System(), dataPtr(std::make_unique<ImuPrivate>())
86
82
// ////////////////////////////////////////////////
87
83
Imu::~Imu () = default ;
88
84
89
- // ////////////////////////////////////////////////
90
- void Imu::Configure (const Entity & /* _entity*/ ,
91
- const std::shared_ptr<const sdf::Element> &_sdf,
92
- gazebo::EntityComponentManager & /* _ecm*/ ,
93
- gazebo::EventManager & /* _eventMgr*/ )
94
- {
95
- if (_sdf->HasElement (" output_orientation" ))
96
- {
97
- this ->dataPtr ->outputOrientation =
98
- _sdf->Get <bool >(" output_orientation" );
99
- }
100
- }
101
-
102
85
// ////////////////////////////////////////////////
103
86
void Imu::PreUpdate (const UpdateInfo &/* _info*/ ,
104
87
EntityComponentManager &_ecm)
@@ -203,8 +186,12 @@ void ImuPrivate::CreateImuEntities(EntityComponentManager &_ecm)
203
186
// Set topic
204
187
_ecm.CreateComponent (_entity, components::SensorTopic (sensor->Topic ()));
205
188
206
- // Set whether to output orientation
207
- sensor->SetOrientationEnabled (this ->outputOrientation );
189
+ // Set whether orientation is enabled
190
+ if (data.ImuSensor ())
191
+ {
192
+ sensor->SetOrientationEnabled (
193
+ data.ImuSensor ()->OrientationEnabled ());
194
+ }
208
195
209
196
this ->entitySensorMap .insert (
210
197
std::make_pair (_entity, std::move (sensor)));
@@ -274,8 +261,7 @@ void ImuPrivate::RemoveImuEntities(
274
261
275
262
IGNITION_ADD_PLUGIN (Imu, System,
276
263
Imu::ISystemPreUpdate,
277
- Imu::ISystemPostUpdate,
278
- Imu::ISystemConfigure
264
+ Imu::ISystemPostUpdate
279
265
)
280
266
281
267
IGNITION_ADD_PLUGIN_ALIAS(Imu, " ignition::gazebo::systems::Imu" )
0 commit comments