Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
doc:marker_visualization [2014/12/07 07:17] – [Marker-based visualization canvas] admindoc:marker_visualization [2015/10/19 15:06] – [Usage] daniel86
Line 11: Line 11:
 ===== Usage ===== ===== Usage =====
  
-The following queries read data from a semantic map and visualize it in the browser-based visualization.+First, setup the rosbridge communication interface and initialiaze the `knowrob_vis` package.
  
   $ roslaunch rosbridge_server rosbridge_websocket.launch   $ roslaunch rosbridge_server rosbridge_websocket.launch
   $ rosrun rosprolog  rosprolog knowrob_vis   $ rosrun rosprolog  rosprolog knowrob_vis
      
-  load packages, start marker publisher +Markers must be explicitly published by the user with following query ([[http://www.open-ease.org/|openEASE]] does this automatically). 
-  ?- visualisation_canvas+ 
-  +  publish modified marker 
 +  ?- marker_publish. 
 + 
 +==== Marker Types ==== 
 + 
 +The set of supported marker primitive types can be queried using the ''marker_prop_type(Type,_)'' predicate. 
 +The primitive types include arrow, cube, sphere, cylinder, line_strip, line_list, cube_list, sphere_list, points, text_view_facing, mesh_resource and triangle_list. 
 +Primitive markers can be created using ''marker($type('Name'),_)'', where $type must be replaced by one of the primitive types. 
 + 
 +In addition, KnowRob supports a set of complex marker types
 +  * **cylinder_tf(Frame0,Frame1)**: A cylinder between 2 links 
 +  * **link(Frame)**: A marker that takes the pose of a link 
 +  * **trajectory(Frame)**: A trajectory of a link 
 +  * **trail(Frame)**: A trail of a link (trajectory with alpha fade) 
 +  * **average_trajectory(Frame)**: The average over multiple trajectories 
 +  * **pointer(Frame0,Frame1)**: Arrow that points from Frame0 in the direction of Frame1 
 +  * **object(Name)**: A marker that represents an OWL individual (including children objects) 
 +  * **agent(Name)**: A marker that represents an OWL agent individual (including all links) 
 +  * **stickman(Name)**: A special human skeleton visualization, kinematic structure is spanned by the OWL individual indentified by Name 
 + 
 +==== Semantic Map Marker ==== 
 + 
 +The following queries read data from a semantic map and visualize it in the browser-based visualization. 
   % load and visualize semantic map   % load and visualize semantic map
   ?- owl_parse('package://knowrob_map_data/owl/ccrl2_semantic_map.owl').   ?- owl_parse('package://knowrob_map_data/owl/ccrl2_semantic_map.owl').
-  ?- owl_individual_of(A, knowrob:'SemanticEnvironmentMap'), add_object_with_children(A).+  ?- owl_individual_of(A, knowrob:'SemanticEnvironmentMap'), marker_update(object(A)).
      
   % highlight all electrical household appliances   % highlight all electrical household appliances
-  ?- owl_individual_of(A, knowrob:'ElectricalHouseholdAppliance'),  +  ?- owl_individual_of(A, knowrob:'ElectricalHouseholdAppliance'), marker_highlight(object(A)). 
-     highlight_object(A, @(true)).+ 
 +==== Agent Marker ==== 
 + 
 +The following queries read data from a robot descriptionlook up the robot pose in the mongo DB 
 +and visualize it in the browser-based visualization. 
 + 
 +  % load and visualize the pr2 robot for given timepoint T 
 +  ?- owl_parse('package://knowrob_srdl/owl/PR2.owl')
 +  ?- mng_robot_pose_at_time(pr2:'PR2Robot1','/map',T,_), marker_update(object(pr2:'PR2Robot1'),End). 
 + 
 +==== Trajectory Marker ====
  
 +The following queries read data from a robot description, sample the '/base_link' between T0 and T1
 +and visualize it in the browser-based visualization.
  
 +  % load and visualize the base link of the pr2 robot for given timerange (T0,T1)
 +  ?- owl_parse('package://knowrob_srdl/owl/PR2.owl').
 +  ?- marker_update(trajectory('/base_link'), interval(T0,T1,dt(Interval))).
 ===== Visualizing 3D object meshes ===== ===== Visualizing 3D object meshes =====