Skip to content

Commit 5bbabd7

Browse files
committed
fix text
1 parent 8b35d9d commit 5bbabd7

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

docs/tutorial-basics/tutorial_12_groot2.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ struct Pose2D {
161161
}
162162
```
163163
164-
You will need to include **behaviortree_cpp/json_export.h** and follow the
165-
following instructions, based on your BT.CPP version.
164+
You will need to include **behaviortree_cpp/json_export.h** and follow these
165+
instructions, based on your BT.CPP version.
166166
167167
168168
### Version 4.3.5 or earlier
169169
170-
Implement this function, being carefull about using the namespace `nlohmann`:
170+
Implement the function `nlohmann::to_json()`:
171171
172172
```cpp
173173
namespace nlohmann {
@@ -179,16 +179,18 @@ namespace nlohmann {
179179
}
180180
```
181181

182-
Then, registered the function adding this to you **main**:
182+
Then, register the function adding this to your **main**:
183183

184184
```cpp
185185
BT::JsonExporter::get().addConverter<Pose2D>();
186186
```
187187

188188
### Version 4.3.6 or later
189189

190-
The implementation of the "to_json" function has no limitations in terms of name and namespace,
191-
as long it can be casted to `std::function<void(nlohmann::json&, const Pose2D&)>`, for instance:
190+
The implementation of the "to_json" function has can have any name or namespace,
191+
but it must conform to the signature `void(nlohmann::json&, const T&)`.
192+
193+
For instance:
192194

193195
```cpp
194196
void PoseToJson(nlohmann::json& dest, const Pose2D& pose) {
@@ -198,7 +200,8 @@ void PoseToJson(nlohmann::json& dest, const Pose2D& pose) {
198200
}
199201
```
200202
201-
And registered the function adding this to you **main**:
203+
Register the function adding this to your **main**:
204+
202205
```cpp
203206
BT::RegisterJsonDefinition<Pose2D>(PoseToJson);
204207
```

0 commit comments

Comments
 (0)