This is an old revision of the document!


Reasoning about logged robot experiences

Symbolic reasoning about logged data

This page lists different queries related to the sybolic inference about logged data stored in a MongoDB database.

Startup

$ rosrun rosprolog rosprolog knowrob_mongo
?- register_ros_package(mod_srdl).
?- owl_parse('owl/perceive-no-details.owl', false, false, true).

Queries

# read pose of cameras in /map coordinates at the beginning of event_dInF6Fvz
?- owl_individual_of(A, srdl2comp:'Camera'), 
   owl_has(A, srdl2comp:urdfName, literal(_Frame)), 
   atom_concat('/', _Frame, Frame), 
   owl_has('http://ias.cs.tum.edu/kb/execution-log-atvVerRS#event_dInF6Fvz', knowrob:startTime, Time), 
   mng_lookup_transform('/map', Frame, Time, Trans). 
   
   
# read latest designator that was logged before the end of event_dInF6Fvz
?- owl_has('http://ias.cs.tum.edu/kb/execution-log-atvVerRS#event_dInF6Fvz', knowrob:endTime, Time), 
   mng_latest_designator_before_time(Time, Type, Pose).
?- knowrob_mongo:obj_visible_in_camera('http://ias.cs.tum.edu/kb/PR2.owl#pr2_l_elbow_flex_link', 
'http://ias.cs.tum.edu/kb/PR2.owl#pr2_head_mount_kinect_rgb_link', 
'http://ias.cs.tum.edu/kb/namespace_LMutVndu#timepoint_1376577918').
true .
# Which camera can see the robot part A?
?- knowrob_mongo:obj_visible_in_camera('http://ias.cs.tum.edu/kb/PR2.owl#pr2_l_wrist_flex_link', 
Camera, 'http://ias.cs.tum.edu/kb/namespace_LMutVndu#timepoint_1376577918').
Camera = 'http://ias.cs.tum.edu/kb/PR2.owl#pr2_wide_stereo_l_stereo_camera_frame' ;
Camera = 'http://ias.cs.tum.edu/kb/PR2.owl#pr2_wide_stereo_r_stereo_camera_frame' ;
Camera = 'http://ias.cs.tum.edu/kb/PR2.owl#pr2_head_mount_kinect_ir_link' ;
Camera = 'http://ias.cs.tum.edu/kb/PR2.owl#pr2_head_mount_kinect_rgb_link' ;

The following is to be performed from the roslog_2013_08_29_1445 folder:

# Is some part of the right arm blocking the view on the object?
?- register_ros_package(mod_srdl), owl_parse('perceive-no-details.owl', false, false, true).
?- mng_obj_pose_by_desig('http://ias.cs.tum.edu/kb/cram_log.owl#VisualPerception_Z9fXhEae_object_0', Pose).
?- sub_component(pr2:pr2_right_arm, Part), 
   once(owl_individual_of(Part, srdl2comp:'UrdfLink')),
   obj_blocked_by_in_camera(log:'VisualPerception_Z9fXhEae_object_0', Part, 
   pr2:pr2_head_mount_kinect_rgb_link, log:'timepoint_1377780296').
   
# Is the object visible in the camera, given the camera's field of view?
?- obj_visible_in_camera(log:'VisualPerception_Z9fXhEae_object_0', 
                         pr2:pr2_head_mount_kinect_rgb_link,   
                         log:'timepoint_1377780219').
false.

?- obj_visible_in_camera(log:'VisualPerception_Z9fXhEae_object_0', 
                         pr2:pr2_head_mount_kinect_rgb_link,
                         log:'timepoint_1377780271').
true .

Reasoning over plan logs using mod_execution_trace

Prerequisites

1) Get latest version of knowrob and knowrob_addons from Link 1 Link 2 respectively. Put these ROS stacks into your ROS workspace.

2) Get the dataset from Link (Note that dataset is slightly modified version of Jan's. Namely, some modifications were done in namespaces and class namings). Extract it somewhere you choose.

Starting up the Software

$ rosrun rosprolog rosprolog mod_vis
?- register_ros_package(mod_execution_trace).
?- owl_parse('path_of_dataset_should_be_here/perceive-no-details.owl', false, false, true).

Example Query

“What is the probability of a certain task was failed during the execution of a plan?” is shown as an example. It is also one of the use-cases what we want to show in our ACS'13 paper.

?- aggregate_all(count,(task(Task), task_class(Task, 'http://ias.cs.tum.edu/kb/knowrob_cram.owl#AchieveGoalPerformOnProcessModule'),  failure_class(Error, Error_Class), failure_task(Error, Task)), Count), aggregate_all(count,(task(Task), task_class(Task, 'http://ias.cs.tum.edu/kb/knowrob_cram.owl#AchieveGoalPerformOnProcessModule')), Count2), Prob = Count/Count2.

Open issues

Note that some predicates still don't work because I'm still implementing/modifying them

Representation and reasoning

Infrastructure