Gazebo Sensors

API Reference

8.2.0
DopplerVelocityLog.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef GZ_SENSORS_DOPPLERVELOCITYLOG_HH_
19 #define GZ_SENSORS_DOPPLERVELOCITYLOG_HH_
20 
21 #include <chrono>
22 #include <memory>
23 #include <unordered_map>
24 #include <vector>
25 
26 #include <gz/math/Pose3.hh>
27 #include <gz/math/Vector3.hh>
30 
31 #include "gz/sensors/dvl/Export.hh"
32 
33 namespace gz
34 {
35  namespace sensors
36  {
41  {
42  gz::math::Pose3d pose;
43  gz::math::Vector3d linearVelocity;
44  gz::math::Vector3d angularVelocity;
45  };
46 
49  uint64_t, EntityKinematicState>;
50 
52  struct WorldState
53  {
55  gz::math::SphericalCoordinates origin;
56  };
57 
198  class GZ_SENSORS_DVL_VISIBLE DopplerVelocityLog
200  {
202 
204 
206  public: virtual bool Load(const sdf::Sensor &_sdf) override;
207 
209  public: virtual bool Load(sdf::ElementPtr _sdf) override;
210 
212  public: virtual bool Update(
213  const std::chrono::steady_clock::duration &_now) override;
214 
216  public: virtual void PostUpdate(
217  const std::chrono::steady_clock::duration &_now);
218 
220  public: void SetScene(gz::rendering::ScenePtr _scene) override;
221 
223  public: void SetEntity(uint64_t entity);
224 
226  public: void SetWorldState(const WorldState &_state);
227 
229  public: void SetEnvironmentalData(const EnvironmentalData &_data);
230 
232  public: virtual bool HasConnections() const override;
233 
238 
239  private: class Implementation;
240 
241  private: std::unique_ptr<Implementation> dataPtr;
242  };
243 
244  } // namespace sensors
245 } // namespace gz
246 
247 #endif // GZ_SENSORS_DOPPLERVELOCITYLOG_HH_