Revision: 8045
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8045&view=rev
Author:   robotos
Date:     2009-07-17 00:27:36 +0000 (Fri, 17 Jul 2009)

Log Message:
-----------
added simulation interface example

Modified Paths:
--------------
    code/player/trunk/client_libs/libplayerc/bindings/ruby/examples/test.rb

Added Paths:
-----------
    
code/player/trunk/client_libs/libplayerc/bindings/ruby/examples/simulation.rb

Added: 
code/player/trunk/client_libs/libplayerc/bindings/ruby/examples/simulation.rb
===================================================================
--- 
code/player/trunk/client_libs/libplayerc/bindings/ruby/examples/simulation.rb   
                            (rev 0)
+++ 
code/player/trunk/client_libs/libplayerc/bindings/ruby/examples/simulation.rb   
    2009-07-17 00:27:36 UTC (rev 8045)
@@ -0,0 +1,29 @@
+#testing a fiducial interface
+
+require 'playerc'
+
+class PlayercExamples 
+
+  def simulation
+    if @connection.nil? 
+      raise 'our connection is not valid!'
+    end
+    simulation = Playerc::Playerc_simulation.new(@connection, 0)
+    if simulation.subscribe(Playerc::PLAYER_OPEN_MODE) != 0
+      raise  Playerc::playerc_error_str()
+    end
+
+#    if @connection.read.nil?
+#      raise Playerc::playerc_error_str()
+#    end
+    pose = simulation.get_pose2d("pioneer2dx_model1") 
+    puts "robot global coordinates, x #{pose[1]}, y #{pose[2]},  yaw 
#{pose[3]}"
+
+    methods = simulation.public_methods(false).sort.map {|e| e.to_s + ", 
"}.to_s
+    
+    p "simulation interface is cool, methods available: ",  methods
+
+    simulation.unsubscribe()
+
+  end
+end

Modified: 
code/player/trunk/client_libs/libplayerc/bindings/ruby/examples/test.rb
===================================================================
--- code/player/trunk/client_libs/libplayerc/bindings/ruby/examples/test.rb     
2009-07-17 00:03:28 UTC (rev 8044)
+++ code/player/trunk/client_libs/libplayerc/bindings/ruby/examples/test.rb     
2009-07-17 00:27:36 UTC (rev 8045)
@@ -3,6 +3,7 @@
 require 'playerc'
 require 'laser'
 require 'fiducial'
+require 'simulation'
 #require 'wifi'
 
 class PlayercExamples


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Playerstage-commit mailing list
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to