From: <tum...@li...> - 2010-04-24 23:07:47
|
Revision: 466 http://tum-ros-pkg.svn.sourceforge.net/tum-ros-pkg/?rev=466&view=rev Author: moesenle Date: 2010-04-24 23:07:40 +0000 (Sat, 24 Apr 2010) Log Message: ----------- Author: Lorenz M?\195?\182senlechner <moe...@in...> Date: Sat Apr 24 15:59:58 2010 -0700 commit a015ed743c6e21ecbdcb9d35b57f2a0ce4940d5c Author: Moritz Tenorth <te...@cs...> Date: Mon Mar 15 16:17:05 2010 +0100 fixed problem with local paths in init.pl rosprolog now finds referenced OWL files also when it is not started in the package's prolog directory fixing ticket #37 commit 68c5de4e0886310e60afb7df33db1239f0cd1109 Author: Lorenz M?\195?\182senlechner <moe...@in...> Date: Mon Mar 8 19:01:02 2010 +0100 Refactoring: renamed all occurrences of inf9 to ias. If something brakes, don't blame me and fix it yourself :) commit 755a975ba19a8054b864e0db352cbaa34ea14413 Author: Moritz Tenorth <te...@cs...> Date: Wed Feb 10 14:49:28 2010 +0100 copied changes from OWL repository, revision 214\n\n=Path: owl URL: svn+ssh://sv...@sv.../knowledge/trunk/owl Repository Root: svn+ssh://sv...@sv.../knowledge Repository UUID: 7519aae1-3b1a-4aea-b015-717ca8ac3afd Revision: 214 Node Kind: directory Last Changed Author: tenorth Last Changed Rev: 214 Last Changed Date: 2010-02-10 14:49:15 +0100 (Wed, 10 Feb 2010) commit c04ebc00449927bdfb20446fc0e15a23a0aabc0e Author: Moritz Tenorth <te...@cs...> Date: Wed Feb 3 16:19:41 2010 +0100 exporting first version of the knowledge processing system git-commit Revision Links: -------------- http://tum-ros-pkg.svn.sourceforge.net/tum-ros-pkg/?rev=214&view=rev Added Paths: ----------- stacks/knowrob/comp_ros/ stacks/knowrob/comp_ros/CMakeLists.txt stacks/knowrob/comp_ros/Makefile stacks/knowrob/comp_ros/lib/ stacks/knowrob/comp_ros/lib/ros_client.jar stacks/knowrob/comp_ros/mainpage.dox stacks/knowrob/comp_ros/manifest.xml stacks/knowrob/comp_ros/owl/ stacks/knowrob/comp_ros/owl/comp_ros.owl.in stacks/knowrob/comp_ros/prolog/ stacks/knowrob/comp_ros/prolog/comp_ros.pl stacks/knowrob/comp_ros/prolog/init.pl.in Added: stacks/knowrob/comp_ros/CMakeLists.txt =================================================================== --- stacks/knowrob/comp_ros/CMakeLists.txt (rev 0) +++ stacks/knowrob/comp_ros/CMakeLists.txt 2010-04-24 23:07:40 UTC (rev 466) @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 2.4.6) +include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) + + +rosbuild_init() + +add_classpath(${comp_ros_PACKAGE_PATH}/lib/ros_client.jar) + +rosbuild_find_ros_package(ias_knowledge_base) +set( OWL_PATH_PREFIX ${ias_knowledge_base_PACKAGE_PATH} ) + +file(GLOB inputs owl/*.in) + +foreach( _in ${inputs} ) + string(REPLACE ".in" "" _out ${_in}) + configure_file( ${_in} ${_out} ) +endforeach( _in ) + +# replace path to local OWL files +rosbuild_find_ros_package(comp_ros) +set( LOCAL_PACKAGE_PATH ${comp_ros_PACKAGE_PATH} ) + +file(GLOB inputs prolog/*.in) +foreach( _in ${inputs} ) + string(REPLACE ".in" "" _out ${_in}) + configure_file( ${_in} ${_out} ) +endforeach( _in ) Added: stacks/knowrob/comp_ros/Makefile =================================================================== --- stacks/knowrob/comp_ros/Makefile (rev 0) +++ stacks/knowrob/comp_ros/Makefile 2010-04-24 23:07:40 UTC (rev 466) @@ -0,0 +1 @@ +include $(shell rospack find mk)/cmake.mk \ No newline at end of file Added: stacks/knowrob/comp_ros/lib/ros_client.jar =================================================================== (Binary files differ) Property changes on: stacks/knowrob/comp_ros/lib/ros_client.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: stacks/knowrob/comp_ros/mainpage.dox =================================================================== --- stacks/knowrob/comp_ros/mainpage.dox (rev 0) +++ stacks/knowrob/comp_ros/mainpage.dox 2010-04-24 23:07:40 UTC (rev 466) @@ -0,0 +1,30 @@ +/** +\mainpage +\htmlinclude manifest.html + +\b ias_comp_ros is ... + +<!-- +In addition to providing an overview of your package, +this is the section where the specification and design/architecture +should be detailed. While the original specification may be done on the +wiki, it should be transferred here once your package starts to take shape. +You can then link to this documentation page from the Wiki. +--> + + +\section codeapi Code API + +<!-- +Provide links to specific auto-generated API documentation within your +package that is of particular interest to a reader. Doxygen will +document pretty much every part of your code, so do your best here to +point the reader to the actual API. + +If your codebase is fairly large or has different sets of APIs, you +should use the doxygen 'group' tag to keep these APIs together. For +example, the roscpp documentation has 'libros' group. +--> + + +*/ Added: stacks/knowrob/comp_ros/manifest.xml =================================================================== --- stacks/knowrob/comp_ros/manifest.xml (rev 0) +++ stacks/knowrob/comp_ros/manifest.xml 2010-04-24 23:07:40 UTC (rev 466) @@ -0,0 +1,24 @@ +<package> + <description brief="comp_ros"> + + comp_ros + + Interface to ROS for reading data. Currently used for accessing the jlo + service, but likely to be extended to other services. + + </description> + <author>Moritz Tenorth</author> + <license>GPL</license> + <review status="unreviewed" notes=""/> + <url>http://ias.in.tum.de/kb/wiki/index.php/comp_ros</url> + + <depend package="ias_knowledge_base"/> + <depend package="kb_computable_client"/> + + <export> + <java classpath="${prefix}/lib/ros_client.jar"/> + </export> + +</package> + + Added: stacks/knowrob/comp_ros/owl/comp_ros.owl.in =================================================================== --- stacks/knowrob/comp_ros/owl/comp_ros.owl.in (rev 0) +++ stacks/knowrob/comp_ros/owl/comp_ros.owl.in 2010-04-24 23:07:40 UTC (rev 466) @@ -0,0 +1,57 @@ +<?xml version="1.0"?> +<!DOCTYPE rdf:RDF [ + + <!ENTITY local_path 'file://@OWL_PATH_PREFIX@/owl/'> + <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns'> + <!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema'> + <!ENTITY owl 'http://www.w3.org/2002/07/owl'> + <!ENTITY xsd 'http://www.w3.org/2001/XMLSchema'> + <!ENTITY knowrob 'http://ias.cs.tum.edu/kb/knowrob.owl'> + <!ENTITY actionmodel 'http://ias.cs.tum.edu/kb/actionmodel.owl'> + +]> + +<rdf:RDF + xmlns:computable="http://ias.cs.tum.edu/kb/computable.owl#" + xmlns:swrl="http://www.w3.org/2003/11/swrl#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns="http://ias.cs.tum.edu/kb/comp_ros.owl#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:am="&actionmodel;#" + xmlns:knowrob="&knowrob;#" + xml:base="http://ias.cs.tum.edu/kb/comp_ros.owl"> + <owl:Ontology rdf:about=""> + <owl:imports rdf:resource="&local_path;knowrob.owl"/> + </owl:Ontology> + + + + <owl:ObjectProperty rdf:about="#covariance"> + <rdfs:range rdf:resource="#CovarianceMatrix"/> + <rdfs:domain rdf:resource="#SpatialThing-Localized"/> + <rdfs:subPropertyOf rdf:resource="&knowrob;#covariance"/> + </owl:ObjectProperty> + + <owl:ObjectProperty rdf:about="#orientation"> + <rdfs:range rdf:resource="#RotationMatrix"/> + <rdfs:domain rdf:resource="#SpatialThing-Localized"/> + <rdfs:subPropertyOf rdf:resource="&knowrob;#orientation"/> + </owl:ObjectProperty> + + <computable:PrologProperty rdf:about="#computeLoOrientation"> + <computable:command rdf:datatype="&xsd;string">comp_ros:comp_lo_orientation</computable:command> + <computable:cache rdf:datatype="&xsd;string">dontCache</computable:cache> + <computable:visible rdf:datatype="&xsd;string">unvisible</computable:visible> + <computable:target rdf:resource="#orientation"/> + </computable:PrologProperty> + + <computable:PrologProperty rdf:about="#computeLoCovariance"> + <computable:command rdf:datatype="&xsd;string">comp_ros:comp_lo_covariance</computable:command> + <computable:cache rdf:datatype="&xsd;string">dontCache</computable:cache> + <computable:visible rdf:datatype="&xsd;string">unvisible</computable:visible> + <computable:target rdf:resource="#covariance"/> + </computable:PrologProperty> + + +</rdf:RDF> Added: stacks/knowrob/comp_ros/prolog/comp_ros.pl =================================================================== --- stacks/knowrob/comp_ros/prolog/comp_ros.pl (rev 0) +++ stacks/knowrob/comp_ros/prolog/comp_ros.pl 2010-04-24 23:07:40 UTC (rev 466) @@ -0,0 +1,124 @@ +/** <module> comp_ros + + Interface to ROS to retrieve information via the robot middleware + + The computables defined here are stubs that interface with a client program + written in Java inside the KBClient class + + Copyright (C) 2010 by Moritz Tenorth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +@author Moritz Tenorth +@license GPL +*/ + +:- module(comp_ros, + [ + comp_lo_orientation/2, + comp_lo_covariance/2, + query_lo_orientation/5, + query_lo_covariance/5 + ]). + +:- use_module(library('semweb/rdfs')). +:- use_module(library('semweb/rdf_db')). +:- use_module(library('semweb/rdfs_computable')). +:- use_module(library('jpl')). +:- use_module(library('util')). + + +%% comp_lo_orientation(+Name, -Orientation) is nondet. +% +% Compute the orientation of object Name by issueing a 'namequery' to the +% lo-service via the ROS middleware. +% +% @param Name Object identifier +% @param Orientation Orientation matrix (4x4) as String rotMat3D-(P00)-(P01)-(P02)-(P03)-(P10)-(P11)-(P12)-(P13)-(P20)-(P21)-(P22)-(P23)-(P30)-(P31)-(P32)-(P33) + + comp_lo_orientation(Name, Orientation) :- + rdfs_instance_of(Name, knowrob:'EnduringThing-Localized'),!, + query_lo_orientation('namequery', Name, -1, -1, Orientation). + + +%% comp_lo_covariance(+Name, -Covariance) is nondet. +% +% Compute the covariance of object Name by issueing a 'namequery' to the +% lo-service via the ROS middleware. +% +% @param Name Object identifier +% @param Covariance Covariance matrix (6x6) as String covMat3D-(P00)-(P01)-(P02)-(P03)-(P04)-(P05)-(P10)-(P11)-(P12)-(P13)-(P14)-(P15)-(P20)-(P21)-(P22)-(P23)-(P24)-(P25)-(P30)-(P31)-(P32)-(P33)-(P34)-(P35)-(P40)-(P41)-(P42)-(P43)-(P44)-(P45)-(P50)-(P51)-(P52)-(P53)-(P54)-(P55) + + comp_lo_covariance(Name, Covariance) :- + rdfs_instance_of(Name, knowrob:'EnduringThing-Localized'),!, + query_lo_covariance('namequery', Name, -1, -1, Covariance). + + + +%% query_lo_orientation(+Type, ?Name, ?ObjID, ?ParentID, -Orientation) is nondet. +% +% Low-level interface to the ROS lo-service for computing and converting positions +% and orientations in different coordinate systems +% +% @param Type lo query type, either 'namequery' or 'framequery' +% @param Name lo object name (needs to be bound for 'namequery' +% @param ObjID lo object ID (needs to be bound for 'framequery' +% @param ParentID lo parent object ID (i.e. ID of the reference coordinate frame), can be bound for 'framequery' +% @param Orientation returned orientation matrix (4x4) as String rotMat3D-(P00)-(P01)-(P02)-(P03)-(P10)-(P11)-(P12)-(P13)-(P20)-(P21)-(P22)-(P23)-(P30)-(P31)-(P32)-(P33) + + query_lo_orientation(Type, Name, ObjID, ParentID, Orientation) :- + + % call lo + jpl_call('KBClient', 'loQuery', [Type, Name, ObjID, ParentID], Answer), + jpl_get(Answer, 'pose', JPose), + arrays_to_lists(JPose, Pose), + + % read the single pose values from the result, combine to string representation + nth0(0, Pose, P00), nth0(1, Pose, P01), nth0(2, Pose, P02), nth0(3, Pose, P03), + nth0(4, Pose, P10), nth0(5, Pose, P11), nth0(6, Pose, P12), nth0(7, Pose, P13), + nth0(8, Pose, P20), nth0(9, Pose, P21), nth0(10, Pose, P22), nth0(11, Pose, P23), + nth0(12, Pose, P30), nth0(13, Pose, P31), nth0(14, Pose, P32), nth0(15, Pose, P33), + term_to_atom(rotMat3D-(P00)-(P01)-(P02)-(P03)-(P10)-(P11)-(P12)-(P13)-(P20)-(P21)-(P22)-(P23)-(P30)-(P31)-(P32)-(P33), Orientation). + + + + +%% query_lo_covariance(+Type, ?Name, ?ObjID, ?ParentID, -Covariance) is nondet. +% +% Low-level interface to the ROS lo-service for computing and converting positions +% and orientations in different coordinate systems +% +% @param Type lo query type, either 'namequery' or 'framequery' +% @param Name lo object name (needs to be bound for 'namequery' +% @param ObjID lo object ID (needs to be bound for 'framequery' +% @param ParentID lo parent object ID (i.e. ID of the reference coordinate frame), can be bound for 'framequery' +% @param Covariance returned covariance matrix (6x6) as String covMat3D-(P00)-(P01)-(P02)-(P03)-(P04)-(P05)-(P10)-(P11)-(P12)-(P13)-(P14)-(P15)-(P20)-(P21)-(P22)-(P23)-(P24)-(P25)-(P30)-(P31)-(P32)-(P33)-(P34)-(P35)-(P40)-(P41)-(P42)-(P43)-(P44)-(P45)-(P50)-(P51)-(P52)-(P53)-(P54)-(P55) + + query_lo_covariance(Type, Name, ObjID, ParentID, Covariance) :- + + % call lo + jpl_call('KBClient', 'loQuery', [Type, Name, ObjID, ParentID], Answer), + jpl_get(Answer, 'cov', JCov), + arrays_to_lists(JCov, Cov), + + % read the single cov values from the result, combine to string representation + nth0(0, Cov, P00), nth0(1, Cov, P01), nth0(2, Cov, P02), nth0(3, Cov, P03), nth0(4, Cov, P04), nth0(5, Cov, P05), + nth0(6, Cov, P10), nth0(7, Cov, P11), nth0(8, Cov, P12), nth0(9, Cov, P13), nth0(10, Cov, P14), nth0(11, Cov, P15), + nth0(12, Cov, P20), nth0(13, Cov, P21), nth0(14, Cov, P22), nth0(15, Cov, P23), nth0(16, Cov, P24), nth0(17, Cov, P25), + nth0(18, Cov, P30), nth0(19, Cov, P31), nth0(20, Cov, P32), nth0(21, Cov, P33), nth0(22, Cov, P34), nth0(23, Cov, P35), + nth0(24, Cov, P40), nth0(25, Cov, P41), nth0(26, Cov, P42), nth0(27, Cov, P43), nth0(28, Cov, P44), nth0(29, Cov, P45), + nth0(30, Cov, P50), nth0(31, Cov, P51), nth0(32, Cov, P52), nth0(33, Cov, P53), nth0(34, Cov, P54), nth0(35, Cov, P55), + + term_to_atom(covMat3D-(P00)-(P01)-(P02)-(P03)-(P04)-(P05)-(P10)-(P11)-(P12)-(P13)-(P14)-(P15)-(P20)-(P21)-(P22)-(P23)-(P24)-(P25)-(P30)-(P31)-(P32)-(P33)-(P34)-(P35)-(P40)-(P41)-(P42)-(P43)-(P44)-(P45)-(P50)-(P51)-(P52)-(P53)-(P54)-(P55), Covariance). + Added: stacks/knowrob/comp_ros/prolog/init.pl.in =================================================================== --- stacks/knowrob/comp_ros/prolog/init.pl.in (rev 0) +++ stacks/knowrob/comp_ros/prolog/init.pl.in 2010-04-24 23:07:40 UTC (rev 466) @@ -0,0 +1,33 @@ +%% +%% Copyright (C) 2010 by Moritz Tenorth +%% +%% This program is free software; you can redistribute it and/or modify +%% it under the terms of the GNU General Public License as published by +%% the Free Software Foundation; either version 3 of the License, or +%% (at your option) any later version. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% GNU General Public License for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with this program. If not, see <http://www.gnu.org/licenses/>. +%% + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% dependencies + +:- register_ros_package(ias_knowledge_base). +:- register_ros_package(comp_ros). + +:- use_module(library('comp_ros')). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% parse OWL files, register name spaces + +:- owl_parser:owl_parse('@LOCAL_PACKAGE_PATH@/owl/comp_ros.owl', false, false, true). +:- rdf_db:rdf_register_ns(comp_ros, 'http://ias.cs.tum.edu/kb/comp_ros.owl#', [keep(true)]). + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |