RCL - RoboCLuedo  v1.0
Francesco Ganci - S4143910 - Experimental Robotics Lab - Assignment 1
ArmorCluedo - 002 - Working with properties

RCL requires not only adding individuals, but also working with the properties of the individuals. You can get all the available methods from this small example.

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_2" );
ros::NodeHandle nh;
// === before starting...
ArmorCluedo armor;
armor.Init( "/root/ontologies/my_super_ontology.owl" );
armor.AddIndiv( "John", "PERSON" );
armor.AddIndiv( "Broccoli", "WEAPON" );
armor.AddIndiv( "Stadium", "PLACE" );
armor.AddIndiv( "SmartHypothesis", "HYPOTHESIS" );
// REMEMBER TO UPDATE!
armor.UpdateOntology( );
// === ADD SOME PROPERTIES
armor.SetObjectProperty( "where", "Smarthypothesis", "Stadium" );
armor.SetObjectProperty( "who", "Smarthypothesis", "John" );
armor.SetObjectProperty( "what", "Smarthypothesis", "Broccoli" );
// REMEMBER TO UPDATE!
armor.UpdateOntology( );
// === CHECKINGS ON PROPERTIES
// the main function is
std::vector<std::string> values = GetValuedOfIndiv( "where", "SmartHypothesis" );
return 0;
}

- 002 - Working with properties

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::SetObjectProperty
bool SetObjectProperty(std::string prop, std::string Aelem, std::string Belem)
set a property true
Definition: armor_cluedo.cpp:131
ArmorCluedo::Init
bool Init(std::string ontologyPath)
initizalize the interface
Definition: armor_cluedo.cpp:34
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
additional utilities for aRMOR
Definition: armor_cluedo.h:56
armor_tools.h
A minimal C++ client for aRMOR.