RCL - RoboCLuedo  v1.0
Francesco Ganci - S4143910 - Experimental Robotics Lab - Assignment 1
ArmorTools - 002 - The quickest way to use ArmorTools

This class is a very powerful tool, as I want to show you here. Instead of writing hundreds of lines of code, you can interact with aRMOR in few function calls. The most of times you'll use this interface in this way.

Warning
this code was written only for your understanding. Probably it won't compile.
#include "ros/ros.h"
#include "armor_msgs/ArmorDirective.h"
#include "armor_msgs/ArmorDirectiveReq.h"
#include "armor_msgs/ArmorDirectiveRes.h"
int main( int argc, char* argv[] )
{
ros::init( argc, argv, "example_armor_tools_2" );
ros::NodeHandle nh;
// preparing the client
ArmorTools armor( );
if( !armor.ConnectAndLoad( "/root/ontologies/civetta_ontology.owl" ) )
{
// something went wrong...
}
// call aRMOR
armor.SendCommand( "ADD", "IND", "CLASS", "pizza", "WEAPON" );
// REMEMBER TO UPDATE after the callings!
armor.UpdateOntology( );
return 0;
}

- 002 - The quickest way to use ArmorTools

ArmorTools::ConnectAndLoad
bool ConnectAndLoad(std::string path, std::string uri=ARMOR_DEFAULT_URI, bool manipulationFlag=true, std::string reasoner=ARMOR_DEFAULT_REASONER, bool buffered_reasoner=true)
connect to the server and load the ontology from file.
Definition: armor_tools.cpp:213
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
ArmorTools::SendCommand
bool SendCommand(std::string command, std::string first_spec="", std::string second_spec="", std::string arg1="", std::string arg2="", std::string arg3="", std::string arg4="", std::string arg5="", bool printRequest=false)
fill in a command and send it to aRMOR
Definition: armor_tools.cpp:360
ArmorTools
A minimal C++ client for aRMOR.
Definition: armor_tools.h:90
armor_tools.h
A minimal C++ client for aRMOR.