From f70f9aeddcba2044b7224542c385b9e79b252bc5 Mon Sep 17 00:00:00 2001
From: Mateusz Szczygielski <112629916+msz-rai@users.noreply.github.com>
Date: Tue, 7 Jan 2025 15:15:51 +0100
Subject: [PATCH] Update RGL and bump version of the Plugin (#56)
* Update RGL to version 0.20.0
* Update pre-built libraries docs
* Update docs
* Add note to pattern presets update rate
* Bump RGLGazeboPlugin version (0.1.2 -> 0.2.0)
---
README.md | 43 +++++++++++--------
.../include/RGLServerPluginManager.hh | 2 +-
RGLServerPlugin/src/RGLServerPluginManager.cc | 2 +-
RGLServerPlugin/src/Scene.cc | 6 +--
external/CMakeLists.txt | 2 +-
package.xml | 2 +-
6 files changed, 31 insertions(+), 26 deletions(-)
diff --git a/README.md b/README.md
index 3de0e61..aeddf04 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ Key features:
- GPU: CUDA-enabled
-- Nvidia Driver: [See RGL requirements](https://github.com/RobotecAI/RobotecGPULidar/tree/v0.17.0#runtime-requirements)
+- Nvidia Driver: [See RGL requirements](https://github.com/RobotecAI/RobotecGPULidar/tree/v0.20.0#runtime-requirements)
## Installation:
@@ -33,21 +33,26 @@ Key features:
1. Download libraries from [release](https://github.com/RobotecAI/RGLGazeboPlugin/releases).
2. Make RGL plugins visible to Gazebo:
- Move libraries to the plugin's directories.
- ```shell
- # If Gazebo installed from apt:
- cp libRobotecGPULidar.so /usr/lib/x86_64-linux-gnu/ign-gazebo-6/plugins/
- cp libRGLServerPluginInstance.so /usr/lib/x86_64-linux-gnu/ign-gazebo-6/plugins/
- cp libRGLServerPluginManager.so /usr/lib/x86_64-linux-gnu/ign-gazebo-6/plugins/
- cp libRGLVisualize.so /usr/lib/x86_64-linux-gnu/ign-gazebo-6/plugins/gui/
- ```
+ - If Gazebo installed from apt:
+ ```shell
+ cp libRobotecGPULidar.so /usr/lib/x86_64-linux-gnu/gz-sim-8/plugins
+ cp libRGLServerPluginInstance.so /usr/lib/x86_64-linux-gnu/gz-sim-8/plugins
+ cp libRGLServerPluginManager.so /usr/lib/x86_64-linux-gnu/gz-sim-8/plugins
+ cp libRGLVisualize.so /usr/lib/x86_64-linux-gnu/gz-sim-8/plugins/gui
+ ```
+ - If Gazebo installed from the ROS repository ([see](https://gazebosim.org/docs/latest/ros_installation/#installing-the-default-gazebo-ros-pairing)):
+ ```shell
+ cp libRobotecGPULidar.so /opt/ros/${ROS_DISTRO}/opt/gz_sim_vendor/lib/gz-sim-8/plugins
+ cp libRGLServerPluginInstance.so /opt/ros/${ROS_DISTRO}/opt/gz_sim_vendor/lib/gz-sim-8/plugins
+ cp libRGLServerPluginManager.so /opt/ros/${ROS_DISTRO}/opt/gz_sim_vendor/lib/gz-sim-8/plugins
+ cp libRGLVisualize.so /opt/ros/${ROS_DISTRO}/opt/gz_sim_vendor/lib/gz-sim-8/plugins/gui
+ ```
- Or set environment variables:
```shell
- # Assuming that libraries:
- # libRGLServerPluginInstance.so, libRGLServerPluginManager.so and libRobotecGPULidar.so
- # are located in RGLServerPlugin directory,
- # and libRGLVisualize.so in RGLGuiPlugin.
+ # Assuming that system plugin libraries are located in RGLServerPlugin directory,
+ # and gui plugins (libRGLVisualize.so) in RGLVisualize.
export GZ_SIM_SYSTEM_PLUGIN_PATH=`pwd`/RGLServerPlugin:$GZ_SIM_SYSTEM_PLUGIN_PATH
- export GZ_GUI_PLUGIN_PATH=`pwd`/RGLGuiPlugin:$GZ_GUI_PLUGIN_PATH
+ export GZ_GUI_PLUGIN_PATH=`pwd`/RGLVisualize:$GZ_GUI_PLUGIN_PATH
```
### Building from source
@@ -57,15 +62,14 @@ docker build \
--target=exporter \
--output=install .
```
+*Note: Build with [ROS Jazzy](https://docs.ros.org/en/jazzy/index.html) using [colcon](https://colcon.readthedocs.io/en/released/)*
#### Manual
```shell
-mkdir build
-cd build
-cmake ..
-make -j
-make install
+mkdir build && cd build
+cmake .. && make -j && make install
cd ..
+# Make it visible to Gazebo via environment variables:
export GZ_SIM_SYSTEM_PLUGIN_PATH=`pwd`/install/RGLServerPlugin:$GZ_SIM_SYSTEM_PLUGIN_PATH
export GZ_GUI_PLUGIN_PATH=`pwd`/install/RGLVisualize:$GZ_GUI_PLUGIN_PATH
```
@@ -186,7 +190,8 @@ Inside the link entity in your model, add a custom sensor:
```
- **pattern_preset**\
- We have prepared several lidar presets. You can type in the name of a LiDAR to use its pattern (all available patterns are shown below).
+ We have prepared several lidar presets. You can type in the name of a LiDAR to use its pattern (all available patterns are shown below).\
+ *Note: All presets are assumed to work at 10Hz update rate*
```xml
Alpha Prime
Puck
diff --git a/RGLServerPlugin/include/RGLServerPluginManager.hh b/RGLServerPlugin/include/RGLServerPluginManager.hh
index f401acd..23219cd 100644
--- a/RGLServerPlugin/include/RGLServerPluginManager.hh
+++ b/RGLServerPlugin/include/RGLServerPluginManager.hh
@@ -99,7 +99,7 @@ private:
const gz::sim::Entity& entity,
const gz::sim::components::LaserRetro* laser_retro);
- void UpdateRGLEntityPoses(const gz::sim::EntityComponentManager& ecm);
+ void UpdateRGLEntityTransforms(const gz::sim::EntityComponentManager& ecm);
std::unordered_set GetEntitiesInParentLink(
gz::sim::Entity entity,
diff --git a/RGLServerPlugin/src/RGLServerPluginManager.cc b/RGLServerPlugin/src/RGLServerPluginManager.cc
index 8716394..888a912 100644
--- a/RGLServerPlugin/src/RGLServerPluginManager.cc
+++ b/RGLServerPlugin/src/RGLServerPluginManager.cc
@@ -76,7 +76,7 @@ void RGLServerPluginManager::PostUpdate(
return RemoveEntityFromRGLCb(entity, visual, geometry);
});
- UpdateRGLEntityPoses(ecm);
+ UpdateRGLEntityTransforms(ecm);
}
} // namespace rgl
diff --git a/RGLServerPlugin/src/Scene.cc b/RGLServerPlugin/src/Scene.cc
index db06806..c9c9f6f 100644
--- a/RGLServerPlugin/src/Scene.cc
+++ b/RGLServerPlugin/src/Scene.cc
@@ -156,12 +156,12 @@ bool RGLServerPluginManager::SetLaserRetroCb(
}
#pragma clang diagnostic pop
-void RGLServerPluginManager::UpdateRGLEntityPoses(const gz::sim::EntityComponentManager& ecm)
+void RGLServerPluginManager::UpdateRGLEntityTransforms(const gz::sim::EntityComponentManager& ecm)
{
for (auto entity: entitiesInRgl) {
rgl_mat3x4f rglMatrix = FindWorldPoseInRglMatrix(entity.first, ecm);
- if (!CheckRGL(rgl_entity_set_pose(entity.second.first, &rglMatrix))) {
- gzerr << "Failed to update pose for entity (" << entity.first << ").\n";
+ if (!CheckRGL(rgl_entity_set_transform(entity.second.first, &rglMatrix))) {
+ gzerr << "Failed to update transform for entity (" << entity.first << ").\n";
}
}
}
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index 1fbf79a..cc73121 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -28,7 +28,7 @@ if(RGL_CUSTOM_LIBRARY_PATH AND RGL_CUSTOM_API_HEADER_PATH) # Copy custom Robotec
file(COPY ${RGL_CUSTOM_LIBRARY_PATH} DESTINATION ${RGL_LIBRARY_DIR})
file(COPY ${RGL_CUSTOM_API_HEADER_PATH} DESTINATION ${RGL_PROJECT_DIR})
else() # Download RobotecGPULidar from the release
- set(RGL_TAG "v0.17.0")
+ set(RGL_TAG "v0.20.0")
set(RGL_API_CORE_HEADER_PATH "${RGL_API_HEADERS_DIR}/core.h")
set(RGL_SO_ZIP_FILENAME "RGL-core-linux-x64.zip")
set(RGL_SO_ZIP_URL "https://github.com/RobotecAI/RobotecGPULidar/releases/download/${RGL_TAG}/${RGL_SO_ZIP_FILENAME}")
diff --git a/package.xml b/package.xml
index 8ab4735..3bdcb47 100644
--- a/package.xml
+++ b/package.xml
@@ -2,7 +2,7 @@
RGLGazeboPlugin
- 0.1.2
+ 0.2.0
RGL Gazebo Plugin
Mateusz Szczygielski
Apache License 2.0