RCL - RoboCLuedo  v1.0
Francesco Ganci - S4143910 - Experimental Robotics Lab - Assignment 1
All Data Structures Namespaces Files Functions Variables Macros Pages
ArmorCluedo - 001 - Working on Individuals

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;
// === INIT
// instanciation and connection
ArmorCluedo armor;
armor.Init( "/root/ontologies/my_super_ontology.owl" );
// === ADDING INDIVIDUALS
// add individuals
armor.AddIndiv( "John", "PERSON" );
armor.AddIndiv( "Broccoli", "WEAPON" );
armor.AddIndiv( "Stadium", "PLACE" );
armor.AddIndiv( "SmartHypothesis", "HYPOTHESIS" );
// REMEMBER TO UPDATE!
armor.UpdateOntology( );
// === INFORMATIONS about the individuals
// get the classes an individual belongs to
std::vector<std::string> classes_of_john = armor.GetClassOfIndiv( "John" );
// get the individuals belonging to a class
std::vector<std::string> indiv_of_class_weapon = armor.GetIndivOfClass( "WEAPON" );
// check if an individual exists
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

ArmorCluedo::AddIndiv
bool AddIndiv(std::string indivname, std::string classname, bool makeDisjoint=true)
add an individual to the ontology
Definition: armor_cluedo.cpp:53
ArmorCluedo::Init
bool Init(std::string ontologyPath)
initizalize the interface
Definition: armor_cluedo.cpp:34
ArmorCluedo::GetIndivOfClass
std::vector< std::string > GetIndivOfClass(std::string classname)
find the individuals belonging to a class
Definition: armor_cluedo.cpp:97
ArmorTools::UpdateOntology
bool UpdateOntology()
send the command REASON
Definition: armor_tools.cpp:246
main
int main(int argc, char *argv[])
Definition: example_armor_cluedo_1.cpp:26
ArmorCluedo::GetClassOfIndiv
std::vector< std::string > GetClassOfIndiv(std::string indivname, bool deep)
get the class of a given individual
Definition: armor_cluedo.cpp:81
ArmorCluedo
additional utilities for aRMOR
Definition: armor_cluedo.h:56
ArmorCluedo::ExistsIndiv
bool ExistsIndiv(std::string indivname)
check if an individual exists
Definition: armor_cluedo.cpp:112
armor_tools.h
A minimal C++ client for aRMOR.