The class ArmorCluedo provides some powerful methods, specific for RCL. Here is a simple usage of this class, employed in manipulating individuals. RCL requeires a limited numer of operations right now.
- Warning
- this code was written only for your understanding. Probably it won't compile.
#include "ros/ros.h"
#include "armor_tools_armor_cluedo.h"
#include "armor_msgs/ArmorDirective.h"
#include "armor_msgs/ArmorDirectiveReq.h"
#include "armor_msgs/ArmorDirectiveRes.h"
#include <iostream>
#include <string>
int main(
int argc,
char* argv[] )
{
ros::init( argc, argv, "example_armor_cluedo_1" );
ros::NodeHandle nh;
armor.
Init(
"/root/ontologies/my_super_ontology.owl" );
armor.
AddIndiv(
"SmartHypothesis",
"HYPOTHESIS" );
std::vector<std::string> classes_of_john = armor.
GetClassOfIndiv(
"John" );
std::vector<std::string> indiv_of_class_weapon = armor.
GetIndivOfClass(
"WEAPON" );
if( armor.
ExistsIndiv(
"Tower" ) ==
false ) std::cout <<
"'Tower' not defined." << std::endl;
if( armor.
ExistsIndiv(
"Stadium" ) ==
true ) std::cout <<
"'Stadium' exists!" << std::endl;
return 0;
}
- 001 - Working on Individuals