From acf393d3c218a8a288c7f22ccac6c1b14f1ea012 Mon Sep 17 00:00:00 2001 From: Mabel Zhang Date: Mon, 20 Dec 2021 23:10:35 -0500 Subject: [PATCH] fix tutorial snippets with new doxygen wildcards (#316) Signed-off-by: Mabel Zhang --- tutorials/05_plugin_loading.md | 16 +--------------- tutorials/07-implementing-a-physics-plugin.md | 16 +--------------- tutorials/08-implementing-a-custom-feature.md | 3 --- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/tutorials/05_plugin_loading.md b/tutorials/05_plugin_loading.md index 064c415d8..2ea3d645e 100644 --- a/tutorials/05_plugin_loading.md +++ b/tutorials/05_plugin_loading.md @@ -66,21 +66,7 @@ lines for finding `ign-plugin` and `ign-physics` dependencies in Citadel release After that, add the executable pointing to our file and add linking library so that `cmake` can compile it. -[//]: # (TODO: \include does not work with .txt extension for some reason, so manually pasting this file: \include examples/hello_world_loader/CMakeLists.txt) -```cmake -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) - -set(IGN_PLUGIN_VER 1) -find_package(ignition-plugin${IGN_PLUGIN_VER} 1.1 REQUIRED COMPONENTS all) - -set(IGN_PHYSICS_VER 6) -find_package(ignition-physics${IGN_PHYSICS_VER} REQUIRED) - -add_executable(hello_world_loader hello_world_loader.cc) -target_link_libraries(hello_world_loader - ignition-plugin${IGN_PLUGIN_VER}::loader - ignition-physics${IGN_PHYSICS_VER}::ignition-physics${IGN_PHYSICS_VER}) -``` +\include examples/hello_world_loader/CMakeLists.txt If you find CMake syntax difficult to understand, take a look at the official tutorial [here](https://cmake.org/cmake/help/latest/guide/tutorial/index.html). diff --git a/tutorials/07-implementing-a-physics-plugin.md b/tutorials/07-implementing-a-physics-plugin.md index f425a2421..c1fbc0496 100644 --- a/tutorials/07-implementing-a-physics-plugin.md +++ b/tutorials/07-implementing-a-physics-plugin.md @@ -76,21 +76,7 @@ plugin provides, i.e. `HelloWorldFeatureList` Now create a file named `CMakeLists.txt` with your favorite editor and add these lines for finding `ign-plugin` and `ign-physics` dependencies for the Fortress release: -[//]: # (TODO: \include does not work with .txt extension for some reason, so manually pasting this file: \include examples/hello_world_plugin/CMakeLists.txt) -```cmake -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) - -set(IGN_PLUGIN_VER 1) -find_package(ignition-plugin${IGN_PLUGIN_VER} 1.1 REQUIRED COMPONENTS all) - -set(IGN_PHYSICS_VER 6) -find_package(ignition-physics${IGN_PHYSICS_VER} REQUIRED) - -add_library(HelloWorldPlugin SHARED HelloWorldPlugin.cc) -target_link_libraries(HelloWorldPlugin - PRIVATE - ignition-physics${IGN_PHYSICS_VER}::ignition-physics${IGN_PHYSICS_VER}) -``` +\include examples/hello_world_plugin/CMakeLists.txt ## Build and run diff --git a/tutorials/08-implementing-a-custom-feature.md b/tutorials/08-implementing-a-custom-feature.md index 52b482161..e11375e15 100644 --- a/tutorials/08-implementing-a-custom-feature.md +++ b/tutorials/08-implementing-a-custom-feature.md @@ -136,7 +136,6 @@ will not run at the same time when requested. With the requirements and restrictions above, we first need to define a feature template for the custom feature. In this case, this feature will be responsible for retrieving world pointer from the physics engine. The template is placed in [World.hh](https://github.com/ignitionrobotics/ign-physics/blob/main/dartsim/include/ignition/physics/dartsim/World.hh): -[//]: # (TODO: snippet does not render for some reason) \snippet dartsim/include/ignition/physics/dartsim/World.hh feature template The `RetrieveWorld` feature retrieves @@ -174,7 +173,6 @@ implement the `RetrieveWorld` feature function using Dartsim API. After defining the feature template, we can add it to a custom \ref ignition::physics::FeatureList "FeatureList": -[//]: # (TODO: snippet does not render for some reason) \snippet dartsim/src/CustomFeatures.hh add to list The custom feature `RetrieveWorld` is added to `CustomFeatureList`, other custom @@ -189,7 +187,6 @@ custom feature with \ref ignition::physics::FeaturePolicy3d "FeaturePolicy3d" We will then implement the actual function with Dartsim API in [CustomFeatures.cc](https://github.com/ignitionrobotics/ign-physics/blob/ign-physics2/dartsim/src/CustomFeatures.cc) to override the member function declared in the custom feature header file: -[//]: # (TODO: snippet does not render for some reason) \snippet dartsim/src/CustomFeatures.cc implementation Here, we implement the behavior of `GetDartsimWorld` with Dartsim API to return the