Skip to content

Commit

Permalink
How to use collision and groundtruth plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
KiselevIlia committed Apr 2, 2024
1 parent 2f4fc8f commit 88ea3fa
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ include(CPack)
add_library(collision_plugin SHARED src/harmonic_collision.cpp)
set_property(TARGET collision_plugin PROPERTY CXX_STANDARD 17)
target_link_libraries(collision_plugin
PRIVATE gz-sim${GAZEBO_VERSION}::gz-sim${GAZEBO_VERSION}
PRIVATE gz-sim8::gz-sim8
PRIVATE gz_custom_messages
)

add_library(groundtruth_plugin SHARED src/groundtruth_plugin.cpp)
target_link_libraries(groundtruth_plugin
PRIVATE gz-sim${GAZEBO_VERSION}::gz-sim${GAZEBO_VERSION}
PRIVATE gz-sim8::gz-sim8
PRIVATE gz_custom_messages
)
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,47 @@ make
cpack -G DEB
sudo dpkg -i *.deb
```

### Tips
For the [**_collision plugin_**](./src/harmonic_collision.cpp) a model must have
1. Collision
```
<collision name='collision'>
<geometry>
<box>
<size>2.0 1.0 0.5</size>
</box>
</geometry>
</collision>
```
2. Contact sensor
```
<sensor name='sensor_contact' type='contact'>
<contact>
<!--The name of the collision element from above-->
<collision>collision</collision>
</contact>
</sensor>
```
3. Plugins
```
<plugin filename="gz-sim-contact-system"
name="gz::sim::systems::Contact">
</plugin>
<plugin filename="collision_plugin"
name="gz::CollisionPlugin">
<!-- 1000 == 1 sec -->
<updateRate>1000</updateRate>
</plugin>
```

For the [**_groundtruth plugin_**](./src/groundtruth_plugin.cpp) a model must have only plugin
```
<plugin filename="groundtruth_plugin"
name="gz::sim::systems::GroundtruthPlugin">
<!-- 1000 == 1 sec -->
<update_frequency>100</update_frequency>
</plugin>
```

Collision and groundtruth plugins requires [TASFMessage](https://github.com/tiiuae/TASFMessages) library for work

0 comments on commit 88ea3fa

Please sign in to comment.