Skip to content

Commit

Permalink
Update RGL and bump version of the Plugin (#56)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
msz-rai authored Jan 7, 2025
1 parent 7e5833b commit f70f9ae
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 26 deletions.
43 changes: 24 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,34 @@ 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:

### Using pre-built libraries
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

Expand All @@ -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
```
Expand Down Expand Up @@ -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
<pattern_preset>Alpha Prime</pattern_preset>
<pattern_preset>Puck</pattern_preset>
Expand Down
2 changes: 1 addition & 1 deletion RGLServerPlugin/include/RGLServerPluginManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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<gz::sim::Entity> GetEntitiesInParentLink(
gz::sim::Entity entity,
Expand Down
2 changes: 1 addition & 1 deletion RGLServerPlugin/src/RGLServerPluginManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void RGLServerPluginManager::PostUpdate(
return RemoveEntityFromRGLCb(entity, visual, geometry);
});

UpdateRGLEntityPoses(ecm);
UpdateRGLEntityTransforms(ecm);
}

} // namespace rgl
6 changes: 3 additions & 3 deletions RGLServerPlugin/src/Scene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>RGLGazeboPlugin</name>
<version>0.1.2</version>
<version>0.2.0</version>
<description>RGL Gazebo Plugin</description>
<maintainer email="[email protected]">Mateusz Szczygielski</maintainer>
<license>Apache License 2.0</license>
Expand Down

0 comments on commit f70f9ae

Please sign in to comment.