Revision: 7105
http://playerstage.svn.sourceforge.net/playerstage/?rev=7105&view=rev
Author: natepak
Date: 2008-10-17 17:13:40 +0000 (Fri, 17 Oct 2008)
Log Message:
-----------
Added laser example
Added Paths:
-----------
code/gazebo/trunk/examples/player/laser/
code/gazebo/trunk/examples/player/laser/.player
code/gazebo/trunk/examples/player/laser/.sconsign.dblite
code/gazebo/trunk/examples/player/laser/SConstruct
code/gazebo/trunk/examples/player/laser/laser.cc
code/gazebo/trunk/examples/player/laser/player.cfg
Added: code/gazebo/trunk/examples/player/laser/.player
===================================================================
--- code/gazebo/trunk/examples/player/laser/.player
(rev 0)
+++ code/gazebo/trunk/examples/player/laser/.player 2008-10-17 17:13:40 UTC
(rev 7105)
@@ -0,0 +1,9 @@
+/home/nate/work/psg/player/libplayercore/plugins.cc:158 trying to load
/home/nate/work/psg/gazebo/trunk/examples/player/laser/./libgazeboplugin...
+/home/nate/work/psg/player/libplayercore/plugins.cc:162 failed
(/home/nate/work/psg/gazebo/trunk/examples/player/laser/./libgazeboplugin.so:
cannot open shared object file: No such file or directory)
+
+/home/nate/work/psg/player/libplayercore/plugins.cc:173 trying to load
/home/nate/local/lib/libgazeboplugin...
+/home/nate/work/psg/player/libplayercore/plugins.cc:175 success
+/home/nate/work/psg/player/libplayercore/plugins.cc:215 invoking
player_driver_init()...
+/home/nate/work/psg/player/libplayercore/plugins.cc:231 success
+/home/nate/work/psg/player/libplayertcp/playertcp.cc:288 accepted TCP client 0
on port 6665, fd 7
+/home/nate/work/psg/player/libplayertcp/playertcp.cc:385 closing TCP
connection to client 0 on port 6665
Added: code/gazebo/trunk/examples/player/laser/.sconsign.dblite
===================================================================
(Binary files differ)
Property changes on: code/gazebo/trunk/examples/player/laser/.sconsign.dblite
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: code/gazebo/trunk/examples/player/laser/SConstruct
===================================================================
--- code/gazebo/trunk/examples/player/laser/SConstruct
(rev 0)
+++ code/gazebo/trunk/examples/player/laser/SConstruct 2008-10-17 17:13:40 UTC
(rev 7105)
@@ -0,0 +1,15 @@
+
+# 3rd party packages
+parseConfigs=['pkg-config --cflags --libs playerc++']
+
+
+env = Environment (
+ CC = 'g++',
+ CCFLAGS = Split ('-pthread -pipe -W -Wall -O2'),
+)
+
+# Parse all the pacakge configurations
+for cfg in parseConfigs:
+ env.ParseConfig(cfg)
+
+env.Program('laser','laser.cc')
Added: code/gazebo/trunk/examples/player/laser/laser.cc
===================================================================
--- code/gazebo/trunk/examples/player/laser/laser.cc
(rev 0)
+++ code/gazebo/trunk/examples/player/laser/laser.cc 2008-10-17 17:13:40 UTC
(rev 7105)
@@ -0,0 +1,39 @@
+#include <libplayerc++/playerc++.h>
+#include <iostream>
+
+int main()
+{
+ // We throw exceptions on creation if we fail
+ try
+ {
+ using namespace PlayerCc;
+ using namespace std;
+
+ // Create a player client object, using the variables assigned by the
+ // call to parse_args()
+ PlayerClient robot(PlayerCc::PLAYER_HOSTNAME, PlayerCc::PLAYER_PORTNUM);
+
+ // Subscribe to the laser proxy
+ LaserProxy lp(&robot, 0);
+
+ // Print out some stuff
+ std::cout << robot << std::endl;
+
+ for (;;)
+ {
+ // This blocks until new data comes
+ robot.Read();
+
+ for (unsigned int i=0; i < lp.GetCount(); i++)
+ {
+ printf("[%f %d]", lp.GetRange(i), lp.GetIntensity(i) );
+ }
+ printf("\n");
+ }
+ }
+ catch (PlayerCc::PlayerError e)
+ {
+ std::cerr << "Error:" << e << std::endl;
+ return -1;
+ }
+}
Property changes on: code/gazebo/trunk/examples/player/laser/laser.cc
___________________________________________________________________
Added: svn:executable
+ *
Added: code/gazebo/trunk/examples/player/laser/player.cfg
===================================================================
--- code/gazebo/trunk/examples/player/laser/player.cfg
(rev 0)
+++ code/gazebo/trunk/examples/player/laser/player.cfg 2008-10-17 17:13:40 UTC
(rev 7105)
@@ -0,0 +1,19 @@
+
+# Desc: Player sample configuration file for controlling Gazebo devices
+# Date: 18 Apr 2003
+# CVS: $Id: gazebo.cfg,v 1.4.2.1 2006/12/16 22:43:23 natepak Exp $
+
+driver
+(
+ name "gazebo"
+ provides ["simulation:0"]
+ plugin "libgazeboplugin"
+ server_id "default"
+)
+
+driver
+(
+ name "gazebo"
+ provides ["laser:0"]
+ gz_id "laser_iface_0"
+)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit