... | @@ -195,11 +195,11 @@ You will need to create a `TstML.TSTNodeModelsRegistry` and use `loadDirectory` |
... | @@ -195,11 +195,11 @@ You will need to create a `TstML.TSTNodeModelsRegistry` and use `loadDirectory` |
|
|
|
|
|
```python
|
|
```python
|
|
import TstML
|
|
import TstML
|
|
import rospkg
|
|
import ament_index_python
|
|
|
|
|
|
tst_registry = TstML.TSTNodeModelsRegistry()
|
|
tst_registry = TstML.TSTNodeModelsRegistry()
|
|
tst_registry.loadDirectory(rospkg.RosPack().get_path("air_tst")
|
|
tst_registry.loadDirectory(ament_index_python.get_package_prefix("air_tst") + "/share/air_tst/configs")
|
|
+ "/configs")
|
|
|
|
```
|
|
```
|
|
|
|
|
|
Then you can load a TST from a file:
|
|
Then you can load a TST from a file:
|
... | @@ -212,20 +212,20 @@ tst_node = TstML.TSTNode.load(filename, tst_registry) |
... | @@ -212,20 +212,20 @@ tst_node = TstML.TSTNode.load(filename, tst_registry) |
|
|
|
|
|
You will need to create a `TstML::TSTNodeModelsRegistry` and use `loadDirectory` to load all the configuration file. It is best if this `tst_registry` is kept as a class member of your node.
|
|
You will need to create a `TstML::TSTNodeModelsRegistry` and use `loadDirectory` to load all the configuration file. It is best if this `tst_registry` is kept as a class member of your node.
|
|
|
|
|
|
```C++
|
|
```c++
|
|
#include <TstML/TSTNodeModelsRegistry.h>
|
|
#include <TstML/TSTNodeModelsRegistry.h>
|
|
#include <ros/package.h>
|
|
#include <ament_index_cpp/get_package_prefix.hpp>
|
|
|
|
|
|
TstML::TSTNodeModelsRegistry* tst_registry
|
|
TstML::TSTNodeModelsRegistry* tst_registry
|
|
= new TstML::TSTNodeModelsRegistry();
|
|
= new TstML::TSTNodeModelsRegistry();
|
|
tst_registry->loadDirectory(
|
|
tst_registry->loadDirectory(
|
|
QString::fromStdString(
|
|
QString::fromStdString(ament_index_cpp::get_package_prefix("air_tst")
|
|
ros::package::getPath("air_tst") + "/configs"));
|
|
+ "/share/air_tst/configs"));
|
|
```
|
|
```
|
|
|
|
|
|
Then you can load a TST from a file:
|
|
Then you can load a TST from a file:
|
|
|
|
|
|
```c+++
|
|
```c++
|
|
TstML::TSTNode* tst_node = TstML::TSTNode::load(
|
|
TstML::TSTNode* tst_node = TstML::TSTNode::load(
|
|
QUrl::fromLocalFile(QString::fromStdString(filename)),
|
|
QUrl::fromLocalFile(QString::fromStdString(filename)),
|
|
tst_registry);
|
|
tst_registry);
|
... | | ... | |