Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DopplerVelocityLogSystem plugin #1804

Merged
merged 18 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ gz_find_package(gz-sensors8 REQUIRED
navsat

# rendering
dvl
rendering
lidar
gpu_lidar
Expand Down
12 changes: 10 additions & 2 deletions include/gz/sim/components/Environment.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@

#include <memory>
#include <string>
#include <utility>

#include <gz/common/DataFrame.hh>
#include <gz/math/SphericalCoordinates.hh>
#include <gz/math/TimeVaryingVolumetricGrid.hh>

#include <gz/sim/components/Factory.hh>
#include <gz/sim/components/Component.hh>
#include <gz/sim/Export.hh>

namespace gz
{
Expand Down Expand Up @@ -61,7 +61,15 @@ namespace components
static std::shared_ptr<EnvironmentalData>
MakeShared(FrameT _frame, ReferenceT _reference,
ReferenceUnits _units = ReferenceUnits::RADIANS,
bool _ignoreTimeStep = false);
bool _ignoreTimeStep = false)
{
auto data = std::make_shared<EnvironmentalData>();
data->frame = std::move(_frame);
data->reference = _reference;
data->units = _units;
data->staticTime = _ignoreTimeStep;
return data;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iche033 hmm, so we are duplicating EnvironmentalData definition, in gz-sensors and here, to avoid the dependency?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this introduces gz-sensors dependency in the core component of gz-sim. So far, only the gz systems (plugins) have dependency on gz-sensors, which are are loaded at run time

The general approach we've been taking is to add the common data structure in sdformat in use them in other gz libraries. It's possible to add this extra dependency but I think it needs some discussion. I made the change to try and get the PR in first.


/// \brief Environmental data frame.
FrameT frame;
Expand Down
5 changes: 0 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ set(comms_sources
comms/MsgManager.cc
)

set(component_sources
components/Environment.cc
)

set(gui_sources
${gui_sources}
PARENT_SCOPE
Expand Down Expand Up @@ -72,7 +68,6 @@ set (sources
${PROTO_PRIVATE_SRC}
${network_sources}
${comms_sources}
${component_sources}
)

set (gtest_sources
Expand Down
35 changes: 0 additions & 35 deletions src/components/Environment.cc

This file was deleted.

1 change: 1 addition & 0 deletions src/systems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ add_subdirectory(contact)
add_subdirectory(camera_video_recorder)
add_subdirectory(detachable_joint)
add_subdirectory(diff_drive)
add_subdirectory(dvl)
# elevator system causes compile erros on windows
if (NOT WIN32)
add_subdirectory(elevator)
Expand Down
10 changes: 10 additions & 0 deletions src/systems/dvl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
gz_add_system(dvl
SOURCES
DopplerVelocityLogSystem.cc
PUBLIC_LINK_LIBS
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
gz-rendering${GZ_RENDERING_VER}::gz-rendering${GZ_RENDERING_VER}
PRIVATE_LINK_LIBS
gz-sensors${GZ_SENSORS_VER}::dvl
gz-sensors${GZ_SENSORS_VER}::rendering
)
Loading